Welcome! Log In Create A New Profile

Advanced

Paradroid questions

Posted by Choba 
Paradroid questions
December 16, 2008 07:34PM
I ported SDL Paradroid over the Wii hombrew and while I thought I had found all of the freeze-up issues (without using a debugger), apparently I have not. The frequency of the freeze up is somewhat rare, but in the course of testing the game from start to finish in 'god mode' I froze up twice...which is disappointing to say the least.

The freezes don't give me a register dump or stack trace, and I don't own a USB Gecko at this point. Since they occur in no set pattern that I can recreate, I can't add file logging to narrow the location. During the freeze up the screen goes black and and the sound lets out an interesting series of noises...

So a couple questions-

1. Would a USB Gecko catch such a freeze condition and let me debug it?
2. Are there byte/word alignment issues that I need to be aware of and explicitly code for, or are those taken care of by the compiler? It seems like my last build prior to the addition of the god mode for testing was not freezing up- but the game isn't easy and I had only played about 2/3 through. The only difference is that some very minor damage code was commented out with #idef's. So I have to wonder if I'm incidentally running into some kind of alignment issue by moving things around.

That said, I'm hoping to find and fix this issue and move onto something new, and I have a few more questions:

1. Does the devkitPPC tools have support for any kind of dynamic loader? Can you use shared objects and something like dlopen()?
2. What about file memory mapping from files on the SD-CARD?
3. Has anyone ported a tool like electric fence to the Wii to catch buffer over/underruns or uninitialized variables?
4. Is there any way to install a debug stub around your binary and attach to the debugger over TCP/IP?
5. Has anyone written a simple library for TCP IP based logging?

If anyone with a USB Gecko wants to run the God Mode binary through the game and try to catch the crash and send me a stack trace or core dump I'd also be very obliged.
Re: Paradroid questions
December 16, 2008 09:01PM
USB Gecko might, but you'd have to alter your program to support WiiRD. As you don't have one, you might be worth implementing a different debugging method over TCP/IP using the network library.

The way USBGecko/WiiRD works is that you install a video hook (I think it's called something like GX_PreRenderCallback, there's also a PostRender too, so take your pick). So on each screen refresh, it checks the USBGecko for incoming data (usually 1 byte to indicate the function requested from WiiRD, such as dump memory etc.)

You don't need a "stub", it'd probably be easier if you wrote the "debug server" into Paradroid (then you can reference your arrays/variables by name). Set it to listen on a port, and waits for data from a PC client on the screen refreshes, and performs actions such as dumping variables back through TCP to the client program running on a PC. If you built in an "Edit" command, you could adjust game data mid-game.

Hope that helps, or feel free to ask me if something doesn't make sense
Re: Paradroid questions
December 17, 2008 07:28AM
There actually is a gdb tcp stub going around, it's not very good, but it does work.
Re: Paradroid questions
December 17, 2008 08:26AM
Really? That's pretty cool :-)
Re: Paradroid questions
December 17, 2008 11:06AM
One can also use the debug library, which comes with the devkitPPC package, and a USB Gecko.
Re: Paradroid questions
December 17, 2008 11:08PM
Any idea where to find the gdb tcp stub?

also, is there the equivalent of abort() in ogc? In some cases I'd like to trigger the stack trace screen and register dump to see the call stack.
Re: Paradroid questions
December 17, 2008 11:17PM
Hmm, upon further digging it looks like one of the options in OGC debug is to initialize the gdb support with either USB Gecko or TCP..

#ifdef DEBUGON
//DEBUG_Init(GDBSTUB_DEVICE_TCP,GDBSTUB_DEF_TCPPORT); //Default port is 2828
DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
_break();
#endif

Has anyone used this? I guess I'll give it a try and see what happens.
Re: Paradroid questions
December 18, 2008 01:16AM
hmm, it would appear that the support for TCP is only with the gamecube broadband adapter. A quick scan of the source code seems to confirm that its hard-coded support for the GC BBA.

If anyone knows of a libdb.a that's been hacked to work with the Wii wireless adapter through OGC networking, please share some info.
Re: Paradroid questions
December 18, 2008 05:51PM
@Choba
Please don't triple post. Just edit your first post.
Re: Paradroid questions
December 18, 2008 09:17PM
What's worse, triple posting, or chiming into a technical thread with etiquette advice? ;-)



Edited 1 time(s). Last edit at 12/18/2008 09:19PM by Choba.
Re: Paradroid questions
December 18, 2008 09:22PM
What I meant by tcp support is not the bba, but the Wii wifi tcp.
Sorry, only registered users may post in this forum.

Click here to login