开发者

Linux Core Dump Without Killing Process

开发者 https://www.devze.com 2023-01-03 00:07 出处:网络
Is it possible to generate a core dump without killin开发者_C百科g the process?If so, what is the command/signal to do so?

Is it possible to generate a core dump without killin开发者_C百科g the process? If so, what is the command/signal to do so?

Thanks, Jim


See the 'gcore' command, part of GDB.


I had the best success with attaching gdb in batch mode to the running program, get a backtrace and then detach.

gdb --batch --quiet -ex "set pagination off" -ex "thread apply all bt"
-ex "detach" -ex "quit" pid pid_of_process


A method to generate a coredump directly from program without gdb is described here: https://unix.stackexchange.com/questions/11185/dump-process-core-without-killing-the-process

It make sense only if you are developing. Principle is to fork program and to raise SIGABRT from child.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号