Open phrxmd opened 5 years ago
Hi phrxmd, I am glad that you like this. A question: I am use GDB with ESP32, but I always need extra USB hardware, compatible with openocd, how us do it, if the purpose of this libray, is debug wireless ?
I made one library, to improve USB debugging in Arduino, without extra hardware:
https://github.com/JoaoLopesF/SerialDebug
In future, I add this resources to RemoteDebug.
Your help is very good to improve more the RemoteDebug.
Thanks a lot
Hi @JoaoLopesF, and thanks again for your good work! Yeah, I had SerialDebug in mind, that's why I'm commenting here :) RemoteDebug is a different story altogether.
The GDB protocol is just a simple protocol with a basic extensible command set. It's what debugging software uses to interface with OpenOCD. Having GDB access to SerialDebug over the serial link wouldn't give all the low-level access you get with JTAG hardware. But it would allow reusing your existing debugging tools for the basic debugging functions in SerialDebug gets you.
Hi @phrxmd, I will research on it, but I see a problem: map of memory for objects, in ESP32 it is done reading the elf binary file, but how do it without openocd ? And I will implement the debugger of SerialDebug on RemoteDebug. Tks
Hi @JoaoLopesF, I think that's why it's going to be a subset, making available only what is accessible from the program logic itself, but using the same command interface - the GDB protocol is just a set of basic commands in plain text over a serial line and not all of them have to be supported right away.
@phrxmd, You have any sample of GDB working?
@JoaoLopesF sorry for the late reply, it seems like I missed your answer here.
Here are a few samples and tutorials of remote GDB use from various contexts:
There is also a bit of documentation in implementing the server side of the GDB remote server protocol in various OSes:
The library is great and does a good job of providing logging and a basic debugger over the serial line. I would love to see this become more full-featured in the future - some other common debugging features might be easy to implement, such as breakpoints.
That said, I think it would be convenient if the command protocol for debugging was following a subset of the GDB protocol (maybe optional using a
#define
). The GDB protocol is super-simple, based around single-letter commands much similar to what you are already doing now. That way one could reuse the various host development tools made aroundgdb
. Of course it would never be the whole range of everything thatgdb
does, but even a subset would be useful.