Permalink
Browse files

* Expand the debugging code from prev. commit

* Also Sequel Pro will now crash on the "Attempted to connect a connection that is not disconnected" issue. That is sadly necessary to get a stack trace of ALL threads as for exceptions Feedback Reporter only gives us the current thread.
  • Loading branch information...
dmoagx committed Aug 6, 2015
1 parent de84dc3 commit 5befad85ccd6d22900942ea73f4018d71038f516
Showing with 26 additions and 2 deletions.
  1. +7 −0 Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m
  2. +19 −2 Source/SPObjectAdditions.m
@@ -424,6 +424,11 @@ + (NSString *)findSocketPath
#pragma mark -
#pragma mark Private API
//http://alastairs-place.net/blog/2013/01/10/interesting-os-x-crash-report-tidbits/
/* CrashReporter info */
const char *__crashreporter_info__ = NULL;
asm(".desc ___crashreporter_info__, 0x10");
@implementation SPMySQLConnection (PrivateAPI)
/**
@@ -434,6 +439,8 @@ - (BOOL)_connect
// If a connection is already active in some form, throw an exception
if (state != SPMySQLDisconnected && state != SPMySQLConnectionLostInBackground) {
asprintf(&__crashreporter_info__, "Attempted to connect a connection that is not disconnected (SPMySQLConnectionState=%d).", state);
__builtin_trap();
[NSException raise:NSInternalInconsistencyException format:@"Attempted to connect a connection that is not disconnected (SPMySQLConnectionState=%d).", state];
return NO;
}
View
@@ -48,20 +48,37 @@ - (void)_scrollViewDidChangeBounds:(id)obj
[msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__];
retryDescribe:
[msg appendFormat:@"passed object (class <%@>): %@\n\n",[obj className],obj];
if ([obj isKindOfClass:[NSNotification class]]) {
NSNotification *notif = (NSNotification *)obj;
[msg appendFormat:@"unwrapping NSNotification named '%@' (userInfo=%@)\n\n",
[notif name],
[notif userInfo]];
obj = [notif object];
goto retryDescribe;
}
if([obj isKindOfClass:[NSView class]]) {
[msg appendString:@"View hierarchy:\n"];
[msg appendString:@"View hierarchy (parents):\n"];
id parent = obj;
while(parent) {
[msg appendFormat:@"- (class <%@>): %@, id=%@, tag=%ld\n",
[msg appendFormat:@"- %p (class <%@>): %@, id=%@, tag=%ld\n",
obj,
[obj className],
obj,
[(NSView *)obj identifier],
[(NSView *)obj tag]];
parent = [parent superview];
}
[msg appendString:@"\n"];
[msg appendString:@"View hierarchy (own children): \n"];
for (id child in [(NSView *)obj subviews]) {
[msg appendFormat:@"- %p\n",child];
}
[msg appendString:@"\n"];
}
if([obj respondsToSelector:@selector(window)]) {

0 comments on commit 5befad8

Please sign in to comment.