首页 > 其他 > 详细

3-non-stop模式调试

时间:2021-01-16 22:16:28      阅读:32      评论:0      收藏:0      [点我收藏+]

本质:

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".

技术分享图片

 

3-non-stop模式调试

原文:https://www.cnblogs.com/qing2105/p/14287395.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!