是否可以获得正在运行的进程及其符号表的核心转储?

发布于 2024-07-05 09:10:56 字数 135 浏览 6 评论 0原文

是否可以获取 gdb 或使用其他一些工具来创建正在运行的进程及其符号表的核心转储? 如果有一种方法可以在不终止进程的情况下执行此操作,那就太好了。

如果可能的话,您会使用什么命令? (我正在尝试在 Linux 机器上执行此操作)

Is it possible to get gdb or use some other tools to create a core dump of a running process and it's symbol table? It would be great if there's a way to do this without terminating the process.

If this is possible, what commands would you use? (I'm trying to do this on a Linux box)

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

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

发布评论

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

评论(3

悲凉≈ 2024-07-12 09:10:56
$ gdb --pid=26426
(gdb) gcore
Saved corefile core.26426
(gdb) detach
$ gdb --pid=26426
(gdb) gcore
Saved corefile core.26426
(gdb) detach
我不在是我 2024-07-12 09:10:56

或者运行gcore $(pidof processname)

这样做的好处是(相对于运行 gdb 并向 CLI 发出命令)您可以在尽可能短的时间内附加和分离。

Or run gcore $(pidof processname).

This has the benefit (over running gdb and issuing commands to the CLI) that you attach and detach in the shortest possible time.

岁吢 2024-07-12 09:10:56

您可以在gdb中使用generate-core-file命令来生成正在运行的进程的核心转储。

You can used generate-core-file command in gdb to generate core dump of running process.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文