Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm架构下 这个宏DETAG_INSTRUCTION_ADDRESS为什么是这么定义的 #12

Open
xuezhulian opened this issue Sep 19, 2018 · 1 comment

Comments

@xuezhulian
Copy link

抱拳抱拳抱拳

@Robinguo2012
Copy link

Robinguo2012 commented Nov 15, 2019

为了去掉指令地址中的指针标签。因为ARMv7 中的地址分为Thumb Mode 和 Normal Mode,对应的指令地址分别是2字节 和 4字节,arm64下指令地址都是4字节,(按照4字节对齐存储,一条指令必须从4的整数倍地址来取)所以指令地址的最后2 bits 肯定都是0,系统一般会在这后两位中插入一个指针标签,要去掉这个标签的值才是真正的指令地址。而x86_64中指令是可变长度的,所有的bits 都是有意义的。
这个宏的作用就是为了适配x86 和 arm平台的指令处理方式不同。
https://github.com/kstenerud/KSCrash/blob/master/Source/KSCrash/Recording/Tools/KSSymbolicator.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants