#165830 - Kaiser - Thu Jan 08, 2009 8:00 am
I am looking for an alternative debugging tool other than the commercial version of NO$GBA (a free alternative tool that is..).
Trying to figure out problems and fixing unknown crashes is becoming pretty hectic and I would like to know if there's any known freeware/open source debuggers.
#165839 - elhobbs - Fri Jan 09, 2009 2:25 am
desmume can be compiled from the svn with a gdb debug stub. I use this with insight that is included with the devkitARM installation. the only big thing missing with desmume is wifi support.
however, if you can cross compile to windows and or linux then that is probably the best solution.
#165851 - Kaiser - Fri Jan 09, 2009 4:59 pm
A gdb debug stub? I am a little unfamiliar with that. How would I go about generating one?
#165852 - elhobbs - Fri Jan 09, 2009 6:37 pm
you need to get the desmume source code from the sourceforge download page. you will need to compile it with GDB_STUB defined. this link http://forums.desmume.org/viewtopic.php?id=85 has some info about using it. you can ignore the parts about getting the gdb stub code as it is already integrated into the desmume source. it is just not enabled in the prebuilt images.
#165855 - gauauu - Fri Jan 09, 2009 9:24 pm
The frustrating part, in my experience, is that desmume wasn't as accurate in dying and crashing as no$gba was. I'd have problems in my code that caused serious issues on hardware and on no$gba, but were hard to debug, as desmume would play it just fine.
#165858 - a128 - Fri Jan 09, 2009 9:55 pm
Searching for a software bug could be hell on the NDS with libnds . Luckily libnds has a blue screen exception handler. It prints a lot of usefull information about the state of the ARM9 at exception time.
Looking to a bunch of registers and memory adresses is not very sexy.
Here is a modified guru exception handler.
http://a128.blogspot.com/2008_08_01_archive.html
Do
STACK_TRACE;
in your code. The handler records the last 21 STACK_TRACE calls and prints the history at guru meditation on the top screen of the NDS. Hope it's usefull for someone.
#165867 - Abcd1234 - Sat Jan 10, 2009 4:04 am
I've actually used Masscat's GDB stub quite successfully. You can find it here:
http://masscat.afraid.org/ninds/debug_stub.php
It allows you to debug your application directly on the DS by providing a remote GDB stub that you connect to over WiFi. It's a bit flaky at times, but for the most part it works quite nicely, and has allowed me to track down some bugs (such as memory stompers) that would be virtually impossible to track down otherwise.
#165868 - elhobbs - Sat Jan 10, 2009 5:53 am
yes, desmume will happily read from invalid memory addresses as it does not implement the memory protection unit.
the libnds guru meditation screens are not that bad. you can usually use the address from PC or LR like so
arm-eabi-addr2line -e arm9.elf 0x02020000
to find the source file and line. stack overflow is another big issue on the ds. if SP is smaller than 0x0b000000 (like 0x0Afffff4) than you have overflowed the stack - too many local variables or recursion depth issues.
once I find the offending section of code then I will add some special code to trap the condition in desmume so I can step through it with insight.
#165908 - Kaiser - Mon Jan 12, 2009 8:34 pm
I don't know if this exists yet, but is the source code to arm-eabi-addr2line available?
I was concidering intergrating it into my game so it would just print the line of the source file that caused the exception in the game.
#165909 - Maxxie - Mon Jan 12, 2009 8:40 pm
elhobbs wrote: |
yes, desmume will happily read from invalid memory addresses as it does not implement the memory protection unit. |
Well it does so if you enable that feature and compile it yourself. However that in most cases little usefull feature takes a lot of performance.
Code: |
#ifdef MMU_ENABLE_ACL
|
_________________
Trying to bring more detail into understanding the wireless hardware