In this example, we'll be debugging our "Hello,
world!" program via a TCP/IP link. We go through the
following steps:
configuring the target
compiling for debugging
starting the debug session
getting help
Configure the target
Let's assume an x86 target using a basic TCP/IP configuration. The following lines (from the sample boot file at the end of
this chapter) show what's needed to host the sample session:
Compile for debugging
We'll be using the x86 compiler. Note the -g option, which enables debugging information to be included:
Start the debug session
For this simple example, the sources can be found in our working directory. The gdb debugger provides its own shell; by default its prompt is (gdb). The following commands would be used to start the session. To reduce document clutter, we'll run the debugger in quiet mode:
Get help
While in a debug session, any of the following commands could be used as the next action for starting the actual debugging
of the project: