gdb 远程调试协议_从零开始实现gdb远程调试协议存根1

gdb 远程调试协议

这是什么? (What is this?)

I want to implement a fake gdb-server that understands the GDB Remote Debug Protocol. This fake server can have either GDB or LLDB attached to it, allowing step in execution, examine registers, examine memory contents, set break points. I don’t know if I’ll be able to finish it or how long it’s going to take. But I’m going to publish my code as I make progress.

我想实现一个伪造的gdb服务器,该服务器可以理解GDB远程调试协议 。 该假服务器可以连接GDB或LLDB,从而允许执行步骤,检查寄存器,检查内存内容,设置断点。 我不知道我是否能够完成它或需要多长时间。 但是随着进展,我将发布我的代码。

动机 (Motivation)

I was writing a Play Station emulator last year for fun. In order to make the debug process better than just a bunch of logs, I implemented a gdb-server stub so that I could attach gdb to it. It was a successful attempt where I could attach a gdb from command line to my emulator. But it’s really not that fun to wrestle with the gdb CUI (or TUI if you prefer).

去年,我在写Play Station模拟器很有趣。 为了使调试过程比仅仅一堆日志更好,我实现了一个gdb-server存根,以便可以将gdb附加到它。 这是一次成功的尝试,我可以从命令行将gdb附加到仿真器。 但是,与gdb CUI(或您愿意的话,TUI)搏斗真的不是那么有趣。

So I decided that I needed a graphical debugger interface. Visual Studio Code the best choice for me because I was writing my emulator on it with Rust. My first attempt is to use the Native Debug extension to launch a local gdb that configured to target MIPS processors.

因此,我决定需要一个图形调试器界面。 Visual Studio Code对我来说是最佳选择,因为我正在用Rust在其上编写模拟器。 我的第一次尝试是使用本机调试扩展来启动配置为针对MIPS处理器的本地gdb。

This is where I got greedy; I wanted to make it work for LLDB too. In theory, LLDB does support gdb remote debug protocol, so it should just work out of box, but that just wasn’t the case. LLDB has its own extensions in the protocol that needed to be supported. I was able to make LLDB attach to my emulator and step-in to the instructions. But I couldn’t make it show the registers even though I implemented qHostInfo, qRegisterInfo and whatnot. That’s why I decided that I should implement a fake gdb-server from scratch to better understand the protocol.

这就是我贪婪的地方。 我也想使它适用于LLDB。 从理论上讲,LLDB确实支持gdb远程调试协议,因此它应该开箱即用,但事实并非如此。 LLDB

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值