Debugging: Difference between revisions

From WiiBrew
Jump to navigation Jump to search
Bigzoid (talk | contribs)
Initial information about remote debugging on gdb, still very basic
(No difference)

Revision as of 09:31, 28 June 2008

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:

  1. 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"