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 > Debugging

#173756 - Thajocoth - Thu Apr 29, 2010 12:18 am

I've been coding fairly blind for a while now... I can't really find any way to get any sort of variable information or even debug output. I'm able to slowly work around this... But I'd be able to go a lot faster if I didn't have to do as much guesswork. Especially now that I'm working on some of the AI parts, like D* pathing...

Of the emulators I've been using, Ensata seems to be the only one that supports debug output. I've also been using DeSmuME for the graphics viewing and have tried to see what information I could get out of iDeaS & No$, which has been none.

In libnds, the link to "Console and Debug Printing" loads up a blank page, as do both of the links in the "Debugging" section. The Nitro command for debug output does not work (though, that's expected). So, how to I output to Ensata's debug window with devkitPro? Is there something I'm overlooking as far as variable tracking and the like go?


Last edited by Thajocoth on Thu Apr 29, 2010 9:13 pm; edited 1 time in total

#173761 - sverx - Thu Apr 29, 2010 9:37 am

http://libnds.devkitpro.org/a00068.html

you could print debug messages to the secondary screen or to no$ debug window.

#173762 - elhobbs - Thu Apr 29, 2010 11:03 am

You can use gdb or insight with desmume to debug the either the arm7 or the arm9. It has to be launched with a command line parameter though.

#173764 - Thajocoth - Thu Apr 29, 2010 4:24 pm

sverx wrote:
http://libnds.devkitpro.org/a00068.html
Yesterday, this page was coming up as a blank white page for me. Now it seems to work. That's odd...

sverx wrote:
you could print debug messages to the secondary screen...
I'm using the sub screen primarily, but it looks like this can also be set up for use with the main screen. This could be useful, thanks.

sverx wrote:
...no$ debug window.
You're aware that the version of no$ with debugging features is no longer obtainable, right? Otherwise I would be using that. At least, all the info I've searched for about it online seems to indicate this...

elhobbs wrote:
You can use gdb or insight with desmume to debug the either the arm7 or the arm9. It has to be launched with a command line parameter though.
I'll look into that, thanks.

#173765 - SteveH - Thu Apr 29, 2010 6:09 pm

The devkitPro.org domain was having a little wobbler for most of yesterday - WinterMute was made aware of it.

Also ensata IIRC is the official Nintendo emulator, and you should only have that IF you are an official developer...

#173766 - Thajocoth - Thu Apr 29, 2010 7:01 pm

SteveH wrote:
The devkitPro.org domain was having a little wobbler for most of yesterday - WinterMute was made aware of it.

Also ensata IIRC is the official Nintendo emulator, and you should only have that IF you are an official developer...
That makes sense. So not only would most people here not have access to Ensata, but neither would devkitPro, so there is no devkitPro equivalent of Nitro's command for debug output, which I've avoided explicitly stating for similar reasons. (While I'm not 100% sure on the limits of the NDA, I feel I'm better safe than sorry.)

Part of the reason I'm working with homebrew stuff instead of using what I already know, despite having access to the professional tools, is that I want to be able to share the resulting code of what I'm working on. In a way, the code is actually more important for what I'm doing than the final product is.


Last edited by Thajocoth on Thu Apr 29, 2010 9:14 pm; edited 2 times in total

#173768 - SteveH - Thu Apr 29, 2010 9:11 pm

Thajocoth wrote:
SteveH wrote:
The devkitPro.org domain was having a little wobbler for most of yesterday - WinterMute was made aware of it.

Also ensata IIRC is the official Nintendo emulator, and you should only have that IF you are an official developer...
That makes sense. So not only would most people here not have access to Ensata, but neither would DevKit Pro, so there is no DevKit Pro equivalent of Nitro's command for debug output, which I've avoided explicitly stating for similar reasons. (While I'm not 100% sure on the limits of the NDA, I feel I'm better safe than sorry.)

Part of the reason I'm working with homebrew stuff instead of using what I already know, despite having access to the professional tools, is that I want to be able to share the resulting code of what I'm working on. In a way, the code is actually more important for what I'm doing than the final product is.


1) it's devkitPro not DevKit Pro (WinterMute gets a little upset when the capitalisation is incorrect since devkitPro is the company that provides the devkitARM / devkitPSP toolchains)

2) There is a debug output in the toolchain (devkitARM) but you need to get no$ debug version or the latest SVN version of DeSmuMe to use them, or you can get dbg working with DeSmuMe as it is now.

#173776 - sverx - Fri Apr 30, 2010 10:17 am

Thajocoth wrote:
sverx wrote:
...no$ debug window.
You're aware that the version of no$ with debugging features is no longer obtainable, right? Otherwise I would be using that. At least, all the info I've searched for about it online seems to indicate this...


I was simply giving you an information, I've never used no$ debug window. Actually I always found printing on the other screen enough for my debug needs.

This uses MAIN engine for console:
Code:
consoleInit (NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 31, 0, TRUE, TRUE);

#173788 - Thajocoth - Fri Apr 30, 2010 6:21 pm

sverx wrote:
Thajocoth wrote:
sverx wrote:
...no$ debug window.
You're aware that the version of no$ with debugging features is no longer obtainable, right? Otherwise I would be using that. At least, all the info I've searched for about it online seems to indicate this...


I was simply giving you an information, I've never used no$ debug window. Actually I always found printing on the other screen enough for my debug needs.

This uses MAIN engine for console:
Code:
consoleInit (NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 31, 0, TRUE, TRUE);
Yeah, I've gotten it working on the main screen last night, it's great, thanks. Given the nature of the project, I'll likely have a button toggle the main screen between a map with unit/controls information and debug output windows for each system. This is a very useful feature.

#174063 - dheart88 - Sun May 16, 2010 10:29 pm

or the easiest way is to put exit(0); in your if clause.. if the condition true then the emulator screen will close

#174075 - kusma - Mon May 17, 2010 2:19 am

dheart88 wrote:
or the easiest way is to put exit(0); in your if clause.. if the condition true then the emulator screen will close

How will exit(0) from the NDS lead to the emulator closing down?

#174090 - fincs - Mon May 17, 2010 8:50 pm

kusma wrote:
dheart88 wrote:
or the easiest way is to put exit(0); in your if clause.. if the condition true then the emulator screen will close

How will exit(0) from the NDS lead to the emulator closing down?

It's some libnds hook that either returns to the loader if there's a bootstub present or shuts down the DS if there isn't. You can also press L+R+Select+Start to trigger it.
Currently only HomebrewMenu supports the return to loader protocol.