From bcfb674cd1ba63189eb8210a95b388c0dc2468a6 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Thu, 20 Mar 2014 17:04:11 +0100 Subject: [PATCH] oc-sogo: Print both [NSException callStackSymbols] and execinfo.h stack trace Signed-off-by: Kamen Mazdrashki --- OpenChange/MAPIStoreSOGo.m | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index 3d091bf42..73872db7e 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -76,16 +76,18 @@ sogo_backend_handle_objc_exception(NSException *e, const char *fn_name, const in { NSLog(@"[SOGo: %s:%d] - EXCEPTION: %@, reason: %@, backtrace: %@", fn_name, line_no, [e name], [e reason], [e callStackSymbols]); - if (![e callStackSymbols]) - { - void *frames[128]; - int i, len = backtrace(frames, 128); - char **symbols = backtrace_symbols(frames, len); - NSLog(@"Backtrace using execinfo.h:"); - for (i = 0; i < len; ++i) - NSLog(@"\t%s", symbols[i]); - free(symbols); - } + + // Another point of view on the stack trace + { + void *frames[128]; + int i, len = backtrace(frames, 128); + char **symbols = backtrace_symbols(frames, len); + NSLog(@"Backtrace using execinfo.h:\n"); + for (i = 0; i < len; ++i) + NSLog(@"\t%s", symbols[i]); + free(symbols); + } + if ([[e name] isEqual:@"NotImplementedException"]) { return MAPISTORE_ERR_NOT_IMPLEMENTED;