zoukankan      html  css  js  c++  java
  • 3-non-stop模式调试

    本质:

    GDB 默认采用的是 all-stop 模式,即只要有一个线程暂停执行,所有线程都随即暂停;

    non-stop 模式,该模式下调试多线程程序,当某一线程暂停运行时,其它线程仍可以继续执行

    PS :

    ①只有 7.0 版本以上的 GDB 调试器,才支持 non-stop 模式。

    ②在all-stop模式下,continue, next, step等命令作用于所有线程; non-stop模式下这些操作只作用于当前线程。

    ③设置non-stop 模式

    set non-stop on/off            // on 表示启用 non-stop 模式;off 表示禁用 non-stop 模式
    show non-stop                 // 查看non-stop状态

    ④在all-stop模式下,某一线程暂停执行,gdb会自动把当前线程切换至暂停的线程; non-stop模式下,线程暂停执行后,gdb不会切换线程。

    // gdb在启动时会展示版本信息,也可使用 show version 展示版本信息
    (gdb) show version
    GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1
    Copyright (C) 2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86\_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".

    个人学习笔记,网络内容搬运工,喜欢的点个赞,如有侵权请联系删除。
  • 相关阅读:
    Python3组合数据类型(元组、列表、集合、字典)语法
    tkinter模块常用参数(python3)
    python3的正则表达式(regex)
    QC的使用简介
    Linux常用命令
    Linux中jdk的安装和环境变量的配置
    大道至简阅读笔记07
    大道至简阅读笔记06
    大道至简阅读笔记05
    个人工作总结10
  • 原文地址:https://www.cnblogs.com/qing2105/p/14287395.html
Copyright © 2011-2022 走看看