【问题标题】:gdb won't read core file from foreign architecturegdb 不会从外部架构中读取核心文件
【发布时间】:2012-09-19 05:55:14
【问题描述】:

我正在尝试在我的 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 状态读取守护进程没问题,但问题出在核心文件上。在核心文件上尝试 readelf 以查看任何可疑内容。对于此类任务,文件实用程序必须非常肤浅。

标签: gdb arm core-file


【解决方案1】:

这可能会有所帮助:

$ 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)

【讨论】:

    【解决方案2】:

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

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

    你的桌面是 arm 还是 x86?

    【讨论】:

    • 我可能会感到困惑,但我认为gdb即使是外国核心架构也能够“读取”核心转储?我不是要执行它。我只想查看回溯、寄存器等。
    • 据我所知 gdb 是一个动态分析工具,因此需要将二进制文件加载到可执行内存中。我知道这不是您要的,但是也许您正在寻找的是诸如 objdump 或 ida 之类的东西?
    • user1629505 是正确的。你能发布一个答案以便我标记它吗?
    猜你喜欢
    • 1970-01-01
    • 2015-12-20
    • 2012-12-13
    • 2012-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多