不停止在gdb中的所有线程 [英] not stopping all threads in gdb
问题描述
GDB正常停止所有线程。我知道像调度锁和进度,多存在命令,但我看不出有任何的可能性,让一个线程定义在后台运行,而另一个调试。
GDB normally stops all threads if a breakpoint is reached (or Ctrl+C is pressed in the GDB shell). I'm aware that commands like scheduler-locking and schedule-multiple exists, but I see no possibility to let a defined thread run in the background while another is debugged.
推荐答案
您可以使用设置
目标异步,使异步模式下,如果你的目标支持它。然后,您可以指定命令后台执行。例如,
You can use set target-async on
to enable asynchronous mode, if your target supports it. Then, you can specify background execution with commands. For example,
continue&
可用于运行的单个线程,以及
can be used to run a single thread, and
interrupt [-a]
暂停单个线程的执行,或整个程序。
to suspend execution of a single thread, or the whole program.
在与非停止模式的同时,您可以检查一个单独的线程,而其他人继续在后台运行:
In conjunction with non-stop mode, you can examine a single thread while others continue to run in the background:
# If using the CLI, pagination breaks non-stop.
set pagination off
# Finally, turn it on!
set non-stop on
# Before debugging is started!
这篇关于不停止在gdb中的所有线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!