Getting "Offending routine" message in exception h

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Getting "Offending routine" message in exception h

Post by seventoes »

Ive noticed that on a few homebrew games there is a message on their exception handler that says this:

"The offending routine can be identified with:
addr2line <some stuff>"

Heres my current exception handler:

Code: Select all

void MyExceptionHandler&#40;PspDebugRegBlock *regs&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	pspDebugScreenSetBackColor&#40;0x00FF0000&#41;;
	pspDebugScreenSetTextColor&#40;0xFFFFFFFF&#41;;
	pspDebugScreenClear&#40;&#41;;

	pspDebugScreenPrintf&#40;"I regret to inform you your psp has just crashed\n"&#41;;
	pspDebugScreenPrintf&#40;"Please contact Sony technical support for further information\n\n"&#41;;
	pspDebugScreenPrintf&#40;"Exception Details&#58;\n"&#41;;
	pspDebugDumpException&#40;regs&#41;;
	pspDebugScreenPrintf&#40;"\nBlame the 3rd party software, it cannot possibly be our fault!\n"&#41;;
&#125;
Pretty much the same code that is in the SDK examples...

I was wondering what i would have to add to my exception handler to show that offending routine message, because the info its showing me right now isnt helping much...
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

psp-adadr2line is a tool from the pspsdk or the psp toolchain. You can use it to find out where the exception occured, by given the address of the exception and the elf file from your homebrew to the application.
Best results are if you build you homebrew app with debug-info (using the -g option to gcc).
Br, Sandberg
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

Yeah i knew all that, and im already building with -g, but i still cant figure out how to get that message.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

That message is just printed in the custom exception handler of the application, you just add it manually to your code. see sdl_psp_exception_handler in http://svn.pspdev.org/filedetails.php?r ... rev=0&sc=0
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

Aha! Thanks! I was looking around in the sdk samples directory, i guess i shuold have been checking the svn..
Post Reply