问个关于gdbserver的问题

内核编译和嵌入式产品的设计与开发
回复
hongbo1210
帖子: 2
注册时间: 2008-07-04 9:55

问个关于gdbserver的问题

#1

帖子 hongbo1210 » 2008-08-07 9:28

pc机的nfs服务已经开通,用其它机子可以mount上我的机,在板上运行gdbserver
[root@AT91RM9200:~]# gdbserver 202.38.214.177:2049 a.out
Process a.out created; pid = 680
Listening on port 2049
然后pc机上
hool@hool-desktop:~$ arm-linux-gdb a.out
GNU gdb 6.8
Copyright (C) 2008 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=arm-linux"...
(gdb) target remote 202.38.214.177:2049
Remote debugging using 202.38.214.177:2049
Remote communication error: Connection reset by peer.

Remote communication error: Connection reset by peer.这句话是什么意思呢,该如何解决?网上搜了很久没找到答案。请大家帮忙看看,谢谢~~~~
軒霆流水
帖子: 1
注册时间: 2008-08-13 15:19

#2

帖子 軒霆流水 » 2008-08-13 15:21

你的主机IP和板子的IP怎么是一致的呢?
主机的IP和板子的IP必须是同一个网段的,但不可以相同。
hongbo1210
帖子: 2
注册时间: 2008-07-04 9:55

#3

帖子 hongbo1210 » 2008-08-15 9:41

ip设置是没问题的,能用tftp传送文件,但板子还是mount不上主机
[root@AT91RM9200:/]# tftp -g -r hello 202.38.214.178
[root@AT91RM9200:/]# mount 202.38.214.178:/tftpboot /mnt
mount: mounting 202.38.214.178:/tftpboot on /mnt failed: No such device
[root@AT91RM9200:/]# mount 202.38.214.178:/tftpboot /tmp
mount: RPC: Timed out

为什么挂载到/mnt和/tmp出现的错误会不一样呢?
poet
帖子: 2841
注册时间: 2006-09-11 22:47

#4

帖子 poet » 2008-08-15 10:04

在我的机器上,RPC timed out 一般是nfs服务器挂了,我把 nfs 服务restart一下就可以。

至于 gdb-server。建议忘了它吧。那个东西相当的不稳定,如果是你自己编出来的可能还好一点,如果是搞的别人编好的就算了吧。

我建议使用 arm 版的gdb在板子上直接运行并调试。这要稳定得多。早期我们使用gdb-server有太多的不愉快经历(最明显的就是不能调试动态链接库),后来改用gdb之后,工作效率大大提高。我甚至还编了一个 cgdb 到板子上,看代码就方便得多。

源代码路径问题好解决,把PC的/home mount到板子上的/home就行了
thomascatlee
帖子: 3
注册时间: 2007-04-07 11:20

#5

帖子 thomascatlee » 2008-08-29 12:48

gdbserver后面参数是板子的IP和端口
arm-linux-gdb后面参数也是板子的IP和端口
回复