我有一个erlang应用程序生成的核心转储文件,想分析一下。这是我第一次使用gdb。我安装了gdb,但没有运气运行它的可执行文件和核心转储文件。
我给予可执行文件和核心转储文件作为
gdb erts-5.9.3/bin/beam.smp core
字符串
当我运行它时,我得到,
GNU gdb (GDB) 7.9
Copyright (C) 2015 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 "x86_64-apple-darwin15.4.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from erts-5.9.3/bin/beam.smp...(no debugging symbols found)...done.
"/Users/sad/projects/core" is not a core dump: File format not recognized
型
我该怎么解决这个问题?
1条答案
按热度按时间lymgl2op1#
This GDB was configured as "x86_64-apple-darwin15.4.0".
"/Users/sad/projects/core" is not a core dump: File format not recognized
$ file core
个/Users/sad/projects/core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), ...
个Mac OS不使用
ELF
文件格式。我们可以安全地假设此core
来自其他系统,而不是您试图分析它的系统。仍然可以在Mac OS系统上分析
core
,但您需要:1.一个cross-gdb(即可以在Mac OS * 主机 * 上运行,但可以处理你的 * 目标 * 的ELF文件;很可能你必须自己构建这样的GDB),
1.(除非你有一个完全静态的可执行文件),你需要从发生崩溃的主机上获得 * 完整 * 的共享库。
一般来说,在发生崩溃的主机上进行事后分析要容易得多。