I was wondering whether it would be possible to install a crash handler on the PSP.
I've tried using the POSIX implementation, by installing a signal handler for SIGBUS (didn't try it with SIGSEGV), but that didn't work out.
The signal was simply ignored, no handling happened, or at least printf wasn't able to send the message via USB.
However I'd really like to have a little stacktrace when my application crashes (gcc should be able to create one, as soon as a handler is correctly installed), so other people can report that.
I know that some applications print the crash info to screen (I think SuperTux does it for example), but I'd really like to have the ability to gently shut down the application and print a stacktrace to a file.
I've scrolled through the PSPSDK doc, but couldn't really find something useful.
Maybe someone here has experience with it.
EDIT: First off I forgot PSPLink had already registered the exception handle, second, I found the function I was searching for inside the exception.c of PSPLink. It's called sceKernelRegisterDefaultExceptionHandler
EDIT2: I'm unable to use that function as the error code when loading tells me that the library has not been found.
Found something interesting here, which should be enough for the beginning.
https://github.com/adventuregamestudio/ ... /exception
EDIT3: My plan with using gcc to unwind the stack has been destroyed by knowing that MIPS usually does not feature stackpointers, which makes it nearly impossible. I'll guess I'll just dump the values on the stack, then look them up with GDB in case an error occurs.
Advertising