Step-by-Step Guide to your own Linux Application
•
123
Debugging of User Space Programs
WAGO-I/O-SYSTEM 750
Linux Fieldbus Coupler
Fig. 5-6: Starting the GDB server on the 750-860
The GDB server will now wait for a connection request (
Listening
) of the
GDB client via port 1234 of IP address 192.168.1.4. Port 1234 is chosen
arbitrarily, another port can also be used, of course.
To start GDB on the Linux PC, enter the following calls:
> cd ~/uclinux-dist/user/newProg
> arm-uclinux-elf-gdb newProg.gdb --command=gdb.script
Fig. 5-7: Starting GDB on the PC
You can use the following commands for debugging:
GDB command Description
step
The program is executed until the next program line is reached. Also steps
into subroutines if it is the next code line.
stepi
The program is executed until the next assembler code line.
next
The program is executed until the next program line is reached. Skips
subroutines.
nexti
The program is executed until the next assembler code line. Skips
subroutines.
continue
Continues to execute the program. The next breakpoint or pressing
STRG+C tops the execution.