GDB 不会从外部架构读取核心文件



我正在尝试在我的Linux桌面上读取ARM核心文件,但它似乎无法找出我的核心文件。有什么方法可以指示 gdb 我的核心文件是什么类型?

$ file ~/daemon
./daemon: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped
$ file ~/core
./core: ELF 32-bit LSB core file ARM, version 1 (SYSV), SVR4-style, from './daemon -v -v -v -v -e 10 -t foo'
$ gdb-multiarch ~/daemon ~/core
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 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-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from ./daemon...done.
"./core" is not a core dump: File format is ambiguous
(gdb) core-file ~/core 
"./core" is not a core dump: File format is ambiguous

生成平台是armv4,根据"集合架构"列表,gdb-multiarch声称支持它。

编辑:澄清一下,我运行gdb的台式机是"x86_64-linux-gnu",即64位Intel Ubuntu盒子。

这可能会有所帮助:

$ gdb-multiarch
...
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) set gnutarget elf32-littlearm
(gdb) file daemon
...
(gdb) target core core
...
(gdb)

仅当您的桌面(您尝试运行 gdb-multiarch 的位置)是 x86 时,以下内容才相关。

Gdb 是一个调试器。因此,它将无法在 x86 台式计算机上调试外部体系结构可执行文件,因为您无法在 x86 处理器上运行 arm 代码。但是,您可以使用将在 arm 机器上运行的 gdb 服务器远程调试它。

您的台式机是 ARM 还是 x86?

最新更新