GDB 作为子进程运行在收到“kill -9”后停止父进程。

发布于 2024-12-18 06:08:37 字数 191 浏览 4 评论 0原文

我通过运行一个运行 GDB 批处理实例的脚本来在 python 中运行自动化测试。如果输出满足某些条件,我会终止 gdb 的 pid,以便可以启动 GDB 的新实例。我运行 GDB 只是为了在发生段错误时记录回溯。我的问题是,在脚本中终止 GDB 实例或在终端上终止会导致我的脚本“停止”。

有没有办法向 GDB 子进程发送终止信号而不停止我的父进程?

I am running automated tests in python by running a script that runs a batched instance of GDB. If the output meets certain conditions I kill the pid of gdb so I can launch a new instance of GDB. I am running GDB only to log backtraces in case of segfaults. My issue is that killing the GDB instance in the script or by kill on a terminal results in my script being "Stopped".

Is there a way to send a kill signal to a GDB subprocess without it Stopping my parent process?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温柔戏命师 2024-12-25 06:08:37

我运行 GDB 只是为了在发生段错误时记录回溯

。替代方案:

  1. glibccatchsegv / libSegFault.so
  2. segv_handler
  3. 为您感兴趣的信号安装处理程序在 (SIGSEGV,
    SIGABRT 等),它启动 gstackgdb,附加到自身并转储相关跟踪。

I am running GDB only to log backtraces in case of segfaults

Alternatives:

  1. glibc's catchsegv / libSegFault.so.
  2. segv_handler
  3. Install a handler for those signals you're interested in (SIGSEGV,
    SIGABRT, etc.) which launches gstack or gdb, attaches to itself and dumps the relevant trace.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文