我可以给 objdump 一个地址并让它反汇编包含的函数吗?
我发现必须反汇编大量库代码才能获得足够的上下文来查看导致崩溃的原因,这真的很烦人。有什么方法可以让 objdump 传递一个地址,并让它为我找到包含函数的边界吗?
编辑:更好的是,我可以让它为我反汇编整个堆栈跟踪吗?
I'm finding it really annoying to have to disassemble large swathes of library code just to get enough context to see what is causing a crash. Is there any way that I can just hand objdump an address, and have it find the boundaries of the containing function for me?
EDIT: Better yet, can I have it disassemble an entire stack trace for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许是这样的?
它从
0x42
开始打印反汇编列表,直到找到ret(q)
,假设边界由ret 标记(q)
Something like this perhaps?
It prints the dis-assembly listing starting from
0x42
till it finds aret(q)
, assuming the boundary is marked byret(q)
GDB
反汇编
例如:
ac
编译并反汇编
myfunc
以查找地址:输出:
OK,所以 0x00000000000000655 在
myfunc
中code>,让我们确认它是否有效:输出:与之前的反汇编相同。
另请参阅:如何使用 objdump 反汇编单个函数?
在 Ubuntu 18.04、GDB 8.1 上测试。
GDB
disassemble
For example:
a.c
Compile and disassemble
myfunc
to find an address:Output:
OK, so 0x0000000000000655 is in
myfunc
, let's confirm it works:Output: same as previous disassembly.
See also: How to disassemble one single function using objdump?
Tested on Ubuntu 18.04, GDB 8.1.
objdump --start-address= 或许?
objdump --start-address=
perhaps ?