Cross-debugging with sparc-rtems4.10-gdb, from inside Eclipse
Mauro Lacy
mlacy at invap.com.ar
Fri Feb 5 12:32:52 UTC 2010
Hi,
I'm trying to integrate sis debug in Eclipse, running in a Fedora Core
10 OS. That is, to call an application inside the sis simulator, and
debug it from the eclipse IDE, using the eclipse RTEMS plugin.
We're using RTEMS 4.10, compiling the app for the sis "bsp".
I'been able to (partially) integrate sparc-rtems-4.10-gdb into Eclipse.
Here's what I've done:
- Changed to the "Debug" perspective.
- Created a new C/C++ Debug Configuration.
In the "Main" tab:
- Unchecked "Connect process input & output to a terminal".
In the "Debugger" tab:
- Selected "gdb Debugger" in the "Debugger" combo.
- Unchecked "Stop on startup at"
- Set "/opt/rtems-4.10/bin/asparc-rtems4.10-gdb" into the "GDB debugger"
text option.
- Set ~/.gdbinit as my "GDB Command file" (note the ~)
- Created a ~/.gdbinit containing:
target sim
load ~/workspace/HelloDebug/RTEMS\ Executable\ Configuration/a.exe #
this is wired at the moment.
- Manually toggled a breakpoint on Init(), in the code window.
- Selected my new Debug configuration in the "Debug" button.
- Waited a little while, until the start up ended.
- In the code window, a tilde appeared on the
breakpointed line.
- Pressed "c" in the Console window.
And voila, now the line pointer is in the first line of the Init
function, and the Step... buttons are enabled. I'm able to step over
and step into, etc.
Some actual problems I'm having:
- The app path is wired in the .gdbinit file. Can environment variables
be used in .gdbinit?
- The debugger startup is slow. 30 seconds, or more. Seems like eclipse
is waiting for an specific output from gdb that never comes, and a
timeout is reached.
- It's necessary to press a key in the console window at the moment, for
the debugging to start. Maybe just a missing directive in ~/.gdbinit?
- "Watch expression" doesn't seem to be working. The expressions always
return zero...
- The console output gets some peformance and/or statistics output, that
is mixed with the program output. This is probably an option of gdb.
By the way, gdb is being called with these arguments:
/opt/rtems-4.10/bin/sparc-rtems4.10-gdb -q -nw -i mi
--cd=/home/dev/workspace/HelloDebug --command=~/.gdbinit
/home/dev/workspace/HelloDebug/RTEMS Executable Configuration/a.exe
If you have some suggestions or documentation on how to improve this, I
would like to know about it.
Best regards,
Mauro
More information about the users
mailing list