Remove PLCrashReporter
This commit is contained in:
Родитель
984822ffa9
Коммит
8e1042a049
|
@ -38,8 +38,6 @@
|
|||
1B3FB89F1A93756100D06311 /* MSAIReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B3FB89D1A93756100D06311 /* MSAIReachability.m */; };
|
||||
1B47E02E1A84D3DF000B4C3D /* MSAIEnvelopeManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B47E02C1A84D3DF000B4C3D /* MSAIEnvelopeManager.h */; };
|
||||
1B47E02F1A84D3DF000B4C3D /* MSAIEnvelopeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B47E02D1A84D3DF000B4C3D /* MSAIEnvelopeManager.m */; };
|
||||
1B53FEBF1A6425240082F2E9 /* CrashReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B53FEBE1A6425240082F2E9 /* CrashReporter.framework */; };
|
||||
1B53FEC01A6425240082F2E9 /* CrashReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B53FEBE1A6425240082F2E9 /* CrashReporter.framework */; };
|
||||
1B62F4D81A692A3200EB5AD0 /* MSAIContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B62F4D61A692A3200EB5AD0 /* MSAIContext.h */; };
|
||||
1B62F4D91A692A3200EB5AD0 /* MSAIContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B62F4D71A692A3200EB5AD0 /* MSAIContext.m */; };
|
||||
1B85606F1A7A6A9D00A54FB7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B85606E1A7A6A9D00A54FB7 /* UIKit.framework */; };
|
||||
|
@ -209,7 +207,6 @@
|
|||
1B47E02D1A84D3DF000B4C3D /* MSAIEnvelopeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSAIEnvelopeManager.m; sourceTree = "<group>"; };
|
||||
1B47E0301A84D413000B4C3D /* MSAIEnvelopeManagerPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSAIEnvelopeManagerPrivate.h; sourceTree = "<group>"; };
|
||||
1B4D17E41A666EE30079D948 /* MSAIChannelPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSAIChannelPrivate.h; sourceTree = "<group>"; };
|
||||
1B53FEBE1A6425240082F2E9 /* CrashReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CrashReporter.framework; path = ../Vendor/CrashReporter.framework; sourceTree = "<group>"; };
|
||||
1B62F4D61A692A3200EB5AD0 /* MSAIContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSAIContext.h; sourceTree = "<group>"; };
|
||||
1B62F4D71A692A3200EB5AD0 /* MSAIContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSAIContext.m; sourceTree = "<group>"; };
|
||||
1B62F4DA1A692A6F00EB5AD0 /* MSAIContextPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSAIContextPrivate.h; sourceTree = "<group>"; };
|
||||
|
@ -373,7 +370,6 @@
|
|||
files = (
|
||||
1B85606F1A7A6A9D00A54FB7 /* UIKit.framework in Frameworks */,
|
||||
1E5954DC15B6F24A00A03429 /* Foundation.framework in Frameworks */,
|
||||
1B53FEBF1A6425240082F2E9 /* CrashReporter.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -384,7 +380,6 @@
|
|||
80E1A45A1AE54D6200603B0A /* libOCMock.a in Frameworks */,
|
||||
80ECBD1F1ADE9E39005CACF4 /* libz.dylib in Frameworks */,
|
||||
1B3B73081A94BC8E008DCADA /* CoreTelephony.framework in Frameworks */,
|
||||
1B53FEC01A6425240082F2E9 /* CrashReporter.framework in Frameworks */,
|
||||
1EA1170016F4D32C001C015C /* libApplicationInsights.a in Frameworks */,
|
||||
80E1A44C1AE54C7800603B0A /* OCHamcrestIOS.framework in Frameworks */,
|
||||
1E5A459516F0DFC200B55C04 /* Foundation.framework in Frameworks */,
|
||||
|
@ -642,7 +637,6 @@
|
|||
80B69EEF1ADDC49100C47B0A /* libz.dylib */,
|
||||
1B3B73071A94BC8E008DCADA /* CoreTelephony.framework */,
|
||||
1B85606E1A7A6A9D00A54FB7 /* UIKit.framework */,
|
||||
1B53FEBE1A6425240082F2E9 /* CrashReporter.framework */,
|
||||
E400561D148D79B500EB22B9 /* Foundation.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Versions/Current/CrashReporter
|
|
@ -1 +0,0 @@
|
|||
Versions/Current/Headers
|
|
@ -1 +0,0 @@
|
|||
Versions/Current/Resources
|
Двоичный файл не отображается.
|
@ -1,363 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#import <AvailabilityMacros.h>
|
||||
#endif
|
||||
|
||||
// This must be included before any other PLCrashReporter includes, as
|
||||
// it redefines symbol names
|
||||
#import "PLCrashNamespace.h"
|
||||
|
||||
#import "PLCrashReporter.h"
|
||||
#import "PLCrashReport.h"
|
||||
#import "PLCrashReportTextFormatter.h"
|
||||
|
||||
/**
|
||||
* @defgroup functions Crash Reporter Functions Reference
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup types Crash Reporter Data Types Reference
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup constants Crash Reporter Constants Reference
|
||||
*/
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @defgroup plcrash_internal Crash Reporter Internal Documentation
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup enums Enumerations
|
||||
* @ingroup constants
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup globals Global Variables
|
||||
* @ingroup constants
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup exceptions Exceptions
|
||||
* @ingroup constants
|
||||
*/
|
||||
|
||||
/* Exceptions */
|
||||
extern NSString *PLCrashReporterException;
|
||||
|
||||
/* Error Domain and Codes */
|
||||
extern NSString *PLCrashReporterErrorDomain;
|
||||
|
||||
/**
|
||||
* NSError codes in the Plausible Crash Reporter error domain.
|
||||
* @ingroup enums
|
||||
*/
|
||||
typedef enum {
|
||||
/** An unknown error has occured. If this
|
||||
* code is received, it is a bug, and should be reported. */
|
||||
PLCrashReporterErrorUnknown = 0,
|
||||
|
||||
/** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo
|
||||
* dictionary using the NSUnderlyingErrorKey key. */
|
||||
PLCrashReporterErrorOperatingSystem = 1,
|
||||
|
||||
/** The crash report log file is corrupt or invalid */
|
||||
PLCrashReporterErrorCrashReportInvalid = 2,
|
||||
|
||||
/** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */
|
||||
PLCrashReporterErrorResourceBusy = 3
|
||||
} PLCrashReporterError;
|
||||
|
||||
|
||||
/* Library Imports */
|
||||
#import "PLCrashReporter.h"
|
||||
#import "PLCrashReport.h"
|
||||
#import "PLCrashReportTextFormatter.h"
|
||||
|
||||
/**
|
||||
* @mainpage Plausible Crash Reporter
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
*
|
||||
* Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X.
|
||||
*
|
||||
* The following features are supported:
|
||||
*
|
||||
* - Implemented as an in-process signal handler.
|
||||
* - Does not interfer with debugging in gdb..
|
||||
* - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc).
|
||||
* - Full thread state for all active threads (backtraces, register dumps) is provided.
|
||||
*
|
||||
* If your application crashes, a crash report will be written. When the application is next run, you may check for a
|
||||
* pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the
|
||||
* report locally.
|
||||
*
|
||||
* @section intro_encoding Crash Report Format
|
||||
*
|
||||
* Crash logs are encoded using <a href="http://code.google.com/p/protobuf/">google protobuf</a>, and may be decoded
|
||||
* using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the
|
||||
* symbolicate-compatible iPhone text format.
|
||||
*
|
||||
* @section doc_sections Documentation Sections
|
||||
* - @subpage example_usage_iphone
|
||||
* - @subpage error_handling
|
||||
* - @subpage async_safety
|
||||
*/
|
||||
|
||||
/**
|
||||
* @page example_usage_iphone Example iPhone Usage
|
||||
*
|
||||
* @code
|
||||
* //
|
||||
* // Called to handle a pending crash report.
|
||||
* //
|
||||
* - (void) handleCrashReport {
|
||||
* PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
|
||||
* NSData *crashData;
|
||||
* NSError *error;
|
||||
*
|
||||
* // Try loading the crash report
|
||||
* crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error];
|
||||
* if (crashData == nil) {
|
||||
* NSLog(@"Could not load crash report: %@", error);
|
||||
* goto finish;
|
||||
* }
|
||||
*
|
||||
* // We could send the report from here, but we'll just print out
|
||||
* // some debugging info instead
|
||||
* PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease];
|
||||
* if (report == nil) {
|
||||
* NSLog(@"Could not parse crash report");
|
||||
* goto finish;
|
||||
* }
|
||||
*
|
||||
* NSLog(@"Crashed on %@", report.systemInfo.timestamp);
|
||||
* NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name,
|
||||
* report.signalInfo.code, report.signalInfo.address);
|
||||
*
|
||||
* // Purge the report
|
||||
* finish:
|
||||
* [crashReporter purgePendingCrashReport];
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* // from UIApplicationDelegate protocol
|
||||
* - (void) applicationDidFinishLaunching: (UIApplication *) application {
|
||||
* PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
|
||||
* NSError *error;
|
||||
*
|
||||
* // Check if we previously crashed
|
||||
* if ([crashReporter hasPendingCrashReport])
|
||||
* [self handleCrashReport];
|
||||
|
||||
* // Enable the Crash Reporter
|
||||
* if (![crashReporter enableCrashReporterAndReturnError: &error])
|
||||
* NSLog(@"Warning: Could not enable crash reporter: %@", error);
|
||||
*
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @page error_handling Error Handling Programming Guide
|
||||
*
|
||||
* Where a method may return an error, Plausible Crash Reporter provides access to the underlying
|
||||
* cause via an optional NSError argument.
|
||||
*
|
||||
* All returned errors will be a member of one of the below defined domains, however, new domains and
|
||||
* error codes may be added at any time. If you do not wish to report on the error cause, many methods
|
||||
* support a simple form that requires no NSError argument.
|
||||
*
|
||||
* @section error_domains Error Domains, Codes, and User Info
|
||||
*
|
||||
* @subsection crashreporter_errors Crash Reporter Errors
|
||||
*
|
||||
* Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one
|
||||
* of the error codes defined in #PLCrashReporterError.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @page async_safety Async-Safe Programming Guide
|
||||
*
|
||||
* Plausible CrashReporter provides support for executing an application specified function in the context of the
|
||||
* crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested
|
||||
* feature, and provides the ability to implement application finalization in the event of a crash. However, writing
|
||||
* code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended.
|
||||
*
|
||||
* @section program_flow Program Flow and Signal Handlers
|
||||
*
|
||||
* When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown
|
||||
* state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal
|
||||
* handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks,
|
||||
* data corruption, and program termination.
|
||||
*
|
||||
* @section functions Async-Safe Functions
|
||||
*
|
||||
* A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If
|
||||
* you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions
|
||||
* and additional information is available from the
|
||||
* <a href="https://www.securecoding.cert.org/confluence/display/seccode/SIG30-C.+Call+only+asynchronous-safe+functions+within+signal+handlers">CERT programming guide - SIG30-C</a>
|
||||
*
|
||||
* Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal
|
||||
* handler.
|
||||
*
|
||||
* @sa PLCrashReporter::setCrashCallbacks:
|
||||
*/
|
||||
|
||||
/**
|
||||
* @page mach_exceptions Mach Exceptions on Mac OS X and iOS
|
||||
*
|
||||
* PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small
|
||||
* number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach
|
||||
* exception handler:
|
||||
*
|
||||
* - 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.
|
||||
*
|
||||
* Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that
|
||||
* a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will
|
||||
* only be handled once we've implemented fully out-of-process crash excution.
|
||||
*
|
||||
* On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS,
|
||||
* the APIs required are not fully public -- more details on the implications of this for exception handling on
|
||||
* iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs
|
||||
* are fully supported, kernel-internal constants, as well
|
||||
* as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause.
|
||||
*
|
||||
* For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception
|
||||
* code to differentiate failure types:
|
||||
* - Non-existent system call invoked (SIGSYS)
|
||||
* - Write on a pipe with no reader (SIGPIPE)
|
||||
* - Abort program (SIGABRT -- unused)
|
||||
* - Kill program (SIGKILL)
|
||||
*
|
||||
* Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined.
|
||||
* Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available
|
||||
* kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there
|
||||
* are no gaurantees that this is -- or will remain -- the case in the future.
|
||||
*
|
||||
* Likewise, interpretation of particular fault types requires information regarding the underlying machine traps
|
||||
* that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC,
|
||||
* with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires
|
||||
* extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format
|
||||
* of this subcode value is not actually documented outside the kernel, and may change in future releases.
|
||||
*
|
||||
* While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual
|
||||
* use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation,
|
||||
* and the available x86 kernel sources are of little use in interpreting this data.
|
||||
*
|
||||
* As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution,
|
||||
* and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface
|
||||
* is both fully defined and architecture independent, with any necessary interpretation of the Mach exception
|
||||
* codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred
|
||||
* interface, and should generally be preferred by PLCrashReporter API clients.
|
||||
*
|
||||
* @section mach_exceptions_compatibility Compatibility Issues
|
||||
*
|
||||
* @subsection Debuggers
|
||||
*
|
||||
* Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger
|
||||
* may suspend the processes Mach exception handling thread, which will result in any exception messages
|
||||
* sent via the debugger being lost, as the in-process handler will be unable to receive and forward
|
||||
* the messages.
|
||||
*
|
||||
* @subsection Managed Runtimes (Xamarin, Unity)
|
||||
*
|
||||
* A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that
|
||||
* can safely handle otherwise fatal signals, allowing execution to proceed. This includes products
|
||||
* such as Xamarin for iOS.
|
||||
*
|
||||
* In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no
|
||||
* immediate mechanism for determining whether a signal handler exists and that it can safely
|
||||
* handle the failure. This can result in unexpected delays in application execution, increased I/O to
|
||||
* disk, and other undesirable operations.
|
||||
*
|
||||
* @section mach_exceptions_ios Mach Exceptions on iOS
|
||||
*
|
||||
* The APIs required for Mach exception handling are not fully public on iOS. 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:
|
||||
*
|
||||
* <em>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.</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 undefined 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 via PLCrashReporterConfig.
|
||||
*
|
||||
* The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols;
|
||||
* 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 (eg, forwarding is entirely non-functional
|
||||
* on ARM64 devices).
|
||||
*
|
||||
* Impact:
|
||||
* This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES,
|
||||
* including other handlers registered within the current process, eg, by a managed runtime. This could
|
||||
* also result in misinterpretation of a Mach exception message, in the case where the message format is
|
||||
* modified by Apple to be incompatible with the existing 32-bit format.
|
||||
*
|
||||
* 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.
|
||||
*/
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* 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 */
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef PLCRASH_FEATURE_CONFIG_H
|
||||
#define PLCRASH_FEATURE_CONFIG_H
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Build-time configuration for PLCrashReporter.
|
||||
*
|
||||
* This is used to automatically enable/disable features on a per-platform and per-configuration
|
||||
* basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter.
|
||||
*
|
||||
* @defgroup build_config Build Configuration
|
||||
* @ingroup constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* Defaults
|
||||
*/
|
||||
|
||||
/*
|
||||
* For release builds, disable unused unwind implementations on targets that do not use them. For non-release
|
||||
* builds, we include the unwind implementations to allow testing on a broader range of targets.
|
||||
*/
|
||||
#ifdef PLCF_RELEASE_BUILD
|
||||
# if defined(__arm__)
|
||||
# ifndef PLCRASH_FEATURE_UNWIND_DWARF
|
||||
# define PLCRASH_FEATURE_UNWIND_DWARF 0
|
||||
# endif
|
||||
# ifndef PLCRASH_FEATURE_UNWIND_COMPACT
|
||||
# define PLCRASH_FEATURE_UNWIND_COMPACT 0
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Configuration Flags
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS
|
||||
/**
|
||||
* If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported,
|
||||
* using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a
|
||||
* popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either
|
||||
* they've received special dispensation to use private APIs / private structures, they've found another way to do
|
||||
* it, or they're just using undocumented functionality and hoping for the best.
|
||||
*
|
||||
* The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to
|
||||
* implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled
|
||||
* Mach exception handling by default, and provided both build-time and runtime configuration
|
||||
* to disable its use.
|
||||
*
|
||||
* For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions.
|
||||
*/
|
||||
# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1
|
||||
#endif
|
||||
|
||||
#ifndef PLCRASH_FEATURE_UNWIND_DWARF
|
||||
/** If true, enable DWARF unwinding support. */
|
||||
# define PLCRASH_FEATURE_UNWIND_DWARF 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef PLCRASH_FEATURE_UNWIND_COMPACT
|
||||
/** If true, enable compact unwinding support. */
|
||||
# define PLCRASH_FEATURE_UNWIND_COMPACT 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* PLCRASH_FEATURE_CONFIG_H */
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* Author: Landon Fuller <landonf@plausiblelabs.com>
|
||||
*
|
||||
* Copyright (c) 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.
|
||||
*/
|
||||
|
||||
#ifndef PLCRASH_CONSTANTS_H
|
||||
#define PLCRASH_CONSTANTS_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
# define PLCR_EXPORT extern "C"
|
||||
# define PLCR_C_BEGIN_DECLS extern "C" {
|
||||
# define PLCR_C_END_DECLS }
|
||||
#else
|
||||
# define PLCR_EXPORT extern
|
||||
# define PLCR_C_BEGIN_DECLS
|
||||
# define PLCR_C_END_DECLS
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p)
|
||||
#else
|
||||
# define PLCR_PRAGMA_CLANG(_p)
|
||||
#endif
|
||||
|
||||
#endif /* PLCRASH_CONSTANTS_H */
|
|
@ -1,80 +0,0 @@
|
|||
/*
|
||||
* 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 MSAI
|
||||
|
||||
#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 PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo)
|
||||
#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)
|
||||
#define PLCrashHostInfo PLNS(PLCrashHostInfo)
|
||||
#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort)
|
||||
#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet)
|
||||
#define PLCrashProcessInfo PLNS(PLCrashProcessInfo)
|
||||
#define PLCrashReporterConfig PLNS(PLCrashReporterConfig)
|
||||
#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler)
|
||||
#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward)
|
||||
#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward)
|
||||
#define plcrash_signal_handler PLNS(plcrash_signal_handler)
|
||||
|
||||
#endif
|
|
@ -1,200 +0,0 @@
|
|||
/*
|
||||
* Author: Landon Fuller <landonf@plausiblelabs.com>
|
||||
*
|
||||
* 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 "PLCrashReportApplicationInfo.h"
|
||||
#import "PLCrashReportBinaryImageInfo.h"
|
||||
#import "PLCrashReportExceptionInfo.h"
|
||||
#import "PLCrashReportMachineInfo.h"
|
||||
#import "PLCrashReportMachExceptionInfo.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
|
||||
* Crash file magic identifier */
|
||||
#define PLCRASH_REPORT_FILE_MAGIC "plcrash"
|
||||
|
||||
/**
|
||||
* @ingroup constants
|
||||
* Crash format version byte identifier. Will not change outside of the introduction of
|
||||
* an entirely new crash log format. */
|
||||
#define PLCRASH_REPORT_FILE_VERSION 1
|
||||
|
||||
/**
|
||||
* @ingroup types
|
||||
* Crash log file header format.
|
||||
*
|
||||
* Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC),
|
||||
* followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION).
|
||||
* The crash log message format itself is extensible, so this version number will only
|
||||
* be incremented in the event of an incompatible encoding or format change.
|
||||
*/
|
||||
struct PLCrashReportFileHeader {
|
||||
/** Crash log magic identifier, not NULL terminated */
|
||||
const char magic[7];
|
||||
|
||||
/** Crash log encoding/format version */
|
||||
const uint8_t version;
|
||||
|
||||
/** File data */
|
||||
const uint8_t data[];
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* Private decoder instance variables (used to hide the underlying protobuf parser).
|
||||
*/
|
||||
typedef struct _PLCrashReportDecoder _PLCrashReportDecoder;
|
||||
|
||||
@interface PLCrashReport : NSObject {
|
||||
@private
|
||||
/** Private implementation variables (used to hide the underlying protobuf parser) */
|
||||
_PLCrashReportDecoder *_decoder;
|
||||
|
||||
/** System info */
|
||||
PLCrashReportSystemInfo *_systemInfo;
|
||||
|
||||
/** Machine info */
|
||||
PLCrashReportMachineInfo *_machineInfo;
|
||||
|
||||
/** Application info */
|
||||
PLCrashReportApplicationInfo *_applicationInfo;
|
||||
|
||||
/** Process info */
|
||||
PLCrashReportProcessInfo *_processInfo;
|
||||
|
||||
/** Signal info */
|
||||
PLCrashReportSignalInfo *_signalInfo;
|
||||
|
||||
/** Mach exception info */
|
||||
PLCrashReportMachExceptionInfo *_machExceptionInfo;
|
||||
|
||||
/** Thread info (PLCrashReportThreadInfo instances) */
|
||||
NSArray *_threads;
|
||||
|
||||
/** Binary images (PLCrashReportBinaryImageInfo instances */
|
||||
NSArray *_images;
|
||||
|
||||
/** Exception information (may be nil) */
|
||||
PLCrashReportExceptionInfo *_exceptionInfo;
|
||||
|
||||
/** Report UUID */
|
||||
CFUUIDRef _uuid;
|
||||
}
|
||||
|
||||
- (id) initWithData: (NSData *) encodedData error: (NSError **) outError;
|
||||
|
||||
- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address;
|
||||
|
||||
/**
|
||||
* System information.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportSystemInfo *systemInfo;
|
||||
|
||||
/**
|
||||
* YES if machine information is available.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL hasMachineInfo;
|
||||
|
||||
/**
|
||||
* Machine information. Only available in later (v1.1+) crash report format versions. If not available,
|
||||
* will be nil.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportMachineInfo *machineInfo;
|
||||
|
||||
/**
|
||||
* Application information.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportApplicationInfo *applicationInfo;
|
||||
|
||||
/**
|
||||
* YES if process information is available.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL hasProcessInfo;
|
||||
|
||||
/**
|
||||
* Process information. Only available in later (v1.1+) crash report format versions. If not available,
|
||||
* will be nil.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportProcessInfo *processInfo;
|
||||
|
||||
/**
|
||||
* Signal information. This provides the signal and signal code of the fatal signal.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportSignalInfo *signalInfo;
|
||||
|
||||
/**
|
||||
* Mach exception information, if available. This will only be included in the
|
||||
* case that encoding crash reporter's exception-based reporting was enabled, and a Mach
|
||||
* exception was caught.
|
||||
*
|
||||
* @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this
|
||||
* s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the
|
||||
* Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal
|
||||
* mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportMachExceptionInfo *machExceptionInfo;
|
||||
|
||||
/**
|
||||
* Thread information. Returns a list of PLCrashReportThreadInfo instances.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSArray *threads;
|
||||
|
||||
/**
|
||||
* Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSArray *images;
|
||||
|
||||
/**
|
||||
* YES if exception information is available.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL hasExceptionInfo;
|
||||
|
||||
/**
|
||||
* Exception information. Only available if a crash was caused by an uncaught exception,
|
||||
* otherwise nil.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportExceptionInfo *exceptionInfo;
|
||||
|
||||
/**
|
||||
* 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) CFUUIDRef uuidRef;
|
||||
|
||||
@end
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface PLCrashReportApplicationInfo : NSObject {
|
||||
@private
|
||||
/** Application identifier */
|
||||
NSString *_applicationIdentifier;
|
||||
|
||||
/** Application version */
|
||||
NSString *_applicationVersion;
|
||||
|
||||
/** Application marketing version */
|
||||
NSString *_applicationMarketingVersion;
|
||||
}
|
||||
|
||||
- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier
|
||||
applicationVersion: (NSString *) applicationVersion
|
||||
applicationMarketingVersion: (NSString *) applicationMarketingVersion;
|
||||
|
||||
/**
|
||||
* The application identifier. This is usually the application's CFBundleIdentifier value.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *applicationIdentifier;
|
||||
|
||||
/**
|
||||
* The application version. This is usually the application's CFBundleVersion value.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *applicationVersion;
|
||||
|
||||
/**
|
||||
* The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *applicationMarketingVersion;
|
||||
|
||||
@end
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PLCrashReportProcessorInfo.h"
|
||||
|
||||
@interface PLCrashReportBinaryImageInfo : NSObject {
|
||||
@private
|
||||
/** Code type */
|
||||
PLCrashReportProcessorInfo *_processorInfo;
|
||||
|
||||
/** Base image address */
|
||||
uint64_t _baseAddress;
|
||||
|
||||
/** Image segment size */
|
||||
uint64_t _imageSize;
|
||||
|
||||
/** Name of binary image */
|
||||
NSString *_imageName;
|
||||
|
||||
/** If the UUID is available */
|
||||
BOOL _hasImageUUID;
|
||||
|
||||
/** 128-bit object UUID. May be nil. */
|
||||
NSString *_imageUUID;
|
||||
}
|
||||
|
||||
- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo
|
||||
baseAddress: (uint64_t) baseAddress
|
||||
size: (uint64_t) imageSize
|
||||
name: (NSString *) imageName
|
||||
uuid: (NSData *) uuid;
|
||||
|
||||
/**
|
||||
* Image code type, or nil if unavailable.
|
||||
*/
|
||||
@property(nonatomic, readonly) PLCrashReportProcessorInfo *codeType;
|
||||
|
||||
/**
|
||||
* Image base address.
|
||||
*/
|
||||
@property(nonatomic, readonly) uint64_t imageBaseAddress;
|
||||
|
||||
/**
|
||||
* Segment size.
|
||||
*/
|
||||
@property(nonatomic, readonly) uint64_t imageSize;
|
||||
|
||||
/**
|
||||
* Image name (absolute path)
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *imageName;
|
||||
|
||||
|
||||
/**
|
||||
* YES if this image has an associated UUID.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL hasImageUUID;
|
||||
|
||||
/**
|
||||
* 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *imageUUID;
|
||||
|
||||
@end
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "PLCrashReportThreadInfo.h"
|
||||
|
||||
|
||||
@interface PLCrashReportExceptionInfo : NSObject {
|
||||
@private
|
||||
/** Name */
|
||||
NSString *_name;
|
||||
|
||||
/** Reason */
|
||||
NSString *_reason;
|
||||
|
||||
/** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */
|
||||
NSArray *_stackFrames;
|
||||
}
|
||||
|
||||
- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason;
|
||||
|
||||
- (id) initWithExceptionName: (NSString *) name
|
||||
reason: (NSString *) reason
|
||||
stackFrames: (NSArray *) stackFrames;
|
||||
|
||||
/**
|
||||
* The exception name.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *exceptionName;
|
||||
|
||||
/**
|
||||
* The exception reason.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *exceptionReason;
|
||||
|
||||
/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable.
|
||||
* This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */
|
||||
@property(nonatomic, readonly) NSArray *stackFrames;
|
||||
|
||||
@end
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* Author: Landon Fuller <landonf@plausiblelabs.com>
|
||||
*
|
||||
* 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 "PLCrashReport.h"
|
||||
|
||||
/**
|
||||
* A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules,
|
||||
* (such as implementing text output support), and returns the result.
|
||||
*/
|
||||
@protocol PLCrashReportFormatter
|
||||
|
||||
/**
|
||||
* Format the provided @a report.
|
||||
*
|
||||
* @param report Report to be formatted.
|
||||
* @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error
|
||||
* object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will
|
||||
* be left unmodified. You may specify nil for this parameter, and no error information will be provided.
|
||||
*
|
||||
* @return Returns the formatted report data on success, or nil on failure.
|
||||
*/
|
||||
- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError;
|
||||
|
||||
@end
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* Author: Landon Fuller <landonf@plausiblelabs.com>
|
||||
*
|
||||
* Copyright (c) 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 PLCrashReportMachExceptionInfo : NSObject {
|
||||
@private
|
||||
/** The Mach exception type. */
|
||||
uint64_t _type;
|
||||
|
||||
/** The Mach exception codes, represented as an ordered array of NSNumber instances. */
|
||||
NSArray *_codes;
|
||||
}
|
||||
|
||||
- (id) initWithType: (uint64_t) type codes: (NSArray *) codes;
|
||||
|
||||
/** The Mach exception type. */
|
||||
@property(nonatomic, readonly) uint64_t type;
|
||||
|
||||
/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */
|
||||
@property(nonatomic, readonly) NSArray *codes;
|
||||
|
||||
@end
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* 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 "PLCrashReportProcessorInfo.h"
|
||||
|
||||
@interface PLCrashReportMachineInfo : NSObject {
|
||||
@private
|
||||
/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */
|
||||
NSString *_modelName;
|
||||
|
||||
/** The processor type. */
|
||||
PLCrashReportProcessorInfo *_processorInfo;
|
||||
|
||||
/* The number of actual physical processor cores. */
|
||||
NSUInteger _processorCount;
|
||||
|
||||
/* The number of logical processors. */
|
||||
NSUInteger _logicalProcessorCount;
|
||||
}
|
||||
|
||||
- (id) initWithModelName: (NSString *) modelName
|
||||
processorInfo: (PLCrashReportProcessorInfo *) processorInfo
|
||||
processorCount: (NSUInteger) processorCount
|
||||
logicalProcessorCount: (NSUInteger) logicalProcessorCount;
|
||||
|
||||
/** 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. 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;
|
||||
|
||||
/*
|
||||
* The number of actual physical processor cores. Note that the number of active processors may be managed by the
|
||||
* operating system's power management system, and this value may not reflect the number of active
|
||||
* processors at the time of the crash.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSUInteger processorCount;
|
||||
|
||||
/*
|
||||
* The number of logical processors. Note that the number of active processors may be managed by the
|
||||
* operating system's power management system, and this value may not reflect the number of active
|
||||
* processors at the time of the crash.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSUInteger logicalProcessorCount;
|
||||
|
||||
@end
|
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* Author: Damian Morris <damian@moso.com.au>
|
||||
*
|
||||
* Copyright (c) 2010 MOSO Corporation, Pty Ltd.
|
||||
* Copyright (c) 2010-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 PLCrashReportProcessInfo : NSObject {
|
||||
@private
|
||||
/** Process name, or nil if unavailable. */
|
||||
NSString *_processName;
|
||||
|
||||
/** Process ID */
|
||||
NSUInteger _processID;
|
||||
|
||||
/** 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, or nil if unavailable. */
|
||||
NSString *_parentProcessName;
|
||||
|
||||
/** Parent process ID */
|
||||
NSUInteger _parentProcessID;
|
||||
|
||||
/** If false, the process is being run via process-level CPU emulation (such as Rosetta). */
|
||||
BOOL _native;
|
||||
}
|
||||
|
||||
- (id) initWithProcessName: (NSString *) processName
|
||||
processID: (NSUInteger) processID
|
||||
processPath: (NSString *) processPath
|
||||
processStartTime: (NSDate *) processStartTime
|
||||
parentProcessName: (NSString *) parentProcessName
|
||||
parentProcessID: (NSUInteger) parentProcessID
|
||||
native: (BOOL) native;
|
||||
|
||||
/**
|
||||
* The process name. This value may not be included in the crash report, in which case this property
|
||||
* will be nil.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *processName;
|
||||
|
||||
/**
|
||||
* The process ID.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSUInteger processID;
|
||||
|
||||
/**
|
||||
* The path to the process executable. This value may not be included in the crash report, in which case this property
|
||||
* will be nil.
|
||||
*/
|
||||
@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.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *parentProcessName;
|
||||
|
||||
/**
|
||||
* The parent process ID.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSUInteger parentProcessID;
|
||||
|
||||
/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */
|
||||
@property(nonatomic, readonly) BOOL native;
|
||||
|
||||
@end
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* 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 <mach/machine.h>
|
||||
|
||||
/**
|
||||
* @ingroup constants
|
||||
*
|
||||
* The type encodings supported for CPU types and subtypes. Currently only Apple
|
||||
* Mach-O defined encodings are supported.
|
||||
*
|
||||
* @internal
|
||||
* These enum values match the protobuf values. Keep them synchronized.
|
||||
*/
|
||||
typedef enum {
|
||||
/** Unknown cpu type encoding. */
|
||||
PLCrashReportProcessorTypeEncodingUnknown = 0,
|
||||
|
||||
/** Apple Mach-defined processor types. */
|
||||
PLCrashReportProcessorTypeEncodingMach = 1
|
||||
} PLCrashReportProcessorTypeEncoding;
|
||||
|
||||
@interface PLCrashReportProcessorInfo : NSObject {
|
||||
@private
|
||||
/** Type encoding */
|
||||
PLCrashReportProcessorTypeEncoding _typeEncoding;
|
||||
|
||||
/** CPU type */
|
||||
uint64_t _type;
|
||||
|
||||
/** CPU subtype */
|
||||
uint64_t _subtype;
|
||||
}
|
||||
|
||||
- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding
|
||||
type: (uint64_t) type
|
||||
subtype: (uint64_t) subtype;
|
||||
|
||||
/** The CPU type encoding. */
|
||||
@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding;
|
||||
|
||||
/** The CPU type. */
|
||||
@property(nonatomic, readonly) uint64_t type;
|
||||
|
||||
/** The CPU subtype. */
|
||||
@property(nonatomic, readonly) uint64_t subtype;
|
||||
|
||||
@end
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* 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>
|
||||
|
||||
@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
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface PLCrashReportSignalInfo : NSObject {
|
||||
@private
|
||||
/** Signal name */
|
||||
NSString *_name;
|
||||
|
||||
/** Signal code */
|
||||
NSString *_code;
|
||||
|
||||
/** Fauling instruction or address */
|
||||
uint64_t _address;
|
||||
}
|
||||
|
||||
- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address;
|
||||
|
||||
/**
|
||||
* The signal name.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *name;
|
||||
|
||||
/**
|
||||
* The signal code.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSString *code;
|
||||
|
||||
/**
|
||||
* The faulting instruction or address.
|
||||
*/
|
||||
@property(nonatomic, readonly) uint64_t address;
|
||||
|
||||
@end
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* 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
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* 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
|
|
@ -1,145 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* @ingroup constants
|
||||
*
|
||||
* Indicates the Operating System under which a Crash Log was generated.
|
||||
*
|
||||
* @internal
|
||||
* These enum values match the protobuf values. Keep them synchronized.
|
||||
*/
|
||||
typedef enum {
|
||||
/** Mac OS X. */
|
||||
PLCrashReportOperatingSystemMacOSX = 0,
|
||||
|
||||
/** iPhone OS */
|
||||
PLCrashReportOperatingSystemiPhoneOS = 1,
|
||||
|
||||
/** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */
|
||||
PLCrashReportOperatingSystemiPhoneSimulator = 2,
|
||||
|
||||
/** Unknown operating system */
|
||||
PLCrashReportOperatingSystemUnknown = 3,
|
||||
} PLCrashReportOperatingSystem;
|
||||
|
||||
/**
|
||||
* @ingroup constants
|
||||
*
|
||||
* Indicates the architecture under which a Crash Log was generated.
|
||||
*
|
||||
* @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports
|
||||
* will make use of the new PLCrashReportProcessorInfo CPU type encodings.
|
||||
*
|
||||
* @internal
|
||||
* These enum values match the protobuf values. Keep them synchronized.
|
||||
*/
|
||||
typedef enum {
|
||||
/** x86-32. */
|
||||
PLCrashReportArchitectureX86_32 = 0,
|
||||
|
||||
/** x86-64 */
|
||||
PLCrashReportArchitectureX86_64 = 1,
|
||||
|
||||
/** ARMv6 */
|
||||
PLCrashReportArchitectureARMv6 = 2,
|
||||
|
||||
/**
|
||||
* ARMv6
|
||||
* @deprecated This value has been deprecated in favor of ARM subtype-specific
|
||||
* values.
|
||||
* @sa PLCrashReportArchitectureARMv6
|
||||
*/
|
||||
PLCrashReportArchitectureARM = PLCrashReportArchitectureARMv6,
|
||||
|
||||
/** PPC */
|
||||
PLCrashReportArchitecturePPC = 3,
|
||||
|
||||
/** PPC64 */
|
||||
PLCrashReportArchitecturePPC64 = 4,
|
||||
|
||||
/** ARMv7 */
|
||||
PLCrashReportArchitectureARMv7 = 5,
|
||||
|
||||
/** Unknown */
|
||||
PLCrashReportArchitectureUnknown = 6
|
||||
} PLCrashReportArchitecture;
|
||||
|
||||
|
||||
extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem;
|
||||
extern PLCrashReportArchitecture PLCrashReportHostArchitecture;
|
||||
|
||||
@interface PLCrashReportSystemInfo : NSObject {
|
||||
@private
|
||||
/** Operating system */
|
||||
PLCrashReportOperatingSystem _operatingSystem;
|
||||
|
||||
/** Operating system version */
|
||||
NSString *_osVersion;
|
||||
|
||||
/** OS build. May be nil. */
|
||||
NSString *_osBuild;
|
||||
|
||||
/** Architecture */
|
||||
PLCrashReportArchitecture _architecture;
|
||||
|
||||
/** Date crash report was generated. May be nil if the date is unknown. */
|
||||
NSDate *_timestamp;
|
||||
}
|
||||
|
||||
- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem
|
||||
operatingSystemVersion: (NSString *) operatingSystemVersion
|
||||
architecture: (PLCrashReportArchitecture) architecture
|
||||
timestamp: (NSDate *) timestamp;
|
||||
|
||||
- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem
|
||||
operatingSystemVersion: (NSString *) operatingSystemVersion
|
||||
operatingSystemBuild: (NSString *) operatingSystemBuild
|
||||
architecture: (PLCrashReportArchitecture) architecture
|
||||
timestamp: (NSDate *) timestamp;
|
||||
|
||||
/** The operating system. */
|
||||
@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem;
|
||||
|
||||
/** The operating system's release version. */
|
||||
@property(nonatomic, readonly) NSString *operatingSystemVersion;
|
||||
|
||||
/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */
|
||||
@property(nonatomic, readonly) NSString *operatingSystemBuild;
|
||||
|
||||
/** 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. */
|
||||
@property(nonatomic, readonly) NSDate *timestamp;
|
||||
|
||||
@end
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* Authors:
|
||||
* Landon Fuller <landonf@plausiblelabs.com>
|
||||
* Damian Morris <damian@moso.com.au>
|
||||
*
|
||||
* Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc.
|
||||
* Copyright (c) 2010 MOSO Corporation, Pty Ltd.
|
||||
* 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 "PLCrashReportFormatter.h"
|
||||
|
||||
/**
|
||||
* Supported text output formats.
|
||||
*
|
||||
* @ingroup enums
|
||||
*/
|
||||
typedef enum {
|
||||
/** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available
|
||||
* through iTunes Connect. */
|
||||
PLCrashReportTextFormatiOS = 0
|
||||
} PLCrashReportTextFormat;
|
||||
|
||||
|
||||
@interface PLCrashReportTextFormatter : NSObject <PLCrashReportFormatter> {
|
||||
@private
|
||||
/** Text output format. */
|
||||
PLCrashReportTextFormat _textFormat;
|
||||
|
||||
/** Encoding to use for string output. */
|
||||
NSStringEncoding _stringEncoding;
|
||||
}
|
||||
|
||||
+ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat;
|
||||
|
||||
- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding;
|
||||
|
||||
@end
|
|
@ -1,77 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "PLCrashReportStackFrameInfo.h"
|
||||
#import "PLCrashReportRegisterInfo.h"
|
||||
|
||||
@interface PLCrashReportThreadInfo : NSObject {
|
||||
@private
|
||||
/** The thread number. Should be unique within a given crash log. */
|
||||
NSInteger _threadNumber;
|
||||
|
||||
/** Ordered list of PLCrashReportStackFrame instances */
|
||||
NSArray *_stackFrames;
|
||||
|
||||
/** YES if this thread crashed. */
|
||||
BOOL _crashed;
|
||||
|
||||
/** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */
|
||||
NSArray *_registers;
|
||||
}
|
||||
|
||||
- (id) initWithThreadNumber: (NSInteger) threadNumber
|
||||
stackFrames: (NSArray *) stackFrames
|
||||
crashed: (BOOL) crashed
|
||||
registers: (NSArray *) registers;
|
||||
|
||||
/**
|
||||
* Application thread number.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSInteger threadNumber;
|
||||
|
||||
/**
|
||||
* Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances.
|
||||
* The array is ordered, last callee to first.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSArray *stackFrames;
|
||||
|
||||
/**
|
||||
* If this thread crashed, set to YES.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL crashed;
|
||||
|
||||
/**
|
||||
* State of the general purpose and related registers, as a list of
|
||||
* PLCrashReportRegister instances. If this thead did not crash (crashed returns NO),
|
||||
* this list will be empty.
|
||||
*/
|
||||
@property(nonatomic, readonly) NSArray *registers;
|
||||
|
||||
@end
|
|
@ -1,136 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <mach/mach.h>
|
||||
|
||||
#import "PLCrashReporterConfig.h"
|
||||
|
||||
@class PLCrashMachExceptionServer;
|
||||
@class PLCrashMachExceptionPortSet;
|
||||
|
||||
/**
|
||||
* @ingroup functions
|
||||
*
|
||||
* Prototype of a callback function used to execute additional user code with signal information as provided
|
||||
* by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk.
|
||||
*
|
||||
* @param info The signal info.
|
||||
* @param uap The crash's threads context.
|
||||
* @param context The API client's supplied context value.
|
||||
*
|
||||
* @sa @ref async_safety
|
||||
* @sa PLCrashReporter::setPostCrashCallbacks:
|
||||
*/
|
||||
typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context);
|
||||
|
||||
/**
|
||||
* @ingroup types
|
||||
*
|
||||
* This structure contains callbacks supported by PLCrashReporter to allow the host application to perform
|
||||
* additional tasks prior to program termination after a crash has occured.
|
||||
*
|
||||
* @sa @ref async_safety
|
||||
*/
|
||||
typedef struct PLCrashReporterCallbacks {
|
||||
/** The version number of this structure. If not one of the defined version numbers for this type, the behavior
|
||||
* is undefined. The current version of this structure is 0. */
|
||||
uint16_t version;
|
||||
|
||||
/** An arbitrary user-supplied context value. This value may be NULL. */
|
||||
void *context;
|
||||
|
||||
/**
|
||||
* The callback used to report caught signal information. In version 0 of this structure, all crashes will be
|
||||
* reported via this function.
|
||||
*
|
||||
* @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived
|
||||
* from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via
|
||||
* PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will
|
||||
* not provide valid thread state.
|
||||
*
|
||||
* This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained
|
||||
* here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions.
|
||||
*/
|
||||
PLCrashReporterPostCrashSignalCallback handleSignal;
|
||||
} PLCrashReporterCallbacks;
|
||||
|
||||
@interface PLCrashReporter : NSObject {
|
||||
@private
|
||||
/** Reporter configuration */
|
||||
PLCrashReporterConfig *_config;
|
||||
|
||||
/** YES if the crash reporter has been enabled */
|
||||
BOOL _enabled;
|
||||
|
||||
#if PLCRASH_FEATURE_MACH_EXCEPTIONS
|
||||
/** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if
|
||||
* the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */
|
||||
PLCrashMachExceptionServer *_machServer;
|
||||
|
||||
/** Previously registered Mach exception ports, if any. */
|
||||
PLCrashMachExceptionPortSet *_previousMachPorts;
|
||||
#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */
|
||||
|
||||
/** Application identifier */
|
||||
NSString *_applicationIdentifier;
|
||||
|
||||
/** Application version */
|
||||
NSString *_applicationVersion;
|
||||
|
||||
/** Application marketing version */
|
||||
NSString *_applicationMarketingVersion;
|
||||
|
||||
/** Path to the crash reporter internal data directory */
|
||||
NSString *_crashReportDirectory;
|
||||
}
|
||||
|
||||
+ (PLCrashReporter *) sharedReporter;
|
||||
|
||||
- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config;
|
||||
|
||||
- (BOOL) hasPendingCrashReport;
|
||||
|
||||
- (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;
|
||||
|
||||
- (BOOL) enableCrashReporter;
|
||||
- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError;
|
||||
|
||||
- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks;
|
||||
|
||||
@end
|
|
@ -1,165 +0,0 @@
|
|||
/*
|
||||
* Author: Landon Fuller <landonf@plausible.coop>
|
||||
*
|
||||
* Copyright (c) 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 "PLCrashFeatureConfig.h"
|
||||
|
||||
/**
|
||||
* @ingroup enums
|
||||
* Supported mechanisms for trapping and handling crashes.
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) {
|
||||
/**
|
||||
* Trap fatal signals via a sigaction(2)-registered BSD signal handler.
|
||||
*
|
||||
* PLCrashReporter's signal handler will supersede previously registered handlers; existing
|
||||
* handlers will not be called. This behavior may be modified in a future release, and should
|
||||
* not be relied upon as a mechanism to prevent existing signal handlers from being called.
|
||||
*
|
||||
* There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically:
|
||||
*
|
||||
* - On Mac OS X, stack overflows will only be handled on the thread on which
|
||||
* the crash reporter was initialized. This should generally be the main thread.
|
||||
* - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being
|
||||
* non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS).
|
||||
* - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting
|
||||
* in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal
|
||||
* handlers prior to raising SIGABRT). These __abort()-based checks are:
|
||||
* - Implemented for unsafe memcpy/strcpy/snprintf C functions.
|
||||
* - Only enabled when operating on a fixed-width target buffer (in which case the
|
||||
* compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument).
|
||||
* - Only trigger in the case that the source data exceeds the size of the fixed width target
|
||||
* buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy),
|
||||
* or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer),
|
||||
* AND that argument can't be checked at compile-time.
|
||||
*/
|
||||
PLCrashReporterSignalHandlerTypeBSD = 0,
|
||||
|
||||
#if PLCRASH_FEATURE_MACH_EXCEPTIONS
|
||||
/**
|
||||
* Trap fatal signals via a Mach exception server.
|
||||
*
|
||||
* If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that
|
||||
* exception handler. Should the exceptions be handled by an existing handler, no report will be generated
|
||||
* by PLCrashReporter.
|
||||
*
|
||||
* @par Mac OS X
|
||||
*
|
||||
* On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note,
|
||||
* however, that some kernel-internal constants, as well as architecture-specific trap information,
|
||||
* may be required to fully interpret a Mach exception's root cause.
|
||||
*
|
||||
* @par iOS
|
||||
*
|
||||
* On iOS, the APIs required for a complete implementation are not fully public.
|
||||
*
|
||||
* The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to
|
||||
* implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included
|
||||
* Mach exception handling as an optional feature, with both build-time and runtime configuration
|
||||
* to disable its inclusion or use, respectively.
|
||||
*
|
||||
* @par Debugger Incompatibility
|
||||
*
|
||||
* The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to
|
||||
* suspend all active threads (which will include the Mach exception handler). Mach-based handling
|
||||
* should not be used when a debugger is attached.
|
||||
*
|
||||
* @par More Details
|
||||
*
|
||||
* For more information, refer to @ref mach_exceptions.
|
||||
*/
|
||||
PLCrashReporterSignalHandlerTypeMach = 1
|
||||
#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup enums
|
||||
* Supported mechanisms for performing local symbolication.
|
||||
*
|
||||
* Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may
|
||||
* return information that is incorrect. This may still be useful in the case where DWARF data is unavailable
|
||||
* for a given build; in that case, it can provide function and method names (though not line numbers) for a
|
||||
* crash report that may otherwise be unusable.
|
||||
*
|
||||
* Note, however, this comes at the cost of a significant increase in code that must run within the critical
|
||||
* crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In
|
||||
* addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may
|
||||
* change in future iOS releases. Given that DWARF symbolication data will <em>always</em> be more accurate, and
|
||||
* the risks inherent in executing considerably more code at crash time, it is strongly recommended that local
|
||||
* symbolication only be enabled for non-release builds.
|
||||
*
|
||||
* Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the
|
||||
* results.
|
||||
*/
|
||||
typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) {
|
||||
/** No symbolication. */
|
||||
PLCrashReporterSymbolicationStrategyNone = 0,
|
||||
|
||||
/**
|
||||
* Use the standard binary symbol table. On iOS, this alone will return
|
||||
* incomplete results, as most symbols are rewritten to the common '\<redacted>' string.
|
||||
*/
|
||||
PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0,
|
||||
|
||||
/**
|
||||
* Use Objective-C metadata to find method and class names. This relies on detailed parsing
|
||||
* of the Objective-C runtime data, including undefined flags and other runtime internals. As such,
|
||||
* it may return incorrect data should the runtime be changed incompatibly.
|
||||
*/
|
||||
PLCrashReporterSymbolicationStrategyObjC = 1 << 1,
|
||||
|
||||
/**
|
||||
* Enable all available symbolication strategies.
|
||||
*/
|
||||
PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC)
|
||||
};
|
||||
|
||||
@interface PLCrashReporterConfig : NSObject {
|
||||
@private
|
||||
/** The configured signal handler type. */
|
||||
PLCrashReporterSignalHandlerType _signalHandlerType;
|
||||
|
||||
/** The configured symbolication strategy. */
|
||||
PLCrashReporterSymbolicationStrategy _symbolicationStrategy;
|
||||
}
|
||||
|
||||
+ (instancetype) defaultConfiguration;
|
||||
|
||||
- (instancetype) init;
|
||||
- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType
|
||||
symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy;
|
||||
|
||||
/** The configured signal handler type. */
|
||||
@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType;
|
||||
|
||||
/** The configured symbolication strategy. */
|
||||
@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy;
|
||||
|
||||
|
||||
@end
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>14C109</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>CrashReporter</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>coop.plausible.CrashReporter</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>CrashReporter</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>6A2008a</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>14A382</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.10</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0611</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>6A2008a</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1 +0,0 @@
|
|||
A
|
Загрузка…
Ссылка в новой задаче