Single step debugging
ManAtWork
Posts: 2,176
in Propeller 2
I've seen the presentation of OzPropDevs single step debugger, last Wednesday. As there was very little feedback it might look like there is no interest. But I have to say that is not the case! I'd highly appreciate anything that makes debugging easier. As I already said earlier printf-style debugging is nice (and neccessary) for realtime applications where you can't single-step. But there are cases where single-stepping is more convenient because you can examine what's going on without having to predict what variables you need to watch (and adding lots of printfs/debug statements).
OzPropDevs approach with the serial terminal has the advantage of being compiler and platform independent. If I understood correctly It's just a little piece of code that theoretically can be compiled into any program. I said "theoretically" because it has to extract the symbol information somehow.
The debugger is already useful for small pieces of spin or assembler code. However, to debug big projects a graphical symbolic debugger where you can click on source code lines to add breakpoints and on variables to add watches would be much more powerful.
What would be required to implement such a tool? (apart from lots of time and skill, of course) I think we'd need some standard format for the symbol table, I mean an address for every line of code and a description of the memory layout for data and variables. If such a file format existed it would be possible to write a debugger back-end that runs together with the application code on the propeller, a front-end that runs on a PC (preferably with GUI or just a terminal in the simplest case) and both would communicate over a serial link.
The front end could be integrated into the IDE but doesn't neccesarily have to. If it's a separate program it can also be used with FlexProp, for example, without Eric having to implement the whole debugger on his own.
OzPropDevs approach with the serial terminal has the advantage of being compiler and platform independent. If I understood correctly It's just a little piece of code that theoretically can be compiled into any program. I said "theoretically" because it has to extract the symbol information somehow.
The debugger is already useful for small pieces of spin or assembler code. However, to debug big projects a graphical symbolic debugger where you can click on source code lines to add breakpoints and on variables to add watches would be much more powerful.
What would be required to implement such a tool? (apart from lots of time and skill, of course) I think we'd need some standard format for the symbol table, I mean an address for every line of code and a description of the memory layout for data and variables. If such a file format existed it would be possible to write a debugger back-end that runs together with the application code on the propeller, a front-end that runs on a PC (preferably with GUI or just a terminal in the simplest case) and both would communicate over a serial link.
The front end could be integrated into the IDE but doesn't neccesarily have to. If it's a separate program it can also be used with FlexProp, for example, without Eric having to implement the whole debugger on his own.
Comments
GDB remote protocol (note that most of the commands are optional, the stub can simply send an empty response to indicate it doesn't support the command)
A simple GDB stub in C
Having the power of GDB for use with propeller development would also be great.
When I worked at HP, we used HP's WDB (Wildebeest Debugger) essentially a variant of GDB (Gnu Debugger), as it turns out a Wildebeest is the same as a Gnu.
WDB/GDB was very helpful when working with coding in HP-UX (HP's UNIX OS).