Merge branch 'refs/heads/feature/v3.1' into develop

This commit is contained in:
Andreas Linde 2013-07-28 01:55:40 +02:00
commit ef1ae02a1e
22 changed files with 883 additions and 619 deletions

View File

@ -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];

File diff suppressed because it is too large Load Diff

View File

@ -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:

View File

@ -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) {

View File

@ -32,6 +32,10 @@
#import <AvailabilityMacros.h>
#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. <em>There is no documented way of accomplishing this, nor is there a workaround
* possible.</em>
*
* 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.
*/

View File

@ -0,0 +1,58 @@
/*
* Author: Landon Fuller <landonf@plausiblelabs.com>
*
* 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 */

View File

@ -1,7 +1,7 @@
/*
* Author: Landon Fuller <landonf@plausiblelabs.com>
*
* 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 <Foundation/Foundation.h>
#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

View File

@ -1,7 +1,7 @@
/*
* Author: Landon Fuller <landonf@plausiblelabs.com>
*
* 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

View File

@ -1,7 +1,7 @@
/*
* Author: Landon Fuller <landonf@plausiblelabs.com>
*
* 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

View File

@ -1,7 +1,7 @@
/*
* Author: Landon Fuller <landonf@plausible.coop>
*
* 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;
/*

View File

@ -2,7 +2,7 @@
* Author: Damian Morris <damian@moso.com.au>
*
* 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.

View File

@ -1,7 +1,7 @@
/*
* Author: Landon Fuller <landonf@plausible.coop>
*
* 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

View File

@ -1,8 +1,7 @@
/*
* Author: Andreas Linde <mail@andreaslinde.de>
* Author: Landon Fuller <landonf@plausible.coop>
*
* 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 <Foundation/Foundation.h>
@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

View File

@ -0,0 +1,52 @@
/*
* Author: Landon Fuller <landonf@plausible.coop>
*
* 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 <Foundation/Foundation.h>
#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

View File

@ -0,0 +1,61 @@
/*
* Author: Landon Fuller <landonf@plausible.coop>
*
* 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 <Foundation/Foundation.h>
@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

View File

@ -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. */

View File

@ -3,7 +3,7 @@
* Landon Fuller <landonf@plausiblelabs.com>
* Damian Morris <damian@moso.com.au>
*
* 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.
*

View File

@ -28,61 +28,8 @@
#import <Foundation/Foundation.h>
@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

View File

@ -27,6 +27,7 @@
*/
#import <Foundation/Foundation.h>
#import <mach/mach.h>
/**
* @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;

View File

@ -0,0 +1,70 @@
/*
* Author: Landon Fuller <landonf@plausible.coop>
*
* 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

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>12C54</string>
<string>12E55</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
@ -19,20 +19,20 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2-beta2</string>
<string>1.0</string>
<key>DTCompiler</key>
<string></string>
<key>DTPlatformBuild</key>
<string>4G182</string>
<string>4H1503</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>12C37</string>
<string>12D75</string>
<key>DTSDKName</key>
<string>macosx10.8</string>
<key>DTXcode</key>
<string>0450</string>
<string>0463</string>
<key>DTXcodeBuild</key>
<string>4G182</string>
<string>4H1503</string>
</dict>
</plist>