adium 2435:ce0bf341ff44: Use the private app-specific crash info...

commits at adium.im commits at adium.im
Sun May 31 23:59:45 UTC 2009


details:	http://hg.adium.im/adium/rev/ce0bf341ff44
revision:	2435:ce0bf341ff44
author:		David Smith <catfish.man at gmail.com>
date:		Sun May 31 16:59:24 2009 -0700

Use the private app-specific crash info system to attach a bit more useful debug info... along with a nice note explaining that we won't use this in non-debug until it's public api

diffs (26 lines):

diff -r 19ff140611a6 -r ce0bf341ff44 Source/AIObjectDebug.m
--- a/Source/AIObjectDebug.m	Sun May 31 18:18:04 2009 -0400
+++ b/Source/AIObjectDebug.m	Sun May 31 16:59:24 2009 -0700
@@ -35,6 +35,9 @@
 #import "AIObjectDebug.h"
 #import <objc/objc-runtime.h>
 
+char *__crashreporter_info__ = NULL;
+asm(".desc ___crashreporter_info__, 0x10");
+
 @implementation NSObject (AIObjectDebug)
 
 - (void)doesNotRecognizeSelector:(SEL)aSelector
@@ -42,9 +45,12 @@
 	if (sel_isEqual(aSelector, @selector(description)) || sel_isEqual(aSelector, @selector(doesNotRecognizeSelector:))) {
 		//we're hosed.
 		NSLog(@"Avoiding infinite recursion in doesNotRecognizeSelector:");
+		*((int*)0xdeadbeef) = 42;
+		return;
 	} else {
 		NSLog(@"%@ of class %@ does not respond to selector %s", self, [self class], aSelector);
 	}
+	__crashreporter_info__ = (char *)[[NSString stringWithFormat:@"Dear crash reporter team: We only put stuff here in debug builds of Adium. Don't Panic, it won't ship in a release unless there's public API for it. %@ of class %@ does not respond to selector %s", self, [self class], aSelector] cStringUsingEncoding:NSASCIIStringEncoding];
 	*((int*)0xdeadbeef) = 42;
 }
 




More information about the commits mailing list