GDB:从内存地址获取符号名称 [英] GDB: Getting a symbol name from a memory address

查看:1134
本文介绍了GDB:从内存地址获取符号名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我知道0x46767f0属于NSString *,有没有什么方法可以找出什么NSString是帮助我找到一些我以后的错误?

解决方案

我相信你在寻找:

  info symbol&地址> 

打印存储在地址addr中的符号名称。如果没有符号存储在addr中,GDB将打印最近的符号和一个偏移量。



示例:

 (gdb)信息符号0x400225 
_start + 5在/tmp/a.out中的.text文本

(gdb)信息符号0x2aaaac2811cf
__read_nocancel +6 in .us / usr/lib64/libc.so.6

您可以阅读更多关于它的信息 here


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆