diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 5431f208e4..9f15655653 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -218,7 +218,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; [self saveSettings]; } -- (NSString *) extractAppUUIDs:(PLCrashReport *)report { +- (NSString *) extractAppUUIDs:(BITPLCrashReport *)report { NSMutableString *uuidString = [NSMutableString string]; NSArray *uuidArray = [BITCrashReportTextFormatter arrayOfAppUUIDsForCrashReport:report]; @@ -288,7 +288,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; // Called to handle a pending crash report. - (void) handleCrashReport { - PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + BITPLCrashReporter *crashReporter = [BITPLCrashReporter sharedReporter]; NSError *error = NULL; [self loadSettings]; @@ -309,14 +309,14 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; BITHockeyLog(@"ERROR: Could not load crash report: %@", error); } else { // get the startup timestamp from the crash report, and the file timestamp to calculate the timeinterval when the crash happened after startup - PLCrashReport *report = [[PLCrashReport alloc] initWithData:crashData error:&error]; + BITPLCrashReport *report = [[BITPLCrashReport alloc] initWithData:crashData error:&error]; - if ([report.applicationInfo respondsToSelector:@selector(applicationStartupTimestamp)]) { - if (report.systemInfo.timestamp && report.applicationInfo.applicationStartupTimestamp) { - _timeintervalCrashInLastSessionOccured = [report.systemInfo.timestamp timeIntervalSinceDate:report.applicationInfo.applicationStartupTimestamp]; + if ([report.processInfo respondsToSelector:@selector(processStartTime)]) { + if (report.systemInfo.timestamp && report.processInfo.processStartTime) { + _timeintervalCrashInLastSessionOccured = [report.systemInfo.timestamp timeIntervalSinceDate:report.processInfo.processStartTime]; } } - + [crashData writeToFile:[_crashesDir stringByAppendingPathComponent: cacheFilename] atomically:YES]; // write the meta file @@ -468,16 +468,9 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; if (_crashManagerStatus == BITCrashManagerStatusDisabled) return; if (!_isSetup) { - PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + BITPLCrashReporter *crashReporter = [BITPLCrashReporter sharedReporter]; NSError *error = NULL; - // Make sure the correct version of PLCrashReporter is linked - id plCrashReportReportInfoClass = NSClassFromString(@"PLCrashReportReportInfo"); - - if (!plCrashReportReportInfoClass) { - NSLog(@"[HockeySDK] ERROR: An old version of PLCrashReporter framework is linked! Please check the framework search path in the target build settings and remove references to folders that contain an older version of CrashReporter.framework and also delete these files."); - } - // Check if we previously crashed if ([crashReporter hasPendingCrashReport]) { _didCrashInLastSession = YES; @@ -544,7 +537,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; NSData *crashData = [NSData dataWithContentsOfFile:filename]; if ([crashData length] > 0) { - PLCrashReport *report = [[PLCrashReport alloc] initWithData:crashData error:&error]; + BITPLCrashReport *report = [[BITPLCrashReport alloc] initWithData:crashData error:&error]; if (report == nil) { BITHockeyLog(@"WARNING: Could not parse crash report"); @@ -559,8 +552,8 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; } NSString *crashUUID = @""; - if ([report respondsToSelector:@selector(reportInfo)]) { - crashUUID = report.reportInfo.reportGUID ?: @""; + if (report.uuidRef != NULL) { + crashUUID = (NSString *) CFBridgingRelease(CFUUIDCreateString(NULL, report.uuidRef)); } NSString *installString = bit_appAnonID() ?: @""; NSString *crashLogString = [BITCrashReportTextFormatter stringValueForCrashReport:report crashReporterKey:installString]; diff --git a/Classes/BITCrashReportTextFormatter.m b/Classes/BITCrashReportTextFormatter.m index e21477529f..601223e8d2 100644 --- a/Classes/BITCrashReportTextFormatter.m +++ b/Classes/BITCrashReportTextFormatter.m @@ -35,30 +35,23 @@ #import "BITCrashReportTextFormatter.h" -#ifndef CPU_SUBTYPE_ARM_V7S -#define CPU_SUBTYPE_ARM_V7S ((cpu_subtype_t) 11) /* Swift */ -#endif - -/** - * Sort PLCrashReportBinaryImageInfo instances by their starting address. +/* + * XXX: The ARM_V7S Mach-O CPU subtype is not defined in the Mac OS X 10.8 + * headers. */ -static NSInteger binaryImageSort(id binary1, id binary2, void *context) { - uint64_t addr1 = [binary1 imageBaseAddress]; - uint64_t addr2 = [binary2 imageBaseAddress]; - - if (addr1 < addr2) - return NSOrderedAscending; - else if (addr1 > addr2) - return NSOrderedDescending; - else - return NSOrderedSame; -} +#ifndef CPU_SUBTYPE_ARM_V7S +# define CPU_SUBTYPE_ARM_V7S 11 +#elif !TARGET_OS_IPHONE +# error CPU_SUBTYPE_ARM_V7S is now defined by the SDK. Please remove this define. +#endif @interface BITCrashReportTextFormatter (PrivateAPI) -+ (NSString *)formatStackFrame:(PLCrashReportStackFrameInfo *)frameInfo +NSInteger binaryImageSort(id binary1, id binary2, void *context); ++ (NSString *)formatStackFrame:(BITPLCrashReportStackFrameInfo *)frameInfo frameIndex:(NSUInteger)frameIndex - report:(PLCrashReport *)report; + report:(BITPLCrashReport *)report + lp64: (BOOL) lp64; @end @@ -73,408 +66,285 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { * the formatted result as a string. * * @param report The report to format. + * @param textFormat The text format to use. * * @return Returns the formatted result on success, or nil if an error occurs. */ -+ (NSString *)stringValueForCrashReport:(PLCrashReport *)report crashReporterKey:(NSString *)crashReporterKey { ++ (NSString *)stringValueForCrashReport:(BITPLCrashReport *)report crashReporterKey:(NSString *)crashReporterKey { NSMutableString* text = [NSMutableString string]; boolean_t lp64 = true; // quiesce GCC uninitialized value warning - + /* Header */ - /* Map to apple style OS nane */ - NSString *osName; - switch (report.systemInfo.operatingSystem) { - case PLCrashReportOperatingSystemMacOSX: - osName = @"Mac OS X"; - break; - case PLCrashReportOperatingSystemiPhoneOS: - osName = @"iPhone OS"; - break; - case PLCrashReportOperatingSystemiPhoneSimulator: - osName = @"Mac OS X"; - break; - default: - osName = [NSString stringWithFormat: @"Unknown (%d)", report.systemInfo.operatingSystem]; - break; - } - - /* Map to Apple-style code type, and mark whether architecture is LP64 (64-bit) */ - NSString *codeType = nil; - { - /* Attempt to derive the code type from the binary images */ - for (PLCrashReportBinaryImageInfo *image in report.images) { - /* Skip images with no specified type */ - if (image.codeType == nil) - continue; - - /* Skip unknown encodings */ - if (image.codeType.typeEncoding != PLCrashReportProcessorTypeEncodingMach) - continue; - - switch (image.codeType.type) { - case CPU_TYPE_ARM: - codeType = @"ARM"; - lp64 = false; - break; - - case CPU_TYPE_X86: - codeType = @"X86"; - lp64 = false; - break; - - case CPU_TYPE_X86_64: - codeType = @"X86-64"; - lp64 = true; - break; - - case CPU_TYPE_POWERPC: - codeType = @"PPC"; - lp64 = false; - break; - - default: - // Do nothing, handled below. - break; - } - - /* Stop immediately if code type was discovered */ - if (codeType != nil) - break; - } - - /* If we were unable to determine the code type, fall back on the legacy architecture value. */ - if (codeType == nil) { - switch (report.systemInfo.architecture) { - case PLCrashReportArchitectureARMv6: - case PLCrashReportArchitectureARMv7: - case PLCrashReportArchitectureARMv7s: - codeType = @"ARM"; - lp64 = false; - break; - case PLCrashReportArchitectureX86_32: - codeType = @"X86"; - lp64 = false; - break; - case PLCrashReportArchitectureX86_64: - codeType = @"X86-64"; - lp64 = true; - break; - case PLCrashReportArchitecturePPC: - codeType = @"PPC"; - lp64 = false; - break; - default: - codeType = [NSString stringWithFormat: @"Unknown (%d)", report.systemInfo.architecture]; - lp64 = true; - break; - } - } - } - - { - NSString *reportGUID = @"TODO"; - if ([report respondsToSelector:@selector(reportInfo)]) { - if (report.hasReportInfo && report.reportInfo.reportGUID != nil) - reportGUID = report.reportInfo.reportGUID; - } - - NSString *reporterKey = @"TODO"; - if (crashReporterKey && [crashReporterKey length] > 0) - reporterKey = crashReporterKey; - - NSString *hardwareModel = @"???"; - if (report.hasMachineInfo && report.machineInfo.modelName != nil) - hardwareModel = report.machineInfo.modelName; - - [text appendFormat: @"Incident Identifier: %@\n", reportGUID]; - [text appendFormat: @"CrashReporter Key: %@\n", reporterKey]; - [text appendFormat: @"Hardware Model: %@\n", hardwareModel]; - } - - /* Application and process info */ - { - NSString *unknownString = @"???"; - - NSString *processName = unknownString; - NSString *processId = unknownString; - NSString *processPath = unknownString; - NSString *parentProcessName = unknownString; - NSString *parentProcessId = unknownString; - - /* Process information was not available in earlier crash report versions */ - if (report.hasProcessInfo) { - /* Process Name */ - if (report.processInfo.processName != nil) - processName = report.processInfo.processName; - - /* PID */ - processId = [[NSNumber numberWithUnsignedInteger: report.processInfo.processID] stringValue]; - - /* Process Path */ - if (report.processInfo.processPath != nil) { - processPath = report.processInfo.processPath; - - /* Remove username from the path */ - processPath = [processPath stringByAbbreviatingWithTildeInPath]; - if ([[processPath substringToIndex:1] isEqualToString:@"~"]) - processPath = [NSString stringWithFormat:@"/Users/USER%@", [processPath substringFromIndex:1]]; - } - - /* Parent Process Name */ - if (report.processInfo.parentProcessName != nil) - parentProcessName = report.processInfo.parentProcessName; - - /* Parent Process ID */ - parentProcessId = [[NSNumber numberWithUnsignedInteger: report.processInfo.parentProcessID] stringValue]; - } - - [text appendFormat: @"Process: %@ [%@]\n", processName, processId]; - [text appendFormat: @"Path: %@\n", processPath]; - [text appendFormat: @"Identifier: %@\n", report.applicationInfo.applicationIdentifier]; - [text appendFormat: @"Version: %@\n", report.applicationInfo.applicationVersion]; - [text appendFormat: @"Code Type: %@\n", codeType]; - [text appendFormat: @"Parent Process: %@ [%@]\n", parentProcessName, parentProcessId]; - } - - [text appendString: @"\n"]; - - /* System info */ - { - NSString *osBuild = @"???"; - if (report.systemInfo.operatingSystemBuild != nil) - osBuild = report.systemInfo.operatingSystemBuild; - - NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; - NSDateFormatter *rfc3339Formatter = [[NSDateFormatter alloc] init]; - [rfc3339Formatter setLocale:enUSPOSIXLocale]; - [rfc3339Formatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; - [rfc3339Formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; - - [text appendFormat: @"Date/Time: %@\n", [rfc3339Formatter stringFromDate:report.systemInfo.timestamp]]; - [text appendFormat: @"OS Version: %@ %@ (%@)\n", osName, report.systemInfo.operatingSystemVersion, osBuild]; - [text appendFormat: @"Report Version: 104\n"]; - } - - [text appendString: @"\n"]; - - /* Exception code */ - [text appendFormat: @"Exception Type: %@\n", report.signalInfo.name]; - [text appendFormat: @"Exception Codes: %@ at 0x%" PRIx64 "\n", report.signalInfo.code, report.signalInfo.address]; - - for (PLCrashReportThreadInfo *thread in report.threads) { - if (thread.crashed) { - [text appendFormat: @"Crashed Thread: %ld\n", (long) thread.threadNumber]; - break; - } - } - - [text appendString: @"\n"]; - - /* Uncaught Exception */ - if (report.hasExceptionInfo) { - [text appendFormat: @"Application Specific Information:\n"]; - [text appendFormat: @"*** Terminating app due to uncaught exception '%@', reason: '%@'\n", - report.exceptionInfo.exceptionName, report.exceptionInfo.exceptionReason]; - - [text appendString: @"\n"]; - } + /* Map to apple style OS nane */ + NSString *osName; + switch (report.systemInfo.operatingSystem) { + case PLCrashReportOperatingSystemMacOSX: + osName = @"Mac OS X"; + break; + case PLCrashReportOperatingSystemiPhoneOS: + osName = @"iPhone OS"; + break; + case PLCrashReportOperatingSystemiPhoneSimulator: + osName = @"Mac OS X"; + break; + default: + osName = [NSString stringWithFormat: @"Unknown (%d)", report.systemInfo.operatingSystem]; + break; + } - /* If an exception stack trace is available, output a pseudo-thread to provide the frame info */ - if (report.exceptionInfo != nil && report.exceptionInfo.stackFrames != nil && [report.exceptionInfo.stackFrames count] > 0) { - PLCrashReportExceptionInfo *exception = report.exceptionInfo; - - /* Write out the frames */ - NSUInteger numberBlankStackFrames = 0; - - for (NSUInteger frame_idx = 0; frame_idx < [exception.stackFrames count]; frame_idx++) { - PLCrashReportStackFrameInfo *frameInfo = [exception.stackFrames objectAtIndex: frame_idx]; - NSString *formattedStackFrame = [self formatStackFrame: frameInfo frameIndex: frame_idx - numberBlankStackFrames report: report]; - if (formattedStackFrame) { - if (frame_idx - numberBlankStackFrames == 0) { - /* Create the pseudo-thread header. We use the named thread format to mark this thread */ - [text appendString: @"Last Exception Backtrace:\n"]; - } - - [text appendString: formattedStackFrame]; - } else { - numberBlankStackFrames++; - } - } - [text appendString: @"\n\n"]; - } - - /* Threads */ - PLCrashReportThreadInfo *crashed_thread = nil; - NSInteger maxThreadNum = 0; - for (PLCrashReportThreadInfo *thread in report.threads) { - - /* Write out the frames */ - NSUInteger numberBlankStackFrames = 0; - - for (NSUInteger frame_idx = 0; frame_idx < [thread.stackFrames count]; frame_idx++) { - PLCrashReportStackFrameInfo *frameInfo = [thread.stackFrames objectAtIndex: frame_idx]; - NSString *formattedStackFrame = [self formatStackFrame: frameInfo frameIndex: frame_idx report: report]; - if (formattedStackFrame) { - if (frame_idx - numberBlankStackFrames == 0) { - /* Create the thread header. */ - if (thread.crashed) { - [text appendFormat: @"Thread %ld Crashed:\n", (long) thread.threadNumber]; - crashed_thread = thread; - } else { - [text appendFormat: @"Thread %ld:\n", (long) thread.threadNumber]; - } - } - - [text appendString: formattedStackFrame]; - } else { - numberBlankStackFrames++; - } - } - [text appendString: @"\n"]; - - /* Track the highest thread number */ - maxThreadNum = MAX(maxThreadNum, thread.threadNumber); - } - - /* Registers */ - if (crashed_thread != nil) { - [text appendFormat: @"Thread %ld crashed with %@ Thread State:\n", (long) crashed_thread.threadNumber, codeType]; - - int regColumn = 0; - for (PLCrashReportRegisterInfo *reg in crashed_thread.registers) { - NSString *reg_fmt; - - /* Use 32-bit or 64-bit fixed width format for the register values */ - if (lp64) - reg_fmt = @"%6s: 0x%016" PRIx64 " "; - else - reg_fmt = @"%6s: 0x%08" PRIx64 " "; - - /* Remap register names to match Apple's crash reports */ - NSString *regName = reg.registerName; - if (report.machineInfo != nil && report.machineInfo.processorInfo.typeEncoding == PLCrashReportProcessorTypeEncodingMach) { - PLCrashReportProcessorInfo *pinfo = report.machineInfo.processorInfo; - cpu_type_t arch_type = pinfo.type & ~CPU_ARCH_MASK; - - /* Apple uses 'ip' rather than 'r12' on ARM */ - if (arch_type == CPU_TYPE_ARM && [regName isEqual: @"r12"]) { - regName = @"ip"; - } - } - [text appendFormat: reg_fmt, [regName UTF8String], reg.registerValue]; - - regColumn++; - if (regColumn == 4) { - [text appendString: @"\n"]; - regColumn = 0; - } - } - - if (regColumn != 0) - [text appendString: @"\n"]; - - [text appendString: @"\n"]; - } - - /* Images. The iPhone crash report format sorts these in ascending order, by the base address */ - [text appendString: @"Binary Images:\n"]; - for (PLCrashReportBinaryImageInfo *imageInfo in [report.images sortedArrayUsingFunction: binaryImageSort context: nil]) { - NSString *uuid; - /* Fetch the UUID if it exists */ - if (imageInfo.hasImageUUID) - uuid = imageInfo.imageUUID; - else - uuid = @"???"; - - /* Determine the architecture string */ - NSString *archName = @"???"; - if (imageInfo.codeType != nil && imageInfo.codeType.typeEncoding == PLCrashReportProcessorTypeEncodingMach) { - switch (imageInfo.codeType.type) { - case CPU_TYPE_ARM: - /* Apple includes subtype for ARM binaries. */ - switch (imageInfo.codeType.subtype) { - case CPU_SUBTYPE_ARM_V6: - archName = @"armv6"; - break; - - case CPU_SUBTYPE_ARM_V7: - archName = @"armv7"; - break; - - case CPU_SUBTYPE_ARM_V7S: - archName = @"armv7s"; - break; - - default: - archName = @"arm-unknown"; - break; - } - break; - - case CPU_TYPE_X86: - archName = @"i386"; - break; - - case CPU_TYPE_X86_64: - archName = @"x86_64"; - break; - - case CPU_TYPE_POWERPC: - archName = @"powerpc"; - break; - - default: - // Use the default archName value (initialized above). - break; - } - } - - /* Determine if this is the main executable */ - NSString *binaryDesignator = @" "; - if ([imageInfo.imageName isEqual: report.processInfo.processPath]) - binaryDesignator = @"+"; - - /* base_address - terminating_address [designator]file_name arch file_path */ - NSString *fmt = nil; - if (lp64) { - fmt = @"%18#" PRIx64 " - %18#" PRIx64 " %@%@ %@ <%@> %@\n"; - } else { - fmt = @"%10#" PRIx64 " - %10#" PRIx64 " %@%@ %@ <%@> %@\n"; - } + /* Map to Apple-style code type, and mark whether architecture is LP64 (64-bit) */ + NSString *codeType = nil; + { + /* Attempt to derive the code type from the binary images */ + for (BITPLCrashReportBinaryImageInfo *image in report.images) { + /* Skip images with no specified type */ + if (image.codeType == nil) + continue; - /* Remove username from the image path */ - NSString *imageName = [imageInfo.imageName stringByAbbreviatingWithTildeInPath]; - if ([[imageName substringToIndex:1] isEqualToString:@"~"]) - imageName = [NSString stringWithFormat:@"/Users/USER%@", [imageName substringFromIndex:1]]; - - [text appendFormat: fmt, - imageInfo.imageBaseAddress, - imageInfo.imageBaseAddress + (MAX(1, imageInfo.imageSize) - 1), // The Apple format uses an inclusive range - binaryDesignator, - [imageInfo.imageName lastPathComponent], - archName, - uuid, - imageName]; + /* Skip unknown encodings */ + if (image.codeType.typeEncoding != PLCrashReportProcessorTypeEncodingMach) + continue; + + switch (image.codeType.type) { + case CPU_TYPE_ARM: + codeType = @"ARM"; + lp64 = false; + break; + + case CPU_TYPE_X86: + codeType = @"X86"; + lp64 = false; + break; + + case CPU_TYPE_X86_64: + codeType = @"X86-64"; + lp64 = true; + break; + + case CPU_TYPE_POWERPC: + codeType = @"PPC"; + lp64 = false; + break; + + default: + // Do nothing, handled below. + break; + } + + /* Stop immediately if code type was discovered */ + if (codeType != nil) + break; } - - return text; -} - -/** - * Returns an array of app UUIDs and their architecture - * As a dictionary for each element - * - * @param report The report to format. - * - * @return Returns the formatted result on success, or nil if an error occurs. - */ -+ (NSArray *)arrayOfAppUUIDsForCrashReport:(PLCrashReport *)report { - NSMutableArray* appUUIDs = [NSMutableArray array]; + /* If we were unable to determine the code type, fall back on the legacy architecture value. */ + if (codeType == nil) { + switch (report.systemInfo.architecture) { + case PLCrashReportArchitectureARMv6: + case PLCrashReportArchitectureARMv7: + codeType = @"ARM"; + lp64 = false; + break; + case PLCrashReportArchitectureX86_32: + codeType = @"X86"; + lp64 = false; + break; + case PLCrashReportArchitectureX86_64: + codeType = @"X86-64"; + lp64 = true; + break; + case PLCrashReportArchitecturePPC: + codeType = @"PPC"; + lp64 = false; + break; + default: + codeType = [NSString stringWithFormat: @"Unknown (%d)", report.systemInfo.architecture]; + lp64 = true; + break; + } + } + } + + { + NSString *reporterKey = @"???"; + if (crashReporterKey && [crashReporterKey length] > 0) + reporterKey = crashReporterKey; + + NSString *hardwareModel = @"???"; + if (report.hasMachineInfo && report.machineInfo.modelName != nil) + hardwareModel = report.machineInfo.modelName; + + NSString *incidentIdentifier = @"???"; + if (report.uuidRef != NULL) { + incidentIdentifier = (NSString *) CFBridgingRelease(CFUUIDCreateString(NULL, report.uuidRef)); + } + + [text appendFormat: @"Incident Identifier: %@\n", incidentIdentifier]; + [text appendFormat: @"CrashReporter Key: %@\n", reporterKey]; + [text appendFormat: @"Hardware Model: %@\n", hardwareModel]; + } + + /* Application and process info */ + { + NSString *unknownString = @"???"; + + NSString *processName = unknownString; + NSString *processId = unknownString; + NSString *processPath = unknownString; + NSString *parentProcessName = unknownString; + NSString *parentProcessId = unknownString; + + /* Process information was not available in earlier crash report versions */ + if (report.hasProcessInfo) { + /* Process Name */ + if (report.processInfo.processName != nil) + processName = report.processInfo.processName; + + /* PID */ + processId = [[NSNumber numberWithUnsignedInteger: report.processInfo.processID] stringValue]; + + /* Process Path */ + if (report.processInfo.processPath != nil) { + processPath = report.processInfo.processPath; + + /* Remove username from the path */ + processPath = [processPath stringByAbbreviatingWithTildeInPath]; + if ([[processPath substringToIndex:1] isEqualToString:@"~"]) + processPath = [NSString stringWithFormat:@"/Users/USER%@", [processPath substringFromIndex:1]]; + } + + /* Parent Process Name */ + if (report.processInfo.parentProcessName != nil) + parentProcessName = report.processInfo.parentProcessName; + + /* Parent Process ID */ + parentProcessId = [@(report.processInfo.parentProcessID) stringValue]; + } + + [text appendFormat: @"Process: %@ [%@]\n", processName, processId]; + [text appendFormat: @"Path: %@\n", processPath]; + [text appendFormat: @"Identifier: %@\n", report.applicationInfo.applicationIdentifier]; + [text appendFormat: @"Version: %@\n", report.applicationInfo.applicationVersion]; + [text appendFormat: @"Code Type: %@\n", codeType]; + [text appendFormat: @"Parent Process: %@ [%@]\n", parentProcessName, parentProcessId]; + } + + [text appendString: @"\n"]; + + /* System info */ + { + NSString *osBuild = @"???"; + if (report.systemInfo.operatingSystemBuild != nil) + osBuild = report.systemInfo.operatingSystemBuild; + + [text appendFormat: @"Date/Time: %@\n", report.systemInfo.timestamp]; + [text appendFormat: @"OS Version: %@ %@ (%@)\n", osName, report.systemInfo.operatingSystemVersion, osBuild]; + [text appendFormat: @"Report Version: 104\n"]; + } + + [text appendString: @"\n"]; + + /* Exception code */ + [text appendFormat: @"Exception Type: %@\n", report.signalInfo.name]; + [text appendFormat: @"Exception Codes: %@ at 0x%" PRIx64 "\n", report.signalInfo.code, report.signalInfo.address]; + + for (BITPLCrashReportThreadInfo *thread in report.threads) { + if (thread.crashed) { + [text appendFormat: @"Crashed Thread: %ld\n", (long) thread.threadNumber]; + break; + } + } + + [text appendString: @"\n"]; + + /* Uncaught Exception */ + if (report.hasExceptionInfo) { + [text appendFormat: @"Application Specific Information:\n"]; + [text appendFormat: @"*** Terminating app due to uncaught exception '%@', reason: '%@'\n", + report.exceptionInfo.exceptionName, report.exceptionInfo.exceptionReason]; + + [text appendString: @"\n"]; + } + + /* If an exception stack trace is available, output an Apple-compatible backtrace. */ + if (report.exceptionInfo != nil && report.exceptionInfo.stackFrames != nil && [report.exceptionInfo.stackFrames count] > 0) { + BITPLCrashReportExceptionInfo *exception = report.exceptionInfo; + + /* Create the header. */ + [text appendString: @"Last Exception Backtrace:\n"]; + + /* Write out the frames. In raw reports, Apple writes this out as a simple list of PCs. In the minimally + * post-processed report, Apple writes this out as full frame entries. We use the latter format. */ + for (NSUInteger frame_idx = 0; frame_idx < [exception.stackFrames count]; frame_idx++) { + BITPLCrashReportStackFrameInfo *frameInfo = [exception.stackFrames objectAtIndex: frame_idx]; + [text appendString: [self formatStackFrame: frameInfo frameIndex: frame_idx report: report lp64: lp64]]; + } + [text appendString: @"\n"]; + } + + /* Threads */ + BITPLCrashReportThreadInfo *crashed_thread = nil; + NSInteger maxThreadNum = 0; + for (BITPLCrashReportThreadInfo *thread in report.threads) { + if (thread.crashed) { + [text appendFormat: @"Thread %ld Crashed:\n", (long) thread.threadNumber]; + crashed_thread = thread; + } else { + [text appendFormat: @"Thread %ld:\n", (long) thread.threadNumber]; + } + for (NSUInteger frame_idx = 0; frame_idx < [thread.stackFrames count]; frame_idx++) { + BITPLCrashReportStackFrameInfo *frameInfo = [thread.stackFrames objectAtIndex: frame_idx]; + [text appendString: [self formatStackFrame: frameInfo frameIndex: frame_idx report: report lp64: lp64]]; + } + [text appendString: @"\n"]; + + /* Track the highest thread number */ + maxThreadNum = MAX(maxThreadNum, thread.threadNumber); + } + + /* Registers */ + if (crashed_thread != nil) { + [text appendFormat: @"Thread %ld crashed with %@ Thread State:\n", (long) crashed_thread.threadNumber, codeType]; + + int regColumn = 0; + for (BITPLCrashReportRegisterInfo *reg in crashed_thread.registers) { + NSString *reg_fmt; + + /* Use 32-bit or 64-bit fixed width format for the register values */ + if (lp64) + reg_fmt = @"%6s: 0x%016" PRIx64 " "; + else + reg_fmt = @"%6s: 0x%08" PRIx64 " "; + + /* Remap register names to match Apple's crash reports */ + NSString *regName = reg.registerName; + if (report.machineInfo != nil && report.machineInfo.processorInfo.typeEncoding == PLCrashReportProcessorTypeEncodingMach) { + PLCrashReportProcessorInfo *pinfo = report.machineInfo.processorInfo; + cpu_type_t arch_type = pinfo.type & ~CPU_ARCH_MASK; + + /* Apple uses 'ip' rather than 'r12' on ARM */ + if (arch_type == CPU_TYPE_ARM && [regName isEqual: @"r12"]) { + regName = @"ip"; + } + } + [text appendFormat: reg_fmt, [regName UTF8String], reg.registerValue]; + + regColumn++; + if (regColumn == 4) { + [text appendString: @"\n"]; + regColumn = 0; + } + } + + if (regColumn != 0) + [text appendString: @"\n"]; + + [text appendString: @"\n"]; + } /* Images. The iPhone crash report format sorts these in ascending order, by the base address */ - for (PLCrashReportBinaryImageInfo *imageInfo in [report.images sortedArrayUsingFunction: binaryImageSort context: nil]) { + [text appendString: @"Binary Images:\n"]; + for (BITPLCrashReportBinaryImageInfo *imageInfo in [report.images sortedArrayUsingFunction: binaryImageSort context: nil]) { NSString *uuid; /* Fetch the UUID if it exists */ if (imageInfo.hasImageUUID) @@ -500,7 +370,105 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { case CPU_SUBTYPE_ARM_V7S: archName = @"armv7s"; break; + + default: + archName = @"arm-unknown"; + break; + } + break; + + case CPU_TYPE_X86: + archName = @"i386"; + break; + + case CPU_TYPE_X86_64: + archName = @"x86_64"; + break; + + case CPU_TYPE_POWERPC: + archName = @"powerpc"; + break; + + default: + // Use the default archName value (initialized above). + break; + } + } + + /* Determine if this is the main executable or an app specific framework*/ + NSString *binaryDesignator = @" "; + NSString *imagePath = [imageInfo.imageName stringByStandardizingPath]; + NSString *appBundleContentsPath = [[report.processInfo.processPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; + + if ([imagePath isEqual: report.processInfo.processPath] || [imagePath hasPrefix:appBundleContentsPath]) + binaryDesignator = @"+"; + + /* base_address - terminating_address [designator]file_name arch file_path */ + NSString *fmt = nil; + if (lp64) { + fmt = @"%18#" PRIx64 " - %18#" PRIx64 " %@%@ %@ <%@> %@\n"; + } else { + fmt = @"%10#" PRIx64 " - %10#" PRIx64 " %@%@ %@ <%@> %@\n"; + } + + /* Remove username from the image path */ + NSString *imageName = [imageInfo.imageName stringByAbbreviatingWithTildeInPath]; + if ([[imageName substringToIndex:1] isEqualToString:@"~"]) + imageName = [NSString stringWithFormat:@"/Users/USER%@", [imageName substringFromIndex:1]]; + + [text appendFormat: fmt, + imageInfo.imageBaseAddress, + imageInfo.imageBaseAddress + (MAX(1, imageInfo.imageSize) - 1), // The Apple format uses an inclusive range + binaryDesignator, + [imageInfo.imageName lastPathComponent], + archName, + uuid, + imageName]; + } + + + return text; +} +/** + * Returns an array of app UUIDs and their architecture + * As a dictionary for each element + * + * @param report The report to format. + * + * @return Returns the formatted result on success, or nil if an error occurs. + */ ++ (NSArray *)arrayOfAppUUIDsForCrashReport:(BITPLCrashReport *)report { + NSMutableArray* appUUIDs = [NSMutableArray array]; + + /* Images. The iPhone crash report format sorts these in ascending order, by the base address */ + for (BITPLCrashReportBinaryImageInfo *imageInfo in [report.images sortedArrayUsingFunction: binaryImageSort context: nil]) { + NSString *uuid; + /* Fetch the UUID if it exists */ + if (imageInfo.hasImageUUID) + uuid = imageInfo.imageUUID; + else + uuid = @"???"; + + /* Determine the architecture string */ + NSString *archName = @"???"; + if (imageInfo.codeType != nil && imageInfo.codeType.typeEncoding == PLCrashReportProcessorTypeEncodingMach) { + switch (imageInfo.codeType.type) { + case CPU_TYPE_ARM: + /* Apple includes subtype for ARM binaries. */ + switch (imageInfo.codeType.subtype) { + case CPU_SUBTYPE_ARM_V6: + archName = @"armv6"; + break; + + case CPU_SUBTYPE_ARM_V7: + archName = @"armv7"; + break; + + case CPU_SUBTYPE_ARM_V7S: + archName = @"armv7s"; + break; + default: archName = @"arm-unknown"; break; @@ -527,7 +495,7 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { /* Determine if this is the app executable or app specific framework */ NSString *imagePath = [imageInfo.imageName stringByStandardizingPath]; - NSString *appBundleContentsPath = [[report.processInfo.processPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; + NSString *appBundleContentsPath = [[report.processInfo.processPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; NSString *imageType = @""; if ([imageInfo.imageName isEqual: report.processInfo.processPath]) { @@ -537,14 +505,14 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { } if ([imagePath isEqual: report.processInfo.processPath] || [imagePath hasPrefix:appBundleContentsPath]) { - [appUUIDs addObject:[NSDictionary dictionaryWithObjectsAndKeys:uuid, kBITBinaryImageKeyUUID, archName, kBITBinaryImageKeyArch, imageType, kBITBinaryImageKeyType, nil]]; + [appUUIDs addObject:@{kBITBinaryImageKeyUUID: uuid, kBITBinaryImageKeyArch: archName, kBITBinaryImageKeyType: imageType}]; } } return appUUIDs; } - + @end @@ -557,75 +525,104 @@ static NSInteger binaryImageSort(id binary1, id binary2, void *context) { * @param frameInfo The stack frame to format * @param frameIndex The frame's index * @param report The report from which this frame was acquired. + * @param lp64 If YES, the report was generated by an LP64 system. * * @return Returns a formatted frame line. */ -+ (NSString *)formatStackFrame: (PLCrashReportStackFrameInfo *) frameInfo ++ (NSString *)formatStackFrame: (BITPLCrashReportStackFrameInfo *) frameInfo frameIndex: (NSUInteger) frameIndex - report: (PLCrashReport *) report + report: (BITPLCrashReport *) report + lp64: (BOOL) lp64 { - /* Base image address containing instrumention pointer, offset of the IP from that base - * address, and the associated image name */ - uint64_t baseAddress = 0x0; - uint64_t pcOffset = 0x0; - NSString *imageName = @"\?\?\?"; - NSString *symbol = nil; - - PLCrashReportBinaryImageInfo *imageInfo = [report imageForAddress: frameInfo.instructionPointer]; - if (imageInfo != nil) { - imageName = [imageInfo.imageName lastPathComponent]; - baseAddress = imageInfo.imageBaseAddress; - pcOffset = frameInfo.instructionPointer - imageInfo.imageBaseAddress; - NSString *imagePath = [imageInfo.imageName stringByStandardizingPath]; - NSString *appBundleContentsPath = [[report.processInfo.processPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; - - if ([frameInfo respondsToSelector:@selector(symbolName)]) { - if (![imagePath isEqual: report.processInfo.processPath] && ![imagePath hasPrefix:appBundleContentsPath]) { - symbol = frameInfo.symbolName; - pcOffset = frameInfo.instructionPointer - frameInfo.symbolStart; - } - } - } + /* Base image address containing instrumention pointer, offset of the IP from that base + * address, and the associated image name */ + uint64_t baseAddress = 0x0; + uint64_t pcOffset = 0x0; + NSString *imageName = @"\?\?\?"; + NSString *symbolString = nil; - /* The frame has nothing useful, so return nil so it can be filtered out */ - if (frameInfo.instructionPointer == 0 && baseAddress == 0 && pcOffset == 0) { - return nil; + BITPLCrashReportBinaryImageInfo *imageInfo = [report imageForAddress: frameInfo.instructionPointer]; + if (imageInfo != nil) { + imageName = [imageInfo.imageName lastPathComponent]; + baseAddress = imageInfo.imageBaseAddress; + pcOffset = frameInfo.instructionPointer - imageInfo.imageBaseAddress; + } + + /* Make sure UTF8/16 characters are handled correctly */ + NSInteger offset = 0; + NSInteger index = 0; + for (index = 0; index < [imageName length]; index++) { + NSRange range = [imageName rangeOfComposedCharacterSequenceAtIndex:index]; + if (range.length > 1) { + offset += range.length - 1; + index += range.length - 1; + } + if (index > 32) { + imageName = [NSString stringWithFormat:@"%@... ", [imageName substringToIndex:index - 1]]; + index += 3; + break; + } + } + if (index-offset < 36) { + imageName = [imageName stringByPaddingToLength:36+offset withString:@" " startingAtIndex:0]; + } + + /* If symbol info is available, the format used in Apple's reports is Sym + OffsetFromSym. Otherwise, + * the format used is imageBaseAddress + offsetToIP */ + NSString *imagePath = [imageInfo.imageName stringByStandardizingPath]; + NSString *appBundleContentsPath = [[report.processInfo.processPath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent]; + + if (frameInfo.symbolInfo != nil && + ![imagePath isEqual: report.processInfo.processPath] && + ![imagePath hasPrefix:appBundleContentsPath]) { + NSString *symbolName = frameInfo.symbolInfo.symbolName; + + /* Apple strips the _ symbol prefix in their reports. Only OS X makes use of an + * underscore symbol prefix by default. */ + if ([symbolName rangeOfString: @"_"].location == 0 && [symbolName length] > 1) { + switch (report.systemInfo.operatingSystem) { + case PLCrashReportOperatingSystemMacOSX: + case PLCrashReportOperatingSystemiPhoneOS: + case PLCrashReportOperatingSystemiPhoneSimulator: + symbolName = [symbolName substringFromIndex: 1]; + break; + + default: + NSLog(@"Symbol prefix rules are unknown for this OS!"); + break; + } } - /* Make sure UTF8/16 characters are handled correctly */ - NSInteger offset = 0; - NSUInteger index = 0; - for (index = 0; index < [imageName length]; index++) { - NSRange range = [imageName rangeOfComposedCharacterSequenceAtIndex:index]; - if (range.length > 1) { - offset += range.length - 1; - index += range.length - 1; - } - if (index > 32) { - imageName = [NSString stringWithFormat:@"%@... ", [imageName substringToIndex:index - 1]]; - index += 3; - break; - } - } - if (index-offset < 36) { - imageName = [imageName stringByPaddingToLength:36+offset withString:@" " startingAtIndex:0]; - } + + uint64_t symOffset = frameInfo.instructionPointer - frameInfo.symbolInfo.startAddress; + symbolString = [NSString stringWithFormat: @"%@ + %" PRId64, symbolName, symOffset]; + } else { + symbolString = [NSString stringWithFormat: @"0x%" PRIx64 " + %" PRId64, baseAddress, pcOffset]; + } - if (symbol) { - return [NSString stringWithFormat: @"%-4ld%@0x%08" PRIx64 " %@ + %" PRId64 "\n", - (long) frameIndex, - imageName, - frameInfo.instructionPointer, - symbol, - pcOffset]; - } else { - return [NSString stringWithFormat: @"%-4ld%@0x%08" PRIx64 " 0x%" PRIx64 " + %" PRId64 "\n", - (long) frameIndex, - imageName, - frameInfo.instructionPointer, - baseAddress, - pcOffset]; - } + /* Note that width specifiers are ignored for %@, but work for C strings. + * UTF-8 is not correctly handled with %s (it depends on the system encoding), but + * UTF-16 is supported via %S, so we use it here */ + return [NSString stringWithFormat: @"%-4ld%-35S 0x%0*" PRIx64 " %@\n", + (long) frameIndex, + (const uint16_t *)[imageName cStringUsingEncoding: NSUTF16StringEncoding], + lp64 ? 16 : 8, frameInfo.instructionPointer, + symbolString]; +} + +/** + * Sort PLCrashReportBinaryImageInfo instances by their starting address. + */ +NSInteger binaryImageSort(id binary1, id binary2, void *context) { + uint64_t addr1 = [binary1 imageBaseAddress]; + uint64_t addr2 = [binary2 imageBaseAddress]; + + if (addr1 < addr2) + return NSOrderedAscending; + else if (addr1 > addr2) + return NSOrderedDescending; + else + return NSOrderedSame; } @end diff --git a/Classes/BITHockeyManager.h b/Classes/BITHockeyManager.h index 813de922e0..9ff38fd787 100644 --- a/Classes/BITHockeyManager.h +++ b/Classes/BITHockeyManager.h @@ -55,7 +55,9 @@ `BITCrashManager`: Shows an alert on startup asking the user if he/she agrees on sending the crash report, if `[BITCrashManager crashManagerStatus]` is set to `BITCrashManagerStatusAlwaysAsk` (default) `BITUpdateManager`: Is automatically deactivated when the SDK detects it is running from a build distributed via the App Store. Otherwise if it is not deactivated manually, it will show an alert after startup informing the user about a pending update, if one is available. If the user then decides to view the update another screen is presented with further details and an option to install the update. `BITFeedbackManager`: If this module is deactivated or the user interface is nowhere added into the app, this module will not do anything. It will not fetch the server for data or show any user interface. If it is integrated, activated, and the user already used it to provide feedback, it will show an alert after startup if a new answer has been received from the server with the option to view it. - + + @warning The SDK is **NOT** thread safe and has to be set up on the main thread! + @warning You should **NOT** change any module configuration after calling `startManager`! Example: diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index d8bb598f58..0529f2cfcb 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -152,6 +152,8 @@ - (void)startManager { if (!_validAppIdentifier) return; + if (![self isSetUpOnMainThread]) return; + BITHockeyLog(@"INFO: Starting HockeyManager"); _startManagerIsInvoked = YES; @@ -242,6 +244,22 @@ #pragma mark - Private Instance Methods +- (BOOL)isSetUpOnMainThread { + NSString *errorString = @"ERROR: This SDK has to be setup on the main thread!"; + + if (!NSThread.isMainThread) { + if (self.isAppStoreEnvironment) { + BITHockeyLog(@"%@", errorString); + } else { + NSAssert(NSThread.isMainThread, errorString); + } + + return NO; + } + + return YES; +} + - (BOOL)shouldUseLiveIdentifier { BOOL delegateResult = NO; if ([_delegate respondsToSelector:@selector(shouldUseLiveIdentifierForHockeyManager:)]) { @@ -254,6 +272,8 @@ - (void)initializeModules { _validAppIdentifier = [self checkValidityOfAppIdentifier:_appIdentifier]; + if (![self isSetUpOnMainThread]) return; + _startManagerIsInvoked = NO; if (_validAppIdentifier) { diff --git a/Vendor/CrashReporter.framework/Versions/A/CrashReporter b/Vendor/CrashReporter.framework/Versions/A/CrashReporter index 891396280b..8932995451 100644 Binary files a/Vendor/CrashReporter.framework/Versions/A/CrashReporter and b/Vendor/CrashReporter.framework/Versions/A/CrashReporter differ diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/CrashReporter.h b/Vendor/CrashReporter.framework/Versions/A/Headers/CrashReporter.h index 25fe9279fd..778d7f9658 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/CrashReporter.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/CrashReporter.h @@ -32,6 +32,10 @@ #import #endif +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import "PLCrashReporterNamespace.h" + #import "PLCrashReporter.h" #import "PLCrashReport.h" #import "PLCrashReportTextFormatter.h" @@ -227,3 +231,64 @@ typedef enum { * * @sa PLCrashReporter::setCrashCallbacks: */ + +/** + * @page mach_exceptions Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. Unfortunately, there are a number + * of crash states that can only be handled with Mach exception handlers: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * After filing a request with Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing + * a Mach Exception handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited private API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately (TODO - define + * configuration API). + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private API; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior. + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES. + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h new file mode 100644 index 0000000000..3a70e6044f --- /dev/null +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h @@ -0,0 +1,58 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_ASYNC_SIGNAL_INFO_H +#define PLCRASH_ASYNC_SIGNAL_INFO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @internal + * + * @defgroup plcrash_async_signal_info Signal Information + * @ingroup plcrash_async + * + * Provides mapping of signal number and code to strings. + * + * @{ + */ + +const char *plcrash_async_signal_signame (int signal); +const char *plcrash_async_signal_sigcode (int signal, int si_code); + +/** + * @} plcrash_async_signal_info + */ + +#ifdef __cplusplus +} +#endif + +#endif /* PLCRASH_ASYNC_SIGNAL_INFO_H */ \ No newline at end of file diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h index 0ede807ef9..792819b4a8 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h @@ -1,7 +1,7 @@ /* * Author: Landon Fuller * - * Copyright (c) 2008-2010 Plausible Labs Cooperative, Inc. + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person @@ -27,15 +27,19 @@ */ #import -#import "PLCrashReportSystemInfo.h" -#import "PLCrashReportMachineInfo.h" + #import "PLCrashReportApplicationInfo.h" -#import "PLCrashReportProcessInfo.h" -#import "PLCrashReportSignalInfo.h" -#import "PLCrashReportThreadInfo.h" #import "PLCrashReportBinaryImageInfo.h" #import "PLCrashReportExceptionInfo.h" -#import "PLCrashReportReportInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" /** * @ingroup constants @@ -79,9 +83,6 @@ typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; @private /** Private implementation variables (used to hide the underlying protobuf parser) */ _PLCrashReportDecoder *_decoder; - - /** Report info (may be nil) */ - PLCrashReportReportInfo *_reportInfo; /** System info */ PLCrashReportSystemInfo *_systemInfo; @@ -106,6 +107,9 @@ typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; /** Exception information (may be nil) */ PLCrashReportExceptionInfo *_exceptionInfo; + + /** Report UUID */ + CFUUIDRef _uuid; } - (id) initWithData: (NSData *) encodedData error: (NSError **) outError; @@ -171,13 +175,10 @@ typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; @property(nonatomic, readonly) PLCrashReportExceptionInfo *exceptionInfo; /** - * YES if report information is available. + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. */ -@property(nonatomic, readonly) BOOL hasReportInfo; - -/** - * Crash report information. - */ -@property(nonatomic, readonly) PLCrashReportReportInfo *reportInfo; +@property(nonatomic, readonly) CFUUIDRef uuidRef; @end diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h index 3f46cb3905..0f84c89592 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h @@ -1,7 +1,7 @@ /* * Author: Landon Fuller * - * Copyright (c) 2008-2012 Plausible Labs Cooperative, Inc. + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person @@ -35,18 +35,10 @@ /** Application version */ NSString *_applicationVersion; - - /** Application short version */ - NSString *_applicationShortVersion; - - /** Application startup timestamp */ - NSDate *_applicationStartupTimestamp; } - (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier - applicationVersion: (NSString *) applicationVersion - applicationShortVersion: (NSString *) applicationShortVersion - applicationStartupTimestamp: (NSDate *) applicationStartupTimestamp; + applicationVersion: (NSString *) applicationVersion; /** * The application identifier. This is usually the application's CFBundleIdentifier value. @@ -58,14 +50,4 @@ */ @property(nonatomic, readonly) NSString *applicationVersion; -/** - * The application short version. This is usually the application's CFBundleShortVersionString value. - */ -@property(nonatomic, readonly) NSString *applicationShortVersion; - -/** - * The application startup timestamp. This is set when initializing the crash reporter. - */ -@property(nonatomic, readonly) NSDate *applicationStartupTimestamp; - @end diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h index a32a243f63..77c2029fd0 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h @@ -1,7 +1,7 @@ /* * Author: Landon Fuller * - * Copyright (c) 2008-2010 Plausible Labs Cooperative, Inc. + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h index 58c4baa5f5..4d0597c1df 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h @@ -1,7 +1,7 @@ /* * Author: Landon Fuller * - * Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc. + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person @@ -53,7 +53,7 @@ /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ @property(nonatomic, readonly) NSString *modelName; -/** The processor type. */ +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ @property(nonatomic, readonly) PLCrashReportProcessorInfo *processorInfo; /* diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h index bb58641f07..f1bd05116d 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h @@ -2,7 +2,7 @@ * Author: Damian Morris * * Copyright (c) 2010 MOSO Corporation, Pty Ltd. - * Copyright (c) 2010 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. * * All rights reserved. * @@ -40,7 +40,11 @@ /** Process path */ NSString* _processPath; - + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + NSDate *_processStartTime; + /** Parent process name */ NSString *_parentProcessName; @@ -54,6 +58,7 @@ - (id) initWithProcessName: (NSString *) processName processID: (NSUInteger) processID processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime parentProcessName: (NSString *) parentProcessName parentProcessID: (NSUInteger) parentProcessID native: (BOOL) native; @@ -75,6 +80,12 @@ */ @property(nonatomic, readonly) NSString *processPath; +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly) NSDate *processStartTime; + /** * The parent process name. This value may not be included in the crash report, in which case this property * will be nil. diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h index af027bea5b..03d570bd4c 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h @@ -1,7 +1,7 @@ /* * Author: Landon Fuller * - * Copyright (c) 2008-2011 Plausible Labs Cooperative, Inc. + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportReportInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h similarity index 69% rename from Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportReportInfo.h rename to Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h index 72b7751354..20b618d747 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportReportInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h @@ -1,8 +1,7 @@ /* - * Author: Andreas Linde + * Author: Landon Fuller * - * Copyright (c) 2012 Plausible Labs Cooperative, Inc. - * Copyright (c) 2012 Andreas Linde + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. * All rights reserved. * * Permission is hereby granted, free of charge, to any person @@ -29,17 +28,25 @@ #import -@interface PLCrashReportReportInfo : NSObject { +@interface PLCrashReportRegisterInfo : NSObject { @private - /** Crash Report GUID */ - NSString *_reportGUID; + /** Register name */ + NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; } -- (id) initWithReportGUID: (NSString *) reportGUID; +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; /** - * The crash report GUID. + * Register name. */ -@property(nonatomic, readonly) NSString *reportGUID; +@property(nonatomic, readonly) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; @end diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000000..997e762650 --- /dev/null +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import "PLCrashReportSymbolInfo.h" + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000000..c6ceb6c109 --- /dev/null +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h index 3dbcb72286..e98c969c81 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h @@ -73,7 +73,8 @@ typedef enum { /** * ARMv6 - * @deprecated + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. * @sa PLCrashReportArchitectureARMv6 */ PLCrashReportArchitectureARM = PLCrashReportArchitectureARMv6, @@ -87,11 +88,8 @@ typedef enum { /** ARMv7 */ PLCrashReportArchitectureARMv7 = 5, - /** ARMv7s */ - PLCrashReportArchitectureARMv7s = 6, - /** Unknown */ - PLCrashReportArchitectureUnknown = 7 + PLCrashReportArchitectureUnknown = 6 } PLCrashReportArchitecture; @@ -136,7 +134,9 @@ extern PLCrashReportArchitecture PLCrashReportHostArchitecture; /** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ @property(nonatomic, readonly) NSString *operatingSystemBuild; -/** Architecture. */ +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ @property(nonatomic, readonly) PLCrashReportArchitecture architecture; /** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h index 61e6689f74..2ba7e3503e 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h @@ -3,7 +3,7 @@ * Landon Fuller * Damian Morris * - * Copyright (c) 2008-2010 Plausible Labs Cooperative, Inc. + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. * Copyright (c) 2010 MOSO Corporation, Pty Ltd. * All rights reserved. * diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h index 390db44fe8..04c8604454 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h @@ -28,61 +28,8 @@ #import -@interface PLCrashReportStackFrameInfo : NSObject { -@private - /** Frame instruction pointer. */ - uint64_t _instructionPointer; - - /** Symbol start address, if any. */ - uint64_t _symbolStart; - - /** Symbol name, if any. */ - NSString *_symbolName; -} - -- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolStart: (uint64_t) symbolStart symbolName: (NSString *) symbolName; - -/** - * Frame's instruction pointer. - */ -@property(nonatomic, readonly) uint64_t instructionPointer; - -/** - * Frame's symbol address, if determined, otherwise 0. - */ -@property(nonatomic, readonly) uint64_t symbolStart; - -/** - * Frame's symbol name, if determined, otherwise 0. - */ -@property(nonatomic, readonly) NSString *symbolName; - -@end - - -@interface PLCrashReportRegisterInfo : NSObject { -@private - /** Register name */ - NSString *_registerName; - - /** Register value */ - uint64_t _registerValue; -} - -- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; - -/** - * Register name. - */ -@property(nonatomic, readonly) NSString *registerName; - -/** - * Register value. - */ -@property(nonatomic, readonly) uint64_t registerValue; - -@end - +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" @interface PLCrashReportThreadInfo : NSObject { @private diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h index e027b08223..8f1bd444a8 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h @@ -27,6 +27,7 @@ */ #import +#import /** * @ingroup functions @@ -75,15 +76,6 @@ typedef struct PLCrashReporterCallbacks { /** Application version */ NSString *_applicationVersion; - /** Application short version */ - NSString *_applicationShortVersion; - - /** Application startup timestamp */ - time_t _applicationStartupTimestamp; - - /** GUID for the crash report */ - NSString *_crashReportGUID; - /** Path to the crash reporter internal data directory */ NSString *_crashReportDirectory; } @@ -95,6 +87,12 @@ typedef struct PLCrashReporterCallbacks { - (NSData *) loadPendingCrashReportData; - (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; + - (BOOL) purgePendingCrashReport; - (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; diff --git a/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporterNamespace.h b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporterNamespace.h new file mode 100644 index 0000000000..3d08220a7d --- /dev/null +++ b/Vendor/CrashReporter.framework/Versions/A/Headers/PLCrashReporterNamespace.h @@ -0,0 +1,70 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +#define PLCRASHREPORTER_PREFIX BIT + +#ifdef PLCRASHREPORTER_PREFIX + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +#endif diff --git a/Vendor/CrashReporter.framework/Versions/A/Resources/Info.plist b/Vendor/CrashReporter.framework/Versions/A/Resources/Info.plist index 6baac1326a..d785e2138f 100644 --- a/Vendor/CrashReporter.framework/Versions/A/Resources/Info.plist +++ b/Vendor/CrashReporter.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 12C54 + 12E55 CFBundleDevelopmentRegion English CFBundleExecutable @@ -19,20 +19,20 @@ CFBundleSignature ???? CFBundleVersion - 1.2-beta2 + 1.0 DTCompiler DTPlatformBuild - 4G182 + 4H1503 DTPlatformVersion GM DTSDKBuild - 12C37 + 12D75 DTSDKName macosx10.8 DTXcode - 0450 + 0463 DTXcodeBuild - 4G182 + 4H1503