|
gdbserver + gdb 调试 arm-linux system, Malformed packet(b)
我用 c+ gdb 调试 arm-linux system, gdb-7.0.1
Compile gdb ./configure --host=i686-pc-linux-gnu --target=armv5tl-montavista-linux-gnueabi --prefix=/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le
Compile gdbserver
CC=/opt/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-gcc ./configure --host=armv5tl-montavista-linux-gnueabi --prefix=/home/liyg/DBVT/ipnc/target/filesys/
###### source start ######
sample.c
1 #include <stdio.h>
2 int main (int argc, char **argv) {
3 printf("hello gdbserver!\\n");
4 system("pwd");
5 printf("goodbye gdbserver!\\n");
6 return 0;
7 }
###### source end ######
Host arm_v5t_le-gcc -g -o sam sample.c Host cp sam /home/liyg/DBVT/ipnc/target/filesys/opt/
---------------------------------------------------------------
Target:# gdbserver :1000 ./sam
Process ./sam created; pid = 942
Listening on port 1000
-------------------------------------------------------------------
Host armv5tl-montavista-linux-gnueabi-gdb ./sam GNU gdb (GDB) 7.0.1 Copyright (C) 2009 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-pc-linux-gnu --target=armv5tl-montavista-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/liyg/tmp/sam...done.
(gdb) set solib-search-path /home/liyg/DBVT/ipnc/target/filesys/lib
(gdb) set sysroot /home/liyg/DBVT/ipnc/target/filesys/
(gdb) target remote 192.168.150.7:1000
Remote debugging using 192.168.150.7:1000 0x400007e0 in _start () from /home/liyg/DBVT/ipnc/target/filesys/lib/ld-linux.so.3
(gdb) l
1 #include <stdio.h>
2 int main (int argc, char **argv) {
3 printf("hello gdbserver!\\n");
4 system("pwd");
5 printf("goodbye gdbserver!\\n");
6 return 0;
7 }
(gdb) b main
Breakpoint 1 at 0x8454: file sample.c, line 3.
(gdb) c
Continuing.
Breakpoint 1, main (argc=1, argv=0xbea28e84) at sample.c:3
3 printf("hello gdbserver!\\n");
(gdb) n
4 system("pwd");
(gdb) n
Malformed packet(b) (missing colon): ;0b:c48ba2be;0d:788ba2be;0f:2c720b40;
Packet: 'TR943;0b:c48ba2be;0d:788ba2be;0f:2c720b40;'
(gdb) c
Continuing.
Cannot execute this command while the selected thread is running.
(gdb)
----------------------------------------------------------
Target:# Remote debugging from host 192.168.150.253 hello gdbserver!
==========================================
请问问题出在哪里? |
|