Pic*_*ana 71 programming debugging gdb
我help
在 GDB 时打字,但没有找到任何关于进入、跨步和退出的信息。我在_start
( break _start
)的汇编程序中放置了一个断点。之后我打字next
,它完成了调试。我猜是因为它完成了_start
并且没有按照我的意愿进入。
任何人都可以提供帮助?
Ste*_*ris 68
help running
提供了一些提示:
有step
和next
指令(还有nexti
和stepi
)。
(gdb) help next
Step program, proceeding through subroutine calls.
Usage: next [N]
Unlike "step", if the current source line calls a subroutine,
this command does not enter the subroutine, but instead steps over
the call, in effect treating it as a single source line.
Run Code Online (Sandbox Code Playgroud)
所以我们可以看到step
steps进入子程序,但是next
会跳过子程序。
的step
和stepi
(以及next
和nexti
)由“线”或“指令”的增量进行区分。
step -- Step program until it reaches a different source line
stepi -- Step one instruction exactly
Run Code Online (Sandbox Code Playgroud)
相关的是finish
:
(gdb) help finish
Execute until selected stack frame returns.
Usage: finish
Upon return, the value returned is printed and put in the value history.
Run Code Online (Sandbox Code Playgroud)
更多有用的信息位于https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html