gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Dumping and using debug output on error

#164778 - Echo49 - Thu Nov 20, 2008 7:54 am

Is there anywhere where I can read up about how to dump the (register?) values on error, how to use them and with which tools to find where any errors are occuring?

#164779 - elhobbs - Thu Nov 20, 2008 1:30 pm

Echo49 wrote:
Is there anywhere where I can read up about how to dump the (register?) values on error, how to use them and with which tools to find where any errors are occuring?
on the ds I use
Code:
defaultExceptionHandler();
this sets up a register dump on exception. LR and PC can be used with the map file (created during the build process) to find the point where the exception occured. SP can be used to detect stack overflows.
when possible I try make a win32 version using the same code base. being able to debug using visual studio is a lot easier.
I have also had some luck using the emulator desmume and insight. insight comes with the devkitarm installation.

#164781 - Miked0801 - Thu Nov 20, 2008 6:12 pm

SP is also very useful for deducing the callstack - if you have access to the stack trace itself :)