bdi
GDB
for BDI3000 (QorIQ P3/P4/P5)
User Manual
36
© Copyright 1997-2012 by ABATRON AG Switzerland
V 1.03
3.3 Debugging with GDB
Because the GDB server runs within the BDI, no debug support has to be linked to your application.
There is also no need for any BDI specific changes in the application sources.
3.3.1 Target setup
Target initialization may be done at two places. First with the BDI configuration file, second within the
application. The setup in the configuration file must at least enable access to the target memory
where the application will be loaded. Disable the watchdog and setting the CPU clock rate should
also be done with the BDI configuration file. Application specific initializations like setting the timer
rate are best located in the application startup sequence.
3.3.2 Connecting to the target
As soon as the target comes out of reset, BDI initializes it and optionally loads your application code.
BDI now waits for GDB request from the debugger running on the host.
After starting the debugger, it must be connected to the remote target. This can be done with the fol-
lowing command at the GDB prompt:
(gdb)target remote bdi3000:2001
bdi3000
This stands for an IP address. The HOST file must have an appropriate
entry. You may also use an IP address in the form xxx.xxx.xxx.xxx
2001
This is the TCP port used to communicate with the BDI
If not already suspended, this stops the execution of application code and the target CPU changes
to background debug mode.
Remember, every time the application is suspended, the target CPU is freezed. During this time, no
hardware interrupts will be processed.
Note
: For convenience, the GDB detach command triggers a target reset sequence in the BDI.
(gdb)detach
... Wait until BDI has resetet the target and reloaded the image
(gdb)target remote bdi3000:2001
3.3.3 GDB monitor command
The BDI supports the GDB V5.x "monitor" command. Telnet commands are executed and the Telnet
output is returned to GDB. This way you can for example switch the BDI breakpoint mode from within
your GDB session.
(gdb) target remote bdi3000:2001
Remote debugging using bdi3000:2001
0x10b2 in start ()
(gdb) monitor break
Breakpoint mode is SOFT
(gdb) mon break hard
(gdb) mon break
Breakpoint mode is HARD
(gdb)