Gdb 不能';在核心文件中找不到通用寄存器

Gdb 不能';在核心文件中找不到通用寄存器,gdb,arm,shared-libraries,Gdb,Arm,Shared Libraries,当我尝试调试核心文件时,出现以下错误。如何解决这个问题。 就在几天前,它还可以正常工作。 我尝试使用根provileges运行“/sbin/ldconfig”。代码是用以下代码编译的: g++ -fPIC -ggdb 我的可执行文件是32位二进制文件: $ file appl ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped. use

当我尝试调试核心文件时,出现以下错误。如何解决这个问题。 就在几天前,它还可以正常工作。 我尝试使用根provileges运行“/sbin/ldconfig”。代码是用以下代码编译的:

g++ -fPIC -ggdb
我的可执行文件是32位二进制文件:

$ file appl

ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked 
(uses shared libs), not stripped.


user@ubu:/mnt/hgfs/share$ gdb appl  core.11_416


GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
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 "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /mnt/hgfs/share/appl...done.

warning: Couldn't find general-purpose registers in core file.

warning: Could not load shared library symbols for 9 libraries, e.g. /lib/libdl.so.2.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `appl'.


warning: Couldn't find general-purpose registers in core file.
#0  <unavailable> in ?? ()
(gdb) i shared
From        To          Syms Read   Shared Object Library
                    No          /lib/libdl.so.2
                    No          /opt/lib/libappl.so
                    No          /lib/librt.so.1
                    No          /usr/lib/libstdc++.so.6
                    No          /lib/libm.so.6
                    No          /lib/libgcc_s.so.1
                    No          /lib/libc.so.6
                    No          /lib/libpthread.so.0
                    No          /lib/ld-linux.so.3
(gdb) 
(gdb) show solib-search-path
The search path for loading non-absolute shared library symbol files is .
(gdb) show sysroot
The current system root is "".
(gdb) 
(gdb) show archi
The target architecture is set automatically (currently i386)
编辑日期:2013年3月20日
@斯科特:谢谢你的回复。我会试试这个。同样的设置在早些时候运行良好,我能够用GDB进行调试。有一次我做了一个“apt-get-update”,从那以后GDB就开始抱怨上面的错误。我能看出的一个区别是,早些时候GDB工作时,verion显示:

This GDB was configured as "i486-linux-gnu".
现在,更新后的版本显示:

This GDB was configured as "i686-linux-gnu"
这就是我所能看到或理解的所有差异

我使用的手臂工具链没有提供GDB。g++是为英特尔编译的。我现在也使用同样的g++来构建可执行文件

$ file g++
g++: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
我使用的提供的交叉编译器可执行文件如下所示。但是当我遇到这个错误时,我只使用了普通的gdb(安装在Ubuntu上)命令,它位于“/usr/bin/gdb”:

我在这里用错GDB了吗。如果它是错误的GDB,为什么它现在工作得更早?为什么不呢?我是否应该使用此arm none linux gnueabi GDB调试arm交叉编译的应用程序,该应用程序是通过以下方式编译的:

arm-none-linux-gnueabi-g++  appl.cpp  -o appl


user@ubu:~$ which gdb
/usr/bin/gdb

你用错了gdb。抓起柏油球,取出,然后跑:

$ gcc-linaro-arm-linux-gnueabihf-4.7-2013.02-01-20130221_linux/bin/arm-linux-gnueabihf-gdb appl  core.11_416
<...>
This GDB was configured as "--host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf".
<...>
$gcc-linaro-arm-linux-gnueabihf-4.7-2013.02-01-20130221\u linux/bin/arm-linux-gnueabihf-gdb appl core.11\u 416
此GDB配置为“-host=i686-build_pc-linux-gnu--target=arm-linux-gnueabihf”。
注意,您正在使用的gdb显示“此gdb配置为”i686 linux gnu”。您需要一个显示“--host=i686-build_pc-linux-gnu--target=arm-linux-gnueabihf”(或目标中类似的arm-linux三元组)


通常人们不会将gcc targetingarm-linux-gnueabihf与gdb targetingi686-linux-gnu混淆,因为编译器、链接器和调试器命令都以相同的前缀开头,即arm-linux-gnueabihf-{gcc,gdb,ld,gas}等等。您的特定gcc和gdb组合是如何结束的?

我在我的交叉编译器工具链中编译了gdb。它出现在构建目录的一个bin目录中。您可以检查类似的gdb

`此gdb配置为“i686 linux gnu”。`这是一台试图调试arm内核转储的x86主机吗?我正在使用Windows XP和运行Ubuntu12.04的VM软件,我在上面交叉编译了arm的源代码。在运行Ubuntu12.04的同一个VM软件上运行GDB,您需要一个支持arm/交叉编译的GDB。当前的一个目标似乎是x86,这将解释丢失的寄存器,因为它可能也是为另一个系统编译的,这将解释丢失的库搜索、路径等。但在相同的设置上,我能够在前面调试。我做了一个“apt get update”,从那以后出现了一些问题,我无法找到:(
apt get update
~您要么覆盖以前的安装/设置,要么路径中的某个地方有另一个gdb。感谢您的回复。我将尝试一下。以前的相同设置工作正常,我能够用gdb进行调试。有一次我执行了“apt get update”,自那以后,GDB一直在抱怨上述错误。我更新了问题,提供了更多关于我是如何陷入这种情况的细节。我仍然有这个问题。
arm-none-linux-gnueabi-g++  appl.cpp  -o appl


user@ubu:~$ which gdb
/usr/bin/gdb
$ gcc-linaro-arm-linux-gnueabihf-4.7-2013.02-01-20130221_linux/bin/arm-linux-gnueabihf-gdb appl  core.11_416
<...>
This GDB was configured as "--host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf".
<...>