1.6. Debugging an example project
In this section, we will learn how to use the GNU debugger i.e., GDB on
the host for remote debugging in conjunction with the GDB server on the
target.
First, start the GDB server on the target. Then configure the Eclipse platform
and start the GNU debugger of Eclipse using the Debug view.
The GDB client is running on the host and is used to control the GDB
server on the target, which in turn controls the application running on the
target.
GDB client and GDB server can communicate over a TCP/IP network
connection as well as via a serial interface.
In this Quickstart we will only describe debugging via TCP/IP.
1.6.1. Starting the GDB server on the target
In this passage you will learn how to start the GDB server on the target. The
GDB server will be used to start and control the
myHelloWorld
program.
To debug a program with GDB, the program needs extended debugging
symbols.
This has already been added while building the program.
Open
Minicom
#sudo minicom -D /dev/ttyXX
Note
:
where XX is the Node Number. In case of USB-to-Serial converter it will be USB*
Type user name
“root”
and press Enter
Start the GDB server:
#
gdbserver 192.168.1.12:10000 myHelloWorld
You have started the GDB server on the target. The GDB server is now waiting
for connections on TCP port 10000.
PHYTEC Embedded Pvt. Ltd 2014
24