Although it it sometimes possible to debug applications using GDB (The GNU Debugger) on the target boards, there is often not enough memory available to run GDB on embedded systems running Linux. To work around this issue, you can use gdbserver to perform remote debugging. Installing and running gdbserver on the target board First of all you need to install gdbserver on the target board. Assuming you use a Debian based distribution:
1 |
apt-get install gdbserver |
If you distribution, does not have binary repository, you can download gdb source code and cross-compile gdbserver. Once gdbserver is installed, (cross-)compile your application in debug mode and start gdbserver as follows:
1 |
gdbserver target_ip:target_port prog_dbg |
Where target_ip and target_port are respectively the IP address of the board and the chosen TCP port, and prog_dbg, the program under test compile in debug mode (CFLAGS=-g). Remote Debugging with GDB If you are familiar with gdb and prefer to use the command […]