Debugging
Remote Debugging with GDB
devkitPro comes with gdb, the gnu debugger, which has been configured to allow remote debugging over the USB Gecko. You compile a stub of code into your wii program and run the debugger on your pc. Firstly initialise the link with:
- include <debug.h>
DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
You can then manually insert breakpoint into your code with the line:
_break();
Your wii code must be linked with the option -ldb, included before other libraries such as -logc.
Start your wii code using normal means such as the homebrew channel. Start gdb by typing:
powerpc-gekko-gdb
At the gdb command prompt, type:
target remote /dev/ttyUSB0
You can then continue running the program by typing "cont"