Homebrew Debugging

LeRodeur

Well-Known Member
Member
Joined
Dec 12, 2009
Messages
162
Trophies
0
Age
31
XP
200
Country
France
I think that no$gba is still the greatest debugger for nds, though I never tried other emulators ones. I don't think you can debug directly on nds, if it is your homebrew then you only have to output messages, easiest way of debugging
 

smealum

growing up sucks.
Member
Joined
May 1, 2006
Messages
635
Trophies
2
Age
31
Location
SF
Website
www.smealum.net
XP
2,516
Country
United States
You might want to read this : http://www.console-dev.de/2009/09/20/guru-meditation-error-data-abort-exception/ ; it explains how to use the "guru meditation error" you might sometimes see in homebrew games (among other things) to debug your games. Basically, every time your program crashes, it will give you information which you can use to know which line of your code is faulty. Of course, it's only one tool and it won't give useful information every time, but it's better than nothing, and it'll work on the DS (you don't need an emulator to get it to work).
 

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,454
Country
United States
Whats the game? Most run fine on nogba

The ds emulators don't like to run on my computer.

You might want to read this : http://www.console-d...bort-exception/ ; it explains how to use the "guru meditation error" you might sometimes see in homebrew games (among other things) to debug your games. Basically, every time your program crashes, it will give you information which you can use to know which line of your code is faulty. Of course, it's only one tool and it won't give useful information every time, but it's better than nothing, and it'll work on the DS (you don't need an emulator to get it to work).

Thanks.
 

Schmendrick

Well-Known Member
Newcomer
Joined
Sep 12, 2009
Messages
55
Trophies
0
Website
www.dennisvanzwieten.com
XP
166
Country
Netherlands
You could also use the console to print info to the screen. It's very limited, but it'll get you some more info on specific variables.

My game framework contains, among other debugging functions, simple logging options that can be accessed at any time while playing, and automatically gets saved to the sd card when it crashes with said guru exceptions; See my level editor app for an example (link in my sig, press select+L+R). It's easy enough to make, and I find it very useful, though the logs do take up some memory (if memory is an issue for you).
 

Dirbaio

Well-Known Member
Member
Joined
Sep 26, 2010
Messages
158
Trophies
0
Age
111
Location
Spain
Website
dirbaio.net
XP
108
Country
Yea. Pretty much your debugging choices are:
- No$GBA Debugger: Awesome debugger, but bad emulator. Supports breakpoints and many other stuff, console printing, but doesn't support DLDI :(
- Desmume: You can print out with it if you use the dev+ builds, accurate emulation, DLDI supporting
- Real DS: you can just use the guru error screen, and libnds console. The guru error doesn't catch all kinds of errors though.

The one I always use is demume. It's accurate as hell :)

You might want to read this : http://www.console-d...bort-exception/ ; it explains how to use the "guru meditation error" you might sometimes see in homebrew games (among other things) to debug your games. Basically, every time your program crashes, it will give you information which you can use to know which line of your code is faulty. Of course, it's only one tool and it won't give useful information every time, but it's better than nothing, and it'll work on the DS (you don't need an emulator to get it to work).

I always open the .ELF file in IDA Pro and look up the faulty addresses. You can get many, many more info this way, you can look at the registers and see what variable they are :) That, eif you know how to read ARM assembler code :)
 

DanTheManMS

aka Ricochet Otter
Member
Joined
Jun 2, 2007
Messages
4,453
Trophies
1
Age
34
Location
Georgia
XP
752
Country
United States
- No$GBA Debugger: Awesome debugger, but bad emulator. Supports breakpoints and many other stuff, console printing, but doesn't support DLDI :(
With the FCSR thing, you can build your filesystem into a single *.nds executable that no$gba can load. It's read-only, but it works for testing sometimes. I usually used the DLDIrc addon to quickly build my FCSR images for testing. If you're interested I can give more detailed instructions and a more stable image builder tool.
 

CoolAs

Well-Known Member
Newcomer
Joined
Oct 21, 2011
Messages
75
Trophies
0
XP
109
Country
Hehe when i get guru's I use the arm-eabi-objdump tool you provide it with an .elf and it gives a conplete dissembly. Work's like a free version of IDA's .elf reader. (but you cant hack .arm9 in games with it xD).
In terms of debugging you could also make a ram dump to a file.(and a vram  dump if you are really needy) then just print the offsets of all your variables to a file. Allowing you to check everything. Also you could make it read ram dumps so you can modify variables and see what happens. Although my preferred debugger is desmume, this is because it has not only Dldi, but also can read ram, view vram, and heaps more. The only thing it can't do is dissemblies.
But yeah, try ram dumping to see whats happening - that is without an emulator.
 

Dirbaio

Well-Known Member
Member
Joined
Sep 26, 2010
Messages
158
Trophies
0
Age
111
Location
Spain
Website
dirbaio.net
XP
108
Country
Yeah, I've used desmume's GDB too, but it's way too unstable for me. It tends to hang / screw up/ crash :(

It works a bit more reliably if using Insight as a GDB client instead of IDA but it's still far from ideal.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    Psionic Roshambo @ Psionic Roshambo: @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87...