Is it possible to get a core dump of a running process and its symbol table?

DebuggingCoredump

Debugging Problem Overview


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)

Debugging Solutions


Solution 1 - Debugging

$ gdb --pid=26426
(gdb) gcore
Saved corefile core.26426
(gdb) detach

Solution 2 - Debugging

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.

Solution 3 - Debugging

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionreadonlyView Question on Stackoverflow
Solution 1 - DebuggingDustinBView Answer on Stackoverflow
Solution 2 - DebuggingAlex ZefferttView Answer on Stackoverflow
Solution 3 - DebuggingSatishView Answer on Stackoverflow