在线时间4 小时
UID3352406
注册时间2017-2-17
NXP金币0
该用户从未签到
新手上路

- 积分
- 34
- 最后登录
- 2017-3-10
|
诸位:
谁会串口模式下的gdb+gdbserver,介绍下,几天了。
或者介绍下自己平时怎么操作的。或者你的可以用串口gdb+gdbserver,告诉我下你gdb的版本号。
imx6q+linux3.0.35。
因为台式机没有串口,所以用的USB转串口线,平时使用minicom正常。
在看官方文档 AN4553.pdf,尝试gdb+gdbserver的调试方法(之前一直printk.....)。照着文档操作,下载了gdb7.12.1的代码,编译,安装。
因为gdb+gdbserver有至少2种连接方式: 1.通过TCP/UDP 2.通过串口,用 TCP的方法可以实现gdb+gdbserver的调试,但是用串口来弄gdb+gdbserver总是失败(已经关闭了minicom,用telnet登陆linux系统启动的gdbserver),打印如下:
板子端:
root@freescale /$ /usr/local/gdb7.12.1/bin/gdbserver /dev/ttymxc0 mytest
Process mytest created; pid = 2427
Remote debugging using /dev/ttymxc0
主机端(ubuntu12.04):
ml@ml:~/work/test$ sudo /usr/local/gdb-7.12.1-arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gdb mytest
(gdb) set serial baud 115200
(gdb) set debug remote 1
(gdb) target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
Sending packet: $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;........./*打印信息太多,省略了*/
Timed out.
Timed out.
Timed out.
Ignoring packet error, continuing...
Packet qSupported (supported-packets) is supported
warning: unrecognized item "timeout" in "qSupported" response
Timed out.
Timed out.
Ignoring packet error, continuing...
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
翻墙都找不到解决办法,国外有人说某些版本的gdb确实serial方面broken,不过我试了 7.12和7.12.1,都是一样的。
|
|