- #Enable the async interface
- set target-async 1
- #If using the CLI, pagination breaks non-stop
- set pagination off
- #Finall, turn it on
- set non-stop on
- info threads 显示所有线程
- thread id 切换到指定线程
- break filename:linenum thread all 在所有线程相应行设置断点,注意如果主线程不会执行到该行,并且启动all-stop模式,主线程执行n或s会切换过去
- set scheduler-locking off|on\step 默认off,执行s或c其它线程也同步执行。on,只有当前相称执行。step,只有当前线程执行
- show scheduler-locking 显示当前模式
- thread apply all command 每个线程执行同意命令,如bt。或者thread apply 1 3 bt,即线程1,3执行bt。
四:core文件
- ulimit -c unlimited 生成core文件,也可以是指定大小,然后使用gdb ./main core启动,bt查看调用栈即可。
GDB常用调试命令以及多进程多线程调试
标签:inf add address cli bar 单位 ignore arc 有用