Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Debugging 如何强制GDB反汇编代码,当它说;没有函数包含所选帧的程序计数器“;?_Debugging_Assembly_X86_Gdb_Portable Executable - Fatal编程技术网

Debugging 如何强制GDB反汇编代码,当它说;没有函数包含所选帧的程序计数器“;?

Debugging 如何强制GDB反汇编代码,当它说;没有函数包含所选帧的程序计数器“;?,debugging,assembly,x86,gdb,portable-executable,Debugging,Assembly,X86,Gdb,Portable Executable,当GDB说“没有函数包含所选帧的程序计数器”时,如何强制它反汇编代码 调试一个程序时,从绝对地址0x00402200开始,尝试在此地址反汇编代码时,我得到以下输出: [New Thread 65212.0x10378] Breakpoint 1, 0x00402200 in ?? () (gdb) stepi 0x00402202 in ?? () (gdb) stepi 0x00402207 in ?? () (gdb) stepi 0x0040220a in ?? () (gdb) ste

当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从地址开始分解?否则,我的替代方案(即其他工具)是什么?

反汇编:
(gdb)帮助反汇编的文档说明:

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)的函数,因此您应该使用两个参数形式,如:

反汇编0x00402200,+16
反汇编0x00402200,0x00402210


希望这有帮助

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


您可以告诉GDB显示下一条指令,并在
上设置反汇编下一行

反汇编0x402202,+20
布局asm
/
布局reg
很好。谢谢,这正是我需要的。