[hellogcc] Re: [hellogcc] Re: [hellogcc] 关于GDB remote serial protocol

  • From: Hui Zhu <teawater@xxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Wed, 3 Aug 2011 10:44:36 +0800

2011/8/3 Yao Qi <qiyaoltc@xxxxxxxxx>:
> 2011/8/1 Triple Yang <triple.yang@xxxxxxxxx>:
>> GDB源码中的remote.c文件包含了对remote serial
>> protocol(RSP)的封装,但是我看6.8和7.2版本中的remote-mips.c和remote-m32r-sdi.c都没有直接调用remote.c中的函数,而是使用了serial.c中的serial_read()和serial_write()函数。谁能说明下serial.c和remote.c间的关系?
>>
>
> 我没有看过serial.c,所以不太清楚它是干什么的。 remote.c是实现了rsp,和serial.c没有关系。
>
> remote-mips.c的注释"Remote debugging interface for MIPS remote debugging
> protocol.",说明这个文件其实实现的也是一个协议,而serial.c只是这个协议的传输介质 (我猜的)。
>
>> 此外remote-mips.c中非常明显地使用了自定义的包格式。如果想要遵从RSP,那应该怎么选择?有合适的例子推荐吗?
>
> 如果你想遵从rsp,其实你是想实现一个stub。你可以参考一些开源jtag软件,它们就是把gdb的rsp翻译成相应的jtag命令。  It
> is not small a piece of work :)  Good luck!
>
> --
> Yao Qi <qiyaoltc AT gmail DOT com>
> http://sites.google.com/site/duewayqi/
>

我以前作过相关的东西 作一个STUB的好处是不需要跟GDB弄在一起 不过就不能支持REMOTE支持以外的功能了
作一个内置单独的target 可以自己添加一些REMOTE没有的功能 还可以很方便的根据自己板子加一些相关的调试命令

Other related posts: