一、具体方法
-
attach一个进程
gdb attach pid -
查看线程信息
info threadsId Target Id Frame
1 Thread 0x7f5ccfd39740 (LWP 24823) “mono” 0x00007f5ccf202528 in pthread_cond_timedwait@@GLIBC_2.3.2 () from target:/lib/x86_64-linux-gnu/libpthread.so.0
2 Thread 0x7f5ccd7ff700 (LWP 24843) “SGen worker” 0x00007f5ccf20217f in pthread_cond_wait@@GLIBC_2.3.2 () from target:/lib/x86_64-linux-gnu/libpthread.so.0
3 Thread 0x7f5ccb17d700 (LWP 24844) “Finalizer” 0x00007f5ccf204556 in do_futex_wait.constprop () from target:/lib/x86_64-linux-gnu/libpthread.so.0
4 Thread 0x7f5cc079f700 (LWP 24923) “Thread Pool I/O” 0x00007f5cced1e8bd in poll () from target:/lib/x86_64-linux-gnu/libc.so.6
5 Thread 0x7f5c7945f700 (LWP 22291) “Thread Pool Wor” 0x00007f5ccf204720 in do_futex_wait () from target:/lib/x86_64-linux-gnu/libpthread.so.0 -
选择指定的线程
thread 1 -
下一步
n -
取消单步调试
c -
断点
break -
查看断点
info break -
删除断点
delete 1 -
删除一批断点
delete 1-5 -
继续上一次的操作
换行