GDB scheduler-locking 命令详解

GDB> show scheduler-locking     //显示线程的scheduler-locking状态
GDB> set scheduler-locking on    //调试加锁当前线程,停止所有其他线程

set scheduler-locking mode
Set the scheduler locking mode. It applies to normal execution, record mode, and replay mode. If it is off, then there is no locking and any thread may run at any time. If on, then only the current thread may run when the inferior is resumed. The step mode optimizes for single-stepping; it prevents other threads from preempting the current thread while you are stepping, so that the focus of debugging does not change unexpectedly. Other threads never get a chance to run when you step, and they are completely free to run when you use commands like ‘continue’, ‘until’, or ‘finish’. However, unless another thread hits a breakpoint during its timeslice, GDB does not change the current thread away from the thread that you are debugging. The replay mode behaves like off in record mode and like on in replay mode.

show scheduler-locking
Display the current scheduler locking mode.

By default, when you issue one of the execution commands such as continue, next or step, GDB allows only threads of the current inferior to run. For example, if GDB is attached to two inferiors, each with two threads, the continue command resumes only the two threads of the current inferior. This is useful, for example, when you debug a program that forks and you want to hold the parent stopped (so that, for instance, it doesn’t run to exit), while you debug the child. In other situations, you may not be interested in inspecting the current state of any of the processes GDB is attached to, and you may want to resume them all until some breakpoint is hit. In the latter case, you can instruct GDB to allow all threads of all the inferiors to run with the set schedule-multiple command.

set schedule-multiple
Set the mode for allowing threads of multiple processes to be resumed when an execution command is issued. When on, all threads of all processes are allowed to run. When off, only the threads of the current process are resumed. The default is off. The scheduler-locking mode takes precedence when set to on, or while you are stepping and set to step.

show schedule-multiple
Display the current mode for resuming the execution of threads of multiple processes.

GDB> set scheduler-locking off
GDB> show schedule
schedule-multiple  scheduler-locking
GDB> show scheduler-locking
Mode for locking scheduler during execution is "off".
GDB> set scheduler-locking step
GDB> show scheduler-locking
Mode for locking scheduler during execution is "step".
GDB> set scheduler-locking on
GDB> show scheduler-locking
Mode for locking scheduler during execution is "on".

转载于:https://www.cnblogs.com/pugang/p/7698772.html

GDB scheduler-locking 命令详解相关推荐

  1. gdb和arm-linux-gdb命令详解

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! 在PC机 ...

  2. strace 命令详解

    一.strace 是什么? 按照 strace 官网的描述,strace 是一个可用于诊断.调试和教学的 Linux 用户空间跟踪器.我们用它来监控用户空间进程和内核的交互,比如系统调用.信号传递.进 ...

  3. linux问题排查常用命令详解

    前阵子部署的nginx服务器出现了故障,针对故障现场做了个排查,后来发现是nginx的quic分支代码的问题,出现了死循环导致CPU 近100% 记录下在排查的思路和排查过程中使用的命令和工具 查看C ...

  4. linux命令大全 美pdf,Linux编程命令详解_10331298_(美)Richard..pdf-得力文库

    Linux编程命令详解_10331298_(美)Richard....pdf General Ination 书名Linux编程命令详解 作者(美)Richard Petersen著:梁普选,刘玉芬等 ...

  5. flock用法详解 linux_netstat命令详解

    它主要的用法和详解! (netstat -na 命令),本文主要是说Linux下的netstat工具,然后详细说明一下各种网络连接状态. netstat -nat |awk '{print $6}'| ...

  6. UNIX经典命令详解

    UNIX经典命令详解 第一章 目录及文件操作命令 1.1 ls [语法]: ls [-RadCxmlnogrtucpFbqisf1] [目录或文件......]  [说明]: ls 命令列出指定目录下 ...

  7. 【Linux系列-2】iostat命令详解

    iostat命令详解 1 iostat简介 2 命令与参数项 2.1 命令格式 2.2 参数详解 3 输出项目说明 3.1 cpu属性 3.2 磁盘属性 4 使用实例 4.1 查看磁盘详情 4.2 其 ...

  8. docker常用命令详解

    docker常用命令详解 本文只记录docker命令在大部分情境下的使用,如果想了解每一个选项的细节,请参考官方文档,这里只作为自己以后的备忘记录下来. 根据自己的理解,总的来说分为以下几种: Doc ...

  9. oracle home 命令,$ORACLE_HOMEbin目录下所有命令的使用方法及命令详解

    求$ORACLE_HOME/bin目录下所有命令的使用方法及命令详解 如题. $ORACLE_HOME/bin目录下有很多命令,那我们平时用到的也不是太多,即使用到的那部分可能用法也不是完全能掌握,所 ...

最新文章

  1. 将字符串转换成ListT
  2. android 手机号码去重,第135天:移动端开发经验总结
  3. 【python】pycharm启动 一直index,无法运行
  4. javascript中类的定义和使用{转载}
  5. windows下c 用mysql数据库_Windows环境下C/C++访问PostgreSQL数据库
  6. Python批量提取PowerPoint文件中所有幻灯片标题和备注文本
  7. 几种方法找到整型阵列中的最大值和最小值
  8. PyQt4, class:mouseButtons用法
  9. 在Shell中,“$“和““的作用
  10. Linux中kobject的作用,Linux设备驱动模型-- 数据结构Kset/KObject
  11. 《Effective Python》笔记
  12. C1083: 无法打开包括文件: “stdafx.h”: No such file or directory
  13. Windows系统下桌面右键菜单新建项管理
  14. Matplotlib直方图
  15. 币图_教你什么是IM 去中心化概念模型与架构设计
  16. 99%的人看了它都会说这是一篇很全的tomcat服务❤️❤️[⭐建议收藏⭐]
  17. 这几种[儿童益智玩具] 永远不过时!
  18. html怎么加深字体颜色,我打印网页的字的颜色非常浅,怎样才能加深? – 手机爱问...
  19. 心理专家浅谈舍弃不必要的虚荣!
  20. 褚老与褚橙,探秘情感消费市场的内核

热门文章

  1. python获取Linux信息
  2. MyBatis 一级缓存二级缓存详解
  3. 1047. 编程团体赛(20)-PAT乙级真题
  4. 蓝桥杯 ALGO-12 算法训练 幂方分解
  5. [Python] L1-025. 正整数A+B-PAT团体程序设计天梯赛GPLT
  6. 在XCode的一个项目中创建多个C/C++/Cpp文件并分别运行——创建多个target实现
  7. 1102. Invert a Binary Tree (25)-PAT甲级真题
  8. 中南林科大c语言程序设计,2017年中南林业科技大学计算机与信息工程学院802C语言与数据结构之C程序设计考研强化模拟题...
  9. python如何实现分布式_Python如何快速实现分布式任务
  10. python数字转字符串_python中如何将数字转字符串