当GDB说"No function contains program counter for selected frame"时,如何强制GDB反汇编代码?


当GDB

说"没有函数包含所选帧的程序计数器"时,如何强制GDB反汇编代码?

调试程序,从绝对地址0x00402200开始,尝试反汇编此地址的代码时得到以下输出:

[New Thread 65212.0x10378]
Breakpoint 1, 0x00402200 in ?? ()
(gdb) stepi
0x00402202 in ?? ()
(gdb) stepi
0x00402207 in ?? ()
(gdb) stepi
0x0040220a in ?? ()
(gdb) stepi
0x0040220f in ?? ()
(gdb) disassemble
No function contains program counter for selected frame.
(gdb) stepi
0x00401000 in start ()

正在调试的文件是用于教育目的(逆向工程(的 Win32 PE。

有没有办法告诉GDB开始在地址拆解?否则,我的替代方案是什么(即其他工具(?

disassemble的文档:

(gdb) help disassemble说:

Disassemble a specified section of memory.
Default is the function surrounding the pc of the selected frame.
...
With a single argument, the function surrounding that address is dumped.
Two arguments (separated by a comma) are taken as a range of memory to dump,
  in the form of "start,end", or "start,+length".

因此,在您的情况下,由于程序计数器 (PE( 周围没有函数,因此您应该使用双参数形式,例如:

disassemble 0x00402200, +16disassemble 0x00402200, 0x00402210.

希望这有帮助!

我知道这并不能直接回答您的问题,但是既然已经回答了......

您可以告诉 GDB 显示带有 set disassemble-next-line on 的下一条指令。

最新更新