当我们只有核心文件时如何收集 information/debug

How to gather information/debug when we have only the core file

我遇到过只有核心文件(没有可执行文件)的情况。 我如何使用 gdb 或任何其他工具的核心文件来收集尽可能多的信息。

gdb core
GNU gdb (GDB) SUSE (7.1-8.9.1)
Copyright (C) 2010 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-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
"/home/core": not in executable format: File format not recognized

I have came across a situation where we have only the core file (no executable).

你肯定有可执行文件某处?如果可以,请获取它的副本。

How can i use the core file with gdb or any other tool to gather as much information as possible.

除非您将主机配置为转储文件支持的共享映射(参见 coredump_filterdocumentation),否则您根本无法从核心中提取很多有意义的信息。

gdb core

不要那样做。改为这样做:gdb -c core。那么whereinfo registers,可能还有print $_siginfo可能会提供一些东西,但不会太多。