Skip to content


Browse files Browse the repository at this point in the history
* 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 5befad8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m
Expand Up @@ -424,6 +424,11 @@ + (NSString *)findSocketPath
#pragma mark -
#pragma mark Private API

/* CrashReporter info */
const char *__crashreporter_info__ = NULL;
asm(".desc ___crashreporter_info__, 0x10");

@implementation SPMySQLConnection (PrivateAPI)

Expand All @@ -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);
[NSException raise:NSInternalInconsistencyException format:@"Attempted to connect a connection that is not disconnected (SPMySQLConnectionState=%d).", state];
return NO;
Expand Down
21 changes: 19 additions & 2 deletions Source/SPObjectAdditions.m
Expand Up @@ -48,20 +48,37 @@ - (void)_scrollViewDidChangeBounds:(id)obj

[msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__];

[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 className],
[(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)]) {
Expand Down

0 comments on commit 5befad8

Please sign in to comment.