GDB多线程调试

https://sourceware.org/gdb/onlinedocs/gdb/Threads.html

命令
automatic notification of new threads

  • ‘thread thread-id’, a command to switch among threads

  • ‘info threads’,a command to inquire about existing threads

  • ‘thread apply [thread-id-list | all] args’, a command to apply a
    command to a list of threads
    thread-specific breakpoints

  • ‘set print thread-events’, which controls printing of messages on
    thread start and exit.
    ‘set libthread-db-search-path path’, which lets the user specify which libthread_db to use if the default choice isn’t compatible with the program.
    自动通知新线程

  • 'thread 线程ID ’ 线程间切换,切换到指定ID的线程 的命令

  • ’info threads‘ 显示所以存在的线程的命令

  • ‘thread apply [thread-id-list | all] args’,对一系列线程使用指令(args)的命令
    线程特定的断点

    • ‘set print thread-events’, 在线程开始和退出时,控制打印信息
    • ‘set libthread-db-search-path path’,在默认选项不兼容的时候 , 用户指定使用哪个libthread_db
      程序运行时,GDB可以观察所有线程。 启动GDB后,有一个当前线程,调试命令从当前线程角度显示程序信息。
      每当 GDB 在程序中检测到新线程时,它都会显示目标系统对该线程的标识ID, 形式因特定系统而异。例如,在 GNU/Linux 上,您可能会看到[New systag]systag

[New Thread 0x41e02940 (LWP 25582)]

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值