输入banner图图片脚本导航/分类

GDB 多线程调试:只停止断点的线程,其他线程任然执行; 或只运行某些线程 其他线程中断

target-async 1 set pagination off set non-stop on

  然后 attach 到正在运行的线程

  gdb thrname thrID

  

 

3. 然后可以用一下方式中断某个线程,其他线程保持运行; 或只运行某些线程 其他线程中断

  3. 1 下断点到某个线程

    b file:line thrNum

    thrNum 可以在gdb中  用 info thr 命令查看

    当这个线程执行到断点时,这个线程就停止了,但是其他线程不停止,还在继续执行

  3.2 切换到某个线程

     thr xthrNum

     thrNum 可以在gdb中  用 info thr 命令查看

     然后 输入命令继续执行这个线程  c

     或者 执行某几个线程

     thr apply thrNum1 thrNum2 ... continue 

     thrNum1 thrNum2 ... 为线程序号(用 info thr 命令查看)

 

GDB 多线程调试:只停止断点的线程,其他线程任然执行; 或只运行某些线程 其他线程中断

标签: