问题描述:
DGB不能远程调试。
* 使用的交叉编译工具:gcc 版本 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03)
* C代码: 简单的HelloWorld!
#include
int main(){
printf("Hello World!");
return 0;
}
* 编译: arm-linux-gnueabihf-gcc -g main.c -o remote_debug
* 将编译好的二进制文件remote_debug拷贝到ARM下,尝试运行程序:./remote_debug,没有问题。启动调试 :gdbserver :6666 remote_debug,到这里一切正常,ARM板提示监听6666端口。
* Ubnutu下启动GDB客户端:arm-linux-gnueabihf-gdb remote_debug
* 下面是GDB操作过程:
GNU gdb (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) 7.5-2012.12
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 "--host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf".
For bug reporting instructions, please see:
https://bugs.launchpad.net/gcc-linaro...
Reading symbols from /home/wgco/qtwork/remote_debug/remote_debug...done.
(gdb) target remote 192.168.0.200:6666
Remote debugging using 192.168.0.200:6666
Reading symbols from /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3
0x40000c80 in ?? ()
from /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3
(gdb) c
Continuing.
warning: Could not load shared library symbols for /lib/libc.so.6.
Do you need "set solib-search-path" or "set sysroot"?
Program received signal SIGILL, Illegal instruction.
0x4000270c in ?? ()
from /usr/local/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/libc/lib/ld-linux-armhf.so.3
(gdb) q
A debugging session is active.
Inferior 1 [process 906] will be killed.
Quit anyway? (y or n) y
- 根据以上信息,有一条警告warning: Could not load shared library symbols for /lib/libc.so.6. 。但是在ARM板的/lib/目录下是有libc.so.6这个文件的,不知道为什么调试的时候不能加载?