Catch linux core dump

当你要手工抓取core dump 时,推荐

1. 不管程序死活, kill -5 pid, send sigtrap to target process and will create core dump and the process dies.

2. Occasionally, you may wish to produce a core file of the program you are debugging in

ordertopreserveasnapshotofitsstate.gdbhasaspecialcommandforthat.

generate-core-file[file]

gcore[file]

Produceacoredumpoftheinferiorprocess.Theoptionalargumentfilespecifies

thefilenamewheretoputthecoredump.Ifnotspecified,thefilenamedefaults

to‘core.pid’,wherepidistheinferiorprocessID.