GDB远程协议:如何分析数据包? [英] GDB remote protocol: how to analyse packets?

查看:203
本文介绍了GDB远程协议:如何分析数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b

  • 具有eCos OS的专有原型ARM板(基于Cortex-M3) / li>
  • 主板具有编程的RedBoot引导程序

  • 串行线路(RS-232)

  • GDB调试器(arm-eabi-gdb)
  • 主机操作系统是Windows / Cygwin和/或Linux(实际上并不重要)


问题: GDB调试器无法通过串行线连接到目标。

想要:是嗅探GDB远程协议的数据包,以便确定目标上的GDB存根是否存在并正在运行。



详细信息: RedBoot可以选择将目标控件传递给内置的GDB存根。我知道RedBoot是活着的,我可以连接它并通过串行线发送命令。 RedBoot手册表示切换到GDB存根可以通过输入$或+符号(这实际上是GDB远程协议数据包的前缀)。当我发送终端消失的那些符号时,它似乎工作。但我不确定RedBoot是否使用GDB存根支持编译(不要问我为什么: - ))。

然后,当我尝试连接到我的GDB调试器板上,我得到了下面的图片(在Windows上):

$ g $ g $目标远程COM3
使用COM3进行远程调试
忽略数据包错误,继续...
忽略数据包错误,继续...
忽略数据包错误,继续...
忽略数据包错误,继续...

端口正确,波特率也是如此。实际上,如果我试图对另一个没有连接任何东西的串行端口进行相同的输出,我也会得到相同的结果。



我想知道的是GDB存根发回什么或不是?



直觉上我认为可能是

 在$ b $上设置详细信息b  

会有所帮助,但GDB手册说它的效果非常有限,我的情况超出了它。



也许可以使用一个宏来编译GDB调试器,该宏可以启用调试日志记录?

解决方案


我想知道的是GDB存根是否发回任何东西?


target remote ):


I have:

  • A proprietary prototype ARM board (Cortex-M3 based) with eCos OS
  • The board has the programmed RedBoot bootloader
  • Serial line (RS-232)
  • GDB debugger for ARM (arm-eabi-gdb)
  • Host OS is Windows/Cygwin and/or Linux (actually, doesn't matter)

Problem: GDB debugger cannot connect to the target over the serial line.

What I want: is to sniff the packets of the GDB remote protocol in order to undestand whether the GDB stub on the target is alive and operating.

Details: RedBoot has an option to pass the target's control to the built-in GDB stub. I know that the RedBoot is alive, I can connect to it and send it commands over the serial line. The RedBoot manual says that the switch to the GDB stub can be made by typing $ or + symbols (which are actually the prefixes of the GDB remote protocol packets). It seems to work for when I send those symbols the terminal dies. But I'm not sure if the RedBoot was compiled with the GDB stub support (don't ask me why :-)).

Then, when I try to connect to the board with my GDB debugger I get the following picture (on Windows):

(gdb) target remote COM3
Remote debugging using COM3
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...

The port is correct, the baudrate as well. Actually the same output I get if I try to do the same with another serial port which is not connected with anything.

What I want to know is does GDB stub send back anything or not?

Intuitively I thought that probably

set verbose on

would help, but GDB manual says it has very a limited effect and my case is beyond it.

May be it is possible to compile GDB debugger with a macro which enables debug logging?

解决方案

What I want to know is does GDB stub send back anything or not?

Do this (before target remote):

(gdb) set debug remote 1

这篇关于GDB远程协议:如何分析数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆