gdb core文件函数出现问号
2015-04-16 11:07
267 查看
原创地址 http://blog.csdn.net/yudingding6197/article/details/5528989
我的程序crash,有了coredump文件,在Linux PC上用arm-linux-gdb debug it. The result is:
#0 0x4022b178 in ?? ()
(gdb) bt
#0 0x4022b178 in ?? ()
#1 0x4022b134 in ?? ()
#2 0x4022b134 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
why? I can't locate the correct location, find the really reason.
看看加载的内容
GNU gdb 6.6
Copyright (C) 2006 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 "--host=i686-pc-linux-gnu --target=arm-linux"...
warning: core file may not match specified executable file.
warning: .dynamic section for "/lib/libdl.so.2" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libpthread.so.0" is not at the expected address (wrong library or version mismatch?)
Error while mapping shared library sections:
/lib/libstdc++.so.6: No such file or directory.
warning: .dynamic section for "/lib/libm.so.6" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libc.so.6" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/ld-linux.so.2" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libnss_files.so.2" is not at the expected address (wrong library or version mismatch?)
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Symbol file not found for /lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Core was generated by `./6800plusEth.bin'.
Program terminated with signal 11, Segmentation fault.
一些库找不到(/lib/libstdc++.so.6),或者版本不匹配。我不应该加载/lib/libdl..so.... 这些文件,这是针对X86的。
所以两个命令至关重要:
set solib-absolute-prefix -- Set prefix for loading absolute shared library symbol files
set solib-search-path -- Set the search path for loading non-absolute shared library symbol files
比如:set solib-... /usr/local/arm-linux/arm-linux/lib/, 两个参数的值一样就可以了。
先启动arm-linux-gdb,设置变量以后,via core-file load core dump file to analyze it.
#gdb
#set solib-absolute-prefix "library path"
#set solib-search-path "library path"
#file file.debug
#core-file core.1234
但是还是不能准确定位,查询embedded linux版本:
uname -a
ls -l /usr/arm-linux/gcc-3.4.1-glibc-2.3.3/arm-linux/lib/libc-2.3.3.so
Linux PC上的呢:
ll /usr/local/arm/3.4.1/arm-linux/lib/libc-2.3.2.so
原来库文件不对,一个是2.3.3,另一个是2.3.2,此时发现版本匹配是至关的重要啊!!
换了一个Linux PC,它的交叉编译环境是2.3.3
哈哈!立即定位到了错误的原因!!
我的程序crash,有了coredump文件,在Linux PC上用arm-linux-gdb debug it. The result is:
#0 0x4022b178 in ?? ()
(gdb) bt
#0 0x4022b178 in ?? ()
#1 0x4022b134 in ?? ()
#2 0x4022b134 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
why? I can't locate the correct location, find the really reason.
看看加载的内容
GNU gdb 6.6
Copyright (C) 2006 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 "--host=i686-pc-linux-gnu --target=arm-linux"...
warning: core file may not match specified executable file.
warning: .dynamic section for "/lib/libdl.so.2" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libpthread.so.0" is not at the expected address (wrong library or version mismatch?)
Error while mapping shared library sections:
/lib/libstdc++.so.6: No such file or directory.
warning: .dynamic section for "/lib/libm.so.6" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libc.so.6" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/ld-linux.so.2" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/lib/libnss_files.so.2" is not at the expected address (wrong library or version mismatch?)
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Symbol file not found for /lib/libstdc++.so.6
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Core was generated by `./6800plusEth.bin'.
Program terminated with signal 11, Segmentation fault.
一些库找不到(/lib/libstdc++.so.6),或者版本不匹配。我不应该加载/lib/libdl..so.... 这些文件,这是针对X86的。
所以两个命令至关重要:
set solib-absolute-prefix -- Set prefix for loading absolute shared library symbol files
set solib-search-path -- Set the search path for loading non-absolute shared library symbol files
比如:set solib-... /usr/local/arm-linux/arm-linux/lib/, 两个参数的值一样就可以了。
先启动arm-linux-gdb,设置变量以后,via core-file load core dump file to analyze it.
#gdb
#set solib-absolute-prefix "library path"
#set solib-search-path "library path"
#file file.debug
#core-file core.1234
但是还是不能准确定位,查询embedded linux版本:
uname -a
ls -l /usr/arm-linux/gcc-3.4.1-glibc-2.3.3/arm-linux/lib/libc-2.3.3.so
Linux PC上的呢:
ll /usr/local/arm/3.4.1/arm-linux/lib/libc-2.3.2.so
原来库文件不对,一个是2.3.3,另一个是2.3.2,此时发现版本匹配是至关的重要啊!!
换了一个Linux PC,它的交叉编译环境是2.3.3
哈哈!立即定位到了错误的原因!!
相关文章推荐
- 解决gdb 调试 core 文件函数名显示为问号的问题
- 解决gdb 调试 core 文件函数名显示为问号的问题
- linux gdb 调试 coredump core 文件,函数名称是 问号
- gdb调试coredump文件,函数名称是问号
- linux 为崩溃的程序生成core文件的相关函数,调用代码生成core dump file 但程序不用退出,gdb 分析core
- gdb调试core时能用i locals看栈变量、函数行(即不出现No symbol table info available)的必要条件: 1. 编译时有-g参数; 2.so库未被strip脱衣服
- gdb调试coredump文件,函数名称是问号
- gdb调试core文件快速定位core dump位置
- 如何用gdb在一个文件的全部函数上打断点?
- gdb的使用(二) 堆栈跟踪、core文件、连接到其它进程
- 在Linux系统下,如果程序中出现segment fault,如何可以让系统产生core dump文件?如何用gdb来跟踪出错的地方?
- gdb debug core文件
- 用gdb调试core文件
- gdb 查看堆栈信息、加载core文件、连接到其它进程
- gdb 查看堆栈信息、加载core文件、连接到其它进程
- GDB调试core文件样例(如何定位Segment fault)
- gdb调试core文件快速定位core dump位置
- GDB调试core文件详解
- rapi操作函数复制文件到PDA出现Could not create remote file
- GDB Core,gdb 调试大全,core文件调试