曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 13358|回复: 4
打印 上一主题 下一主题

配置 gdbserver 调试程序

[复制链接]

0

主题

2

帖子

6

积分

初学弟子

积分
6
楼主
发表于 2010-6-12 13:39:04 | 显示全部楼层
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!


==========================================
请问问题出在哪里?

0

主题

2

帖子

6

积分

初学弟子

积分
6
沙发
发表于 2010-6-13 09:02:11 | 显示全部楼层
版本没有问题,调试其他程序(包括多线程程序)没问题,这个程序涉及多进程,再板子上直接gdb调试没问题,就是gdbserver远程调试出问题,我想用图形界面调试,所以不想直接在板子上跑gdb
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2024-5-19 16:41 , Processed in 0.065713 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表