我在 OSX 上使用 gdb,它似乎既没有gcore
也没有generate-core-file
命令:
$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
(gdb) gcore
Undefined command: "gcore". Try "help".
(gdb) generate-core-file
Undefined command: "generate-core-file". Try "help".
(gdb)
鉴于此,我该如何通过 GDB 生成核心转储或类似的转储?
(我怀疑我可以使用dump memory
,但这需要一个地址范围,我正在努力寻找正确的info
调用来获得正确的内存范围......)