Debugger and other Plans?
Christof Eb.
Posts: 1,234
Hi,
some time ago I had had the impression, that it was planned to integrate a source level debugger into the GCC environment.
Will there be such feature?
Another question:
Will there be some kind of library with explanations for basic functions like the existing library for SPIN?
(At this moment for example I am wondering, how to interface servos with GCC)
Best regards,
Christof
some time ago I had had the impression, that it was planned to integrate a source level debugger into the GCC environment.
Will there be such feature?
Another question:
Will there be some kind of library with explanations for basic functions like the existing library for SPIN?
(At this moment for example I am wondering, how to interface servos with GCC)
Best regards,
Christof
Comments
http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-02-26.zip&can=2&q=
This version includes the command-line version of gdb. If you need a GUI debugger you'll have to try one of the GUI frontends for gdb. I believe that Parallax is hard at work on something like this as we speak. I'm sure you can expect the exceptional quality of Parallax documention for their C/C++ product just like we've all appreciated for Spin.
Is it more like a monitor? Or, can you implement breakpoints?
David gave the basics, but I'll expand on it a little bit:
When compiled for debugging (-g option) the application uses a slightly different LMM or XMM kernel, which has a simpler loop and also checks for a single step flag, breakpoints (for XMM mode; in LMM mode the breakpoint can be inserted directly into the code in RAM), and serial interrupt from the host. A simple serial protocol is used to communicate between the COG and the host, where a program called "gdbstub" interfaces with the gdb debugger.
The way you run the debugger is:
(1) Use propeller-load to run the application, but give it the -g flag to say you want to debug (and do not add -t to stay in terminal mode):
propeller-load -bc3 foo.elf -r -g
This starts the app and sets the "single step" bit in the LMM kernel, so the COG immediately drops into the debug stub.
(2) Launch propeller-elf-gdb
propeller-elf-gdb foo.elf
(3) Set breakpoints and interact with the program as you normally would with gdb, which is a very powerful command line source level debugger (there's lots of documentation out there on the web for it). In XMM mode only 2 breakpoints can be set in ROM (the XMM kernel checks the address of the next instruction to execute against a list of breakpoints) so things are a bit restricted. Any number of breakpoints may be placed on XMM code in HUB memory, or in LMM code; in thise case the breakpoint is performed by inserting a "call #__EnterDebugger" instruction at the point where the program should break (after backing up the original instruction, of course!)
Currently the debugger only supports single threaded programs (one C COG). The protocol is set up for multiple COG support, but we haven't finished integrating that with gdb yet.
Eric
As my PPMM (Personally Preferred Memory Model) is CMM, I hope for debugger support of that....
All my old dreams for a Propeller language are coming true:
Fast,
well documented,
with floating-point support,
usefully working with the restricted on chip memory,
having a debugger.
This is great!
Christof