如何获取GDB内存地址的符号名称? [英] How to get the symbol name for a memory address in GDB?
本文介绍了如何获取GDB内存地址的符号名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,我知道0x46767f0属于一个NSString *,有什么办法可以找出它是什么NSString来帮助我查找一些错误?
信息符号< p> =h2_lin>解决方案
编辑部地址>
打印存储在地址addr中的符号的名称。如果没有符号存储在地址上,GDB会打印出最近的符号和一个偏移量。
示例:
(gdb)信息符号0x400225
_start + 5 /tmp/a.out部分的文本
(gdb)信息符号0x2aaaac2811cf
__read_nocancel + 6在/usr/lib64/libc.so.6部分的文本。
您可以在此处阅读更多信息。
For instance, I know that 0x46767f0 belongs to an NSString*, is there any way I can find out what NSString it is to help me find some bugs I'm after?
解决方案
I believe you're looking for:
info symbol <addresss>
Print the name of a symbol which is stored at the address addr. If no symbol is stored exactly at addr, GDB prints the nearest symbol and an offset from it.
Example:
(gdb) info symbol 0x400225
_start + 5 in section .text of /tmp/a.out
(gdb) info symbol 0x2aaaac2811cf
__read_nocancel + 6 in section .text of /usr/lib64/libc.so.6
You can read more about it here.
这篇关于如何获取GDB内存地址的符号名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文