Welcome! Log In Create A New Profile

Advanced

Best/fastest way to test?

Posted by borbzz 
Best/fastest way to test?
June 02, 2009 04:43PM
Hello all,

I'm now at the point where I am trying to track down some crashes that are occurring in my app. The test cycle is excruciatingly slow, and I am wondering if there is any faster way to test my code. How do you guys test/debug your code?

Currently, I have to turn on the Wii, launch the HBC, upload my app, watch it crash, hard-reset the Wii, modify my code, and repeat. Do you guys know of any faster/better way to do this? I cannot get the gcube or Dolphin working on my computer, so using an emulator seems to be out of the question.

Is there anything I'm missing? Also, would there be any benefits to using USB Gecko? Thanks for the advice!

-borbzz
Re: Best/fastest way to test?
June 02, 2009 04:51PM
You can use the patch of libogc wich allow debugging via wifi (and tools based on gdb).
To run your homebrew, you can do that with sendelf or wiiload (instead of put it on your sd)

To avoid a crash of your wii, use try/catch in your main to catch all exception and return to the HBC.
Re: Best/fastest way to test?
June 02, 2009 07:21PM
You can also print out "check points" to a log file.
"after init; inside main; before draw; after draw;" ...etc
Re: Best/fastest way to test?
June 02, 2009 10:54PM
Quote
arasium
You can use the patch of libogc wich allow debugging via wifi (and tools based on gdb).
To run your homebrew, you can do that with sendelf or wiiload (instead of put it on your sd)

To avoid a crash of your wii, use try/catch in your main to catch all exception and return to the HBC.

Will a try/catch throw an exception for things like a NULL pointer being accessed? I'm kinda rusty on my C++ exception handling, because most of the work I've done has been on (groan) Symbian, which doesn't use standard C++'s try/catch mechanism.

I've been using wiiload to upload the .dol file to the Wii, which has been helpful. I'll also look into the wireless debugging. I'm familiar with GDB, but I'm much more comfortable with a frontend for it (I know, I'm a wimp!)

Thanks a lot for the suggestions!
Re: Best/fastest way to test?
June 03, 2009 11:35AM
No, c++ does not provide a way to catch null pointer dereferences.
Re: Best/fastest way to test?
June 03, 2009 02:47PM
catch(...) doesn't do that?

I'm not a pro in C++ :)
Re: Best/fastest way to test?
June 03, 2009 05:54PM
Nope, that only catches everything that was thrown. However, null pointer dereference exceptions is not the c++ exception type, they are os specific exceptions that is different on each platform. On posix systems, it usually causes some signal to be raised. All the c++ standard says is that "dereferencing a null pointer is undefined behavior". On the flip side, it's defined to be cool to free a null pointer.
Sorry, only registered users may post in this forum.

Click here to login