Debugging via Console
Using GDB
On the asl cluster start your binary with the "-g"-option:
./start_<deploy-unit name>_<X>.sh -g
This launches the binary with GDB and breaks at the beginning of the main function.
Remote Debugging on the FEC
On the
FEC start your binary with the "-r"-option:
./start_<deploy-unit name>_<X>.sh -r
This option launches a GDB server on port <FEC>:10000 that can be connected to.
GDB Cheat Sheet
Instruction on how to use GDB are found here:
GDBCheatSheet.
Remote-Debugging via Console
Once the FESA3 binary to is launched for remote debugging open a separate console.
To begin the remote debug process use the following recipe:
- On the FEC start your binary with the "-r"-option:
./start_<deploy-unit name>_<X>.sh -r
- Launch GDB:
gdb -ex "target remote scuxl0019:10000" # scuxl0019 is the hostname, 10000 is the default remote debug port
, on success the message "Remote debugging from appears on the console where the binary is running."
- Set the desired breakpoints, e.g. :
b <full file path>:<line number>
- Type
continue
to proceed
Debugging via Eclipse
Required Eclipse Plugins
Terminal -
http://elt.googlecode.com/git/update-site
Eclipse Kepler -
http://download.eclipse.org/releases/kepler
- General Purpose Tools > Remote Systems Explorer End-User Runtime
- Mobile and Device Development > C/C++ GDB Hardware Debugging / C/C++ Remote Launch
General Setup
- Install the Remote Systems Explorer: Remote Systems Explorer End-User Runtime / User Actions from http://download.eclipse.org/releases/kepler, section Mobile and Device Development
- Get the python pretty printers in your home directory: svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
- Setup your .gdbinit file (example file attached, adapt the path to your pretty printer installation: e.g. $(HOME)/python)
- Enable pretty printing by adapting Window > Preferences > C/C++ > Debug > GDB, select your .gdbinit file and enable the pretty printing option.
The debug-session
If the computer on which the binary is running is the same computer on which eclipse is running, please continue here:
If this is not the case, continue here: