当前位置: 首页 > news >正文

gdb:在命令行中会莫名暂停;detach-on-fork

这个没有捕获到断点的原因是,可能是多线程的问题,需要设置:
set detach-on-fork off

On Linux, if you want to debug both the parent and child processes, use the command:
set detach-on-fork on/off
on 默认设置,gdb会放弃子线程(或者父线程,受follow-fork-mode的控制)的监控。
off gdb会同时监控父线程及子线程。在调试一个线程的时候,另一个也会暂停。

如果您选择“detach-on-fork=off”,则 gdb 将保留对所有子线程(包括嵌套子线程)的控制。您可以使用 info inferiors 命令列出 gdb 控制下的子进程,并使用 inferior 命令从一个子线程切换到另一个子线程。
To quit debugging one of the forked processes, you can either detach from it by using the detach inferiors command (allowing it to run independently), or kill it using the kill inferiors command.
If you ask to debug a child process and a vfork is followed by an exec, gdb executes the new target up to the first breakpoint in the new target. If you have a breakpoint set on main in your original program, the breakpoint will also be set on the child process’s main.
On some

http://www.lryc.cn/news/36061.html

相关文章:

  • 【3.9】RedisAOF日志、字符串、操作系统进程管理
  • 安装mayavi的成功步骤
  • vue+echarts.js 实现中国地图——根据数值表示省份的深浅——技能提升
  • [oeasy]python0104_指示灯_显示_LED_辉光管_霓虹灯
  • Easy Deep Learning——卷积层
  • 深入分析@Bean源码
  • Web Components学习(1)
  • Element-UI实现复杂table表格结构
  • Azure AD 与 AWS 单一帐户SSO访问集成,超详细讲解,包括解决可能出现的错误问题
  • lvgl 笔记 按钮部件 (lv_btn) 和 开关部件 (lv_switch)
  • Python高频面试题——生成器(最通俗的讲解)
  • 品牌软文怎么写?教你几招
  • Kubernetes (k8s) 污点(Taint)介绍、示例
  • Docker学习(二十一)构建 java 项目基础镜像
  • python中的上下文原理
  • 可复用测试用例描述要素
  • lnmp中遇到open_basedir配置无效问题
  • SpringBoot【知识加油站】---- REST开发
  • 三 Go的语言容器
  • 2023年全国最新会计专业技术资格精选真题及答案16
  • 模板进阶(仿函数,特化等介绍)
  • Beats:在 Docker 中同时部署 Metricbeat 和 Elasticsearch
  • 编码技巧——Redis Pipeline
  • ArcGIS制图技巧:制图入门与点、线、面状符号制作
  • Java基础 关于字典数据维护接口设计
  • 从零开始学架构——复杂度来源
  • 什么时候需要分表分库?
  • 冰刃杀毒工具使用实验(29)
  • 聊聊图像分割的DICE和IOU指标
  • 软件设计师教程(十)计算机系统知识-结构化开发