即使进程正常运行,如何创建核心转储? [英] How to create a core dump even if the process is normally running?

查看:116
本文介绍了即使进程正常运行,如何创建核心转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux下,当进程崩溃时,将创建一个核心转储。

Under Linux, when a process crashes, a core dump will be created.

但是,我想在进程没有崩溃时创建一个核心转储,但看起来越野车。远程专家需要核心转储进行分析。

However, I want to create a core dump when the process doesn't crash, but looks buggy. A remote expert need the core dump to analyze.

在Windows下,我们可以通过任务管理器创建流程的转储文件,然后,该流程仍在运行。

Under Windows, we can create a dump file of a process through task manager, and after that, the process is still running.

在Linux下可以吗?

Is it possible under Linux?

推荐答案

调用 gdb ,然后

attach pid
gcore

其中 pid 是相关进程的进程ID。

where pid is the process id of the process in question.

这篇关于即使进程正常运行,如何创建核心转储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆