114 Star 0 Fork 18

src-openEuler/ltrace

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bugfix-0001-ltrace-byteswap-instruction-in-arm-be8-mode.patch 901 Bytes
一键复制 编辑 原始数据 按行查看 历史
sigui 提交于 2020-02-21 02:22 . Package init
diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
index f974d1f..8526bf1 100644
--- a/sysdeps/linux-gnu/arm/trace.c
+++ b/sysdeps/linux-gnu/arm/trace.c
@@ -77,6 +77,15 @@ syscall_p(struct process *proc, int status, int *sysnum)
unsigned insn = ptrace(PTRACE_PEEKTEXT, proc->pid,
(void *)pc, 0);
+#if defined(__ARMEB__) && defined(__ARM_ARCH_7A__)
+ /* We running big endian arm on ARMv7: instructions are
+ * in little endian form so we need to byteswap it. Note
+ * on older ARM like V5 Xscale code is in big endian form
+ * byte swap is not needed in this case. I.e be8 vs be32.
+ */
+ insn = __builtin_bswap32(insn);
+#endif /* __ARMEB__ && __ARM_ARCH_7A__ */
+
if (insn == 0xef000000 || insn == 0x0f000000
|| (insn & 0xffff0000) == 0xdf000000) {
/* EABI syscall */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/ltrace.git
[email protected]:src-openeuler/ltrace.git
src-openeuler
ltrace
ltrace
master

搜索帮助