当我附加到进程或命中断点时,所有线程都会暂停。我找不到如何暂停一个线程,让其他线程继续运行。
我找不到如何暂停一个线程,让其他线程继续运行。
除了本答案中提到的不间断模式和此处提到的调度程序锁定之外,您还可以这样做:
# arrange for GDB to stop in the thread you want to suspend.
(gdb) call sleep(1000) # current thread will sleep, all others will continue running