打印

gdb+gdbserver求指教

[复制链接]
3104|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
aoyun2008|  楼主 | 2011-3-18 17:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
介绍一下我开发中遇到的问题:
arm-uclibc-linux-gcc 编译器
主机    IP : 192.168.1.224
目标机 IP : 192.168.1.223
通过nfs把host下的temp目录mount到target目标板子上mount下,可执行文件hello放在主机目录temp下.
->在目标机上使用gdbserver 192.168.1.224:2345 /mount/hello
提示:
Process test created; pid = 476
Listening on port 2345

->在主机上使用arm-uclibc-linux-gdb /temp/hello
GNU gdb 6.3.50.20050627-cvsCopyright 2004 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-uclibc-linux"...
(gdb) target remote 192.168.1.223:2345
Remote debugging using 192.168.1.223:2345
[New thread 476]
Malformed packet(b) (missing colon): re:0;//数据包畸形
Packet: 'T050b:00000000;0d:509ef9be;0f:c0090040;thread:1dc;core:0;'


在目标机上面提示:
Listening on port 2345
Remote debugging from host 192.168.1.224
readchar: Got EOF
Remote side has terminated connection.  GDBserver will reopen the connection.
Listening on port 2345
Remote debugging from host 192.168.1.224
readchar: Got EOF
Remote side has terminated connection.  GDBserver will reopen the connection.
Listening on port 2345


求教问题出在哪里,是TCP参数需要重新设置一下吗?

相关帖子

沙发
aoyun2008|  楼主 | 2011-3-21 15:20 | 只看该作者
[root@GX3200 /]# gdbserver --debug --remote-debug :3456 /mount/hello
my_waitpid (474, 0x0)
my_waitpid (474, 0x0): status(137f), 474
my_waitpid (474, 0x0)
my_waitpid (474, 0x0): status(1057f), 474
my_waitpid (475, 0x0)
my_waitpid (475, 0x0): status(137f), 475
my_waitpid (475, 0x0)
my_waitpid (475, 0x0): status(9), 475
my_waitpid (474, 0x0)
my_waitpid (474, 0x0): status(117f), 474
my_waitpid (474, 0x0)
my_waitpid (474, 0x0): status(9), 474
new_argv[0] = "/mount/hello"
Process /mount/hello created; pid = 476
sigchld_handler
linux_wait: [Process 476]
linux_wait_for_lwp: <all threads>
my_waitpid (-1, 0x40000000)
my_waitpid (-1, 0x1): status(57f), 476
Got an event from 476 (57f)
stop pc is 400009c0
pc is 0x400009c0
stop pc is 0x400009c0
stop pc is 400009c0
linux_wait_for_lwp: pc is 0x400009c0
Hit a non-gdbserver trap event.
wait_for_sigstop: LWP 476 already stopped
Checking whether LWP 476 needs to move out of the jump pad...no
linux_wait ret = LWP 476.476, 1, 5
Listening on port 3456
handling possible accept event
Remote debugging from host 192.168.1.224
linux_async (0), previous=0
handling possible serial event
[getpkt: discarding char '+']
getpkt ("Hc-1");  [sending ack]
[sent ack]
putpkt ("$E01#a6"); [looking for ack]
[received '+' (0x2b)]
handling possible serial event
getpkt ("qC");  [sending ack]
[sent ack]
putpkt ("$QC1dc#8c"); [looking for ack]
[received '+' (0x2b)]
handling possible serial event
getpkt ("qOffsets");  [sending ack]
[sent ack]
putpkt ("$#00"); [looking for ack]
[received '+' (0x2b)]
handling possible serial event
getpkt ("?");  [sending ack]
[sent ack]
wait_for_sigstop: LWP 476 already stopped
Checking whether LWP 476 needs to move out of the jump pad...no
Writing resume reply for LWP 476.476:1

putpkt ("$T050b:0*"00;0d:403ea0be;0f:c0090040;thread:1dc;core:0;#f7"); [looking for ack]
[received '+' (0x2b)]
handling possible serial event
readchar: Got EOF
[getpkt: discarding char 'ÿ']
Remote side has terminated connection.  GDBserver will reopen the connection.
Listening on port 3456

使用特权

评论回复
板凳
aoyun2008|  楼主 | 2011-3-21 15:20 | 只看该作者
[gx@GxLinux mount]$ arm-uclibc-linux-gdb /home/share/mount/hello
GNU gdb 6.3.50.20050627-cvs
Copyright 2004 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-uclibc-linux"...
(gdb) set debug remote 1
(gdb) set remote X-packet auto
(gdb) set remote P-packet auto
(gdb) set remote Z-packet auto
(gdb) target remote 192.168.1.223:3456
Remote debugging using 192.168.1.223:3456
Sending packet: $Hc-1#09...Ack
Packet received: E01
Sending packet: $qC#b4...Ack
Packet received: QC1dc
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $?#3f...Ack
Packet received: T050b:00000000;0d:403ea0be;0f:c0090040;thread:1dc;core:0;
[New thread 476]
Malformed packet(b) (missing colon): re:0;
Packet: 'T050b:00000000;0d:403ea0be;0f:c0090040;thread:1dc;core:0;'

(gdb)

使用特权

评论回复
地板
aoyun2008|  楼主 | 2011-3-21 15:23 | 只看该作者
gdbserver发送数据包
$T050b:0*"00;0d:403ea0be;0f:c0090040;thread:1dc;core:0;#f7
gdb接收数据包
$T050b:00000000;0d:403ea0be;0f:c0090040;thread:1dc;core:0;#f7
由于数据包0b后面的几位出错,导致checksum的时候提示错误的数据包,估计是这个原因导致

使用特权

评论回复
5
zhangkef0904| | 2011-5-26 11:04 | 只看该作者
主机这边没有指定调试的程序吧?你试着在target remote之前先执行
file /temp/hello

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

15

主题

27

帖子

0

粉丝