没有停止gdb中的所有线程

如果达到断点(或者在GDB shell中按下Ctrl + C),GDB通常会停止所有线程。 我知道像调度程序锁定和调度多次这样的命令存在,但我认为没有可能让一个定义的线程在后台运行而另一个调试。

如果目标支持异步模式,则可以使用set target-async on启用异步模式。 然后,您可以使用命令指定后台执行。 例如,

 continue& 

可用于运行单个线程,和

 interrupt [-a] 

暂停执行单个线程或整个程序。

结合不间断模式,您可以检查单个线程,而其他线程继续在后台运行:

  # If using the CLI, pagination breaks non-stop. set pagination off # Finally, turn it on! set non-stop on # Before debugging is started!