Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我想调试我的程序,我会这样称呼它:
gdb ./myprog $ run < input.txt
但是现在我想逐行执行它,但是我该怎么做呢?我知道该step命令,但我只能调用它,如果之前调用了运行命令。我必须在运行命令之后直接停止执行吗?
step
Gdb有一个start命令,它采用与命令相同的参数run。启动程序后,它会尽快停止,通常在main函数开始时。之后,您可以使用该step命令和任何其他需要实时进程的命令。
Gdb
start
run
main
参考:使用 GDB 调试:启动程序