gdb调试多线程

gdb调试多线程程序

1
2
3
4
5
# 查看进程book
ps aux |grep book
 
# 查看线程 book
 ps -aL| grep book

 

在gdb中执行 

1
 

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 查看线程数
info threads
 
# 切换线程
thread thread_id
 
# 只运行当前线程,其他线程挂起
set scheduler-locking on
 
# 运行全部的线程
set scheduler-locking off
 
# 指定某线程执行某gdb命令
thread apply thread_id cmd
# 例如
thread apply 3 c
thread apply 3 n
 
# 全部的线程执行某gdb命令
thread apply all cmd

  

posted @   FigureOut  阅读(18)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
点击右上角即可分享
微信分享提示