gdb で core を吐かせる

SIGQUITをマスクしているようなプログラムのコアを吐かせてあとから解析したい場合、
gdb でアタッチしてから、プロンプトに generate-core-file と入力すれば、カレントディレクトリにcoreがはかれます。

root@ns:~# gdb -p 4241
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Attaching to process 4241
0xb7751424 in __kernel_vsyscall ()
(gdb) generate-core-file
Saved corefile core.4241
(gdb) quit
A debugging session is active.

Inferior 1 [process 4241] will be detached.

Quit anyway? (y or n) y

こんな感じです。