|
我想在一块ARM Linux 开发板上用GDBServer调试程序.
首先尝试PC机Linux系统(Fedora Core 1)上自带的gdbserver,
启动gdbserver:gdbserver :3000 Helloworld
启动gdb:gdb Helloworld
(gdb)target remote 192.168.0.30:3000
其中192.168.0.30是我本机的IP,对一个Helloworld进行调试,效果跟GDB直接调差不多。用一个多线程的程序尝试,出现错误退出。单步跟踪主函数发现停在pthread_join()函数处,如果在线程函数里设断点出现错误退出。
gdb错误信息:
(gdb) target remote 192.168.0.30:3000
Remote debugging using 192.168.0.30:3000
0x001bec50 in ?? ()
Breakpoint 1 at 0x8049158: file Angel.c, line 240.
(gdb) c
Continuing.
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
The program no longer exists.
(gdb)
gdbserver错误信息:
gdbserver :3000 angel_ice/src/angel_ice
Process angel_ice/src/angel_ice created; pid = 836
Remote debugging from host 192.168.0.30
Cannot find new threads: capability not available
Cannot find new threads: capability not available
Cannot find new threads: capability not available
Child terminated with signal = 5
Child terminated with signal = 0x46
GDBserver exiting
这个多线程程序直接用GDB调试没有问题。
于是我下载gdb6.3版自已编译,问题相同。GDBServer在调多线程程序时遇到的这个问题,向大家请教解决方法。 |
|