@@ -17,13 +17,16 @@ #include "config.h" #include #import "OFString.h" +#import "OFArray.h" #import "OFStdIOStream.h" #import "OFFile.h" #import "OFAutoreleasePool.h" + +#import "OFException.h" #import "TestsAppDelegate.h" #ifdef _PSP # include @@ -84,13 +87,21 @@ } @catch (id e) { TestsAppDelegate *delegate = [[OFApplication sharedApplication] delegate]; OFString *string = [OFString stringWithFormat: @"\nRuntime error: Unhandled exception:\n%@\n", e]; + OFString *backtrace = [[e backtrace] + componentsJoinedByString: @"\n "]; [delegate outputString: string inColor: RED]; + if (backtrace != nil) { + backtrace = [OFString stringWithFormat: + @"\nBacktrace:\n %@\n\n", backtrace]; + [delegate outputString: backtrace + inColor: RED]; + } [delegate outputString: @"Press home button to exit!\n" inColor: NO_COLOR]; for (;;) { WPAD_ScanPads();