Solaris 10上的GNU gdb 6.4无法识别文件格式

时间:2009-12-23 13:42:28

标签: gdb solaris elf sunstudio sunone

以下详细信息来自运行Solaris 10的Sun计算机中的会话。

$ file devli
devli: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
$ file a
a: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
$ gdb
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.10".
(gdb) file a
Reading symbols from /tmp/tnmy/a...(no debugging symbols found)...done.
(gdb) file devli
"/tmp/tnmy/devli": not in executable format: File format not recognized
(gdb) q
$ ls -l a devlisrvr
-rwxr-xr-x   1 test2    dba         1480 Dec 23 18:23 a
-rwxr-xr-x   1 test2    dba       633088 Dec 23 18:26 devli
$ uname -a ;
SunOS myhost 5.10 Generic_127111-11 sun4v sparc SUNW,SPARC-Enterprise-T5220
$ cat a.c
int main() {return 0;}
$ /opt/SUNONE8/SUNWspro/bin/CC -V
CC: Sun C++ 5.5 2003/03/12
$ file `which gdb`
/usr/local/bin/gdb: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
$

为什么gdb不能识别devli的文件格式的任何细节?我在互联网上搜索但找不到与此特定问题相关的任何内容。任何指针都会有所帮助。

a.c进入使用gcc构建的a; devli使用Sun ONE Studio 8。

1 个答案:

答案 0 :(得分:0)

请注意,GDB 6.4是4岁。使用(当前)GDB 7.0可能会更好运。

devli可执行文件也可能已损坏(file只查看可执行文件的前几个字节,但GDB需要更多的文件内容为自我-consistent)。 readelf --all > /dev/null是否会报告任何警告?