Kri*_*ass 9 macos gdb coredump
我在OSX上使用gdb,它似乎没有gcorenor 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)
Run Code Online (Sandbox Code Playgroud)
鉴于此,我如何通过GDB生成核心转储或近似的核心转储?
(我怀疑我可以使用dump memory,但这需要一个地址范围,我正在努力找到正确的info调用来获得正确的内存范围......)
and*_*otn 11
运行lldb --attach-pid,然后使用该process save-core命令保存核心.请注意,该过程将在您附加到该过程时暂停,因此如果这是一个重要过程,请务必小心.
$ lldb --attach-pid <pid>
(lldb) process attach --pid 76669
Process 76669 stopped
Executable module set to "/bin/bash".
Architecture set to: x86_64h-apple-macosx.
(lldb) process save-core "core"
mach_header: 0xfeedfacf 0x01000007 0x00000008 0x00000004 0x00000030 0x00000e08 0x00000000 0x00000000
...
Saving data for segment at 0x7fd455200000
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3759 次 |
| 最近记录: |