【发布时间】:2016-09-05 16:01:51
【问题描述】:
出于我自己的目的,我想对正在运行的应用程序进行常规核心转储 - 从应用程序内部 - 但继续运行该程序。
我该怎么做?该应用程序有一个进程,具有多个线程。
Google 核心转储看起来很有希望,但不再受支持。还有其他方法吗?
【问题讨论】:
出于我自己的目的,我想对正在运行的应用程序进行常规核心转储 - 从应用程序内部 - 但继续运行该程序。
我该怎么做?该应用程序有一个进程,具有多个线程。
Google 核心转储看起来很有希望,但不再受支持。还有其他方法吗?
【问题讨论】:
调用fork,然后在forked 进程中转储核心。这有一个明显的缺点 - 除了调用 fork 的线程堆栈之外,您看不到线程堆栈。
【讨论】:
你可以使用 GDB
Let say I am running an app call matrix (a simple ncurses sample app that emulates the words flow).
I can obtain the process id by using pgrep and pass to gcore like this:
gcore `pgrep matrix`
The core file you obtain will be core.pid format like this:
core.6129
http://linux.byexamples.com/archives/371/gcore-obtain-core-dump-of-current-running-application/
【讨论】: