From 5befad85ccd6d22900942ea73f4018d71038f516 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 6 Aug 2015 23:29:50 +0200 Subject: * 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. --- Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Frameworks') diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m index d212867a..dfe4802f 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection.m @@ -424,6 +424,11 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS #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 @@ const char *SPMySQLSSLPermissibleCiphers = "DHE-RSA-AES256-SHA:AES256-SHA:DHE-RS // 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; } -- cgit v1.2.3