Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 832

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
diff --git a/CrashReporter.framework/CrashReporter b/CrashReporter.framework/CrashReporter new file mode 120000 index 0000000..92b400e --- /dev/null +++ b/CrashReporter.framework/CrashReporter @@ -0,0 +1 @@ +Versions/Current/CrashReporter \ No newline at end of file diff --git a/CrashReporter.framework/Headers b/CrashReporter.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/CrashReporter.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/CrashReporter.framework/Resources b/CrashReporter.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/CrashReporter.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/CrashReporter.framework/Versions/A/CrashReporter b/CrashReporter.framework/Versions/A/CrashReporter new file mode 100644 index 0000000..0150849 Binary files /dev/null and b/CrashReporter.framework/Versions/A/CrashReporter differ diff --git a/CrashReporter.framework/Versions/A/Headers/CrashReporter.h b/CrashReporter.framework/Versions/A/Headers/CrashReporter.h new file mode 100644 index 0000000..c654319 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/CrashReporter.h @@ -0,0 +1,363 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#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 google protobuf, 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 + * CERT programming guide - SIG30-C + * + * 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: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited 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. + */ diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h new file mode 100644 index 0000000..15f12a8 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h @@ -0,0 +1,58 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_ASYNC_SIGNAL_INFO_H +#define PLCRASH_ASYNC_SIGNAL_INFO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @internal + * + * @defgroup plcrash_async_signal_info Signal Information + * @ingroup plcrash_async + * + * Provides mapping of signal number and code to strings. + * + * @{ + */ + +const char *plcrash_async_signal_signame (int signal); +const char *plcrash_async_signal_sigcode (int signal, int si_code); + +/** + * @} plcrash_async_signal_info + */ + +#ifdef __cplusplus +} +#endif + +#endif /* PLCRASH_ASYNC_SIGNAL_INFO_H */ diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h b/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..a488048 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,104 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @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 */ diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h b/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..571d0a2 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h @@ -0,0 +1,80 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + +#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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h new file mode 100644 index 0000000..a179cd6 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h @@ -0,0 +1,200 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#import "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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..0f84c89 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,53 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + NSString *_applicationIdentifier; + + /** Application version */ + NSString *_applicationVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion; + +/** + * 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; + +@end diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..339fdbb --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,90 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..623b1d4 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,65 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..77c2029 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h @@ -0,0 +1,51 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#import "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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..a9d7f7c --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * 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 + +@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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..4d0597c --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,73 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#import "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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..f1bd051 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * 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 + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name */ + 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 */ + 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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..20b618d --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..2c5c5fe --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..997e762 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import "PLCrashReportSymbolInfo.h" + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..c6ceb6c --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..e98c969 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,145 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +/** + * @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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..2ba7e35 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,62 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * 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 + +#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 { +@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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..04c8604 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h new file mode 100644 index 0000000..88824a6 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h @@ -0,0 +1,133 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#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; + + /** 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 diff --git a/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h b/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..82f0bd9 --- /dev/null +++ b/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h @@ -0,0 +1,165 @@ +/* + * Author: Landon Fuller + * + * 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 +#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 always 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 '\' 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 + diff --git a/CrashReporter.framework/Versions/A/Resources/Info.plist b/CrashReporter.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..c147c0f --- /dev/null +++ b/CrashReporter.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,38 @@ + + + + + BuildMachineOSBuild + 13B42 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + coop.plausible.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A3005 + DTPlatformVersion + GM + DTSDKBuild + 13A595 + DTSDKName + macosx10.9 + DTXcode + 0502 + DTXcodeBuild + 5A3005 + + diff --git a/CrashReporter.framework/Versions/Current b/CrashReporter.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/CrashReporter.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Podfile.lock b/Podfile.lock index f97acdd..7c07c0b 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -17,4 +17,4 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: SwiftyJSON: ae2d0a3d68025d136602a33c4ee215091ced3e33 -COCOAPODS: 0.38.2 +COCOAPODS: 0.39.0 diff --git a/README.md b/README.md index af86e8e..d62d85b 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,32 @@ -Swift Weather -============ -[![BuddyBuild](https://dashboard.buddybuild.com/api/statusImage?appID=562a9aac2492560100211378&branch=master&build=latest)](https://dashboard.buddybuild.com/apps/562a9aac2492560100211378/build/latest) - -SwiftWeather is an iOS weather app developed in Swift 2. The app has been actively upgrading to adopt the latest features of iOS and Swift language. - -## Notices -The current version is working with Xcode Version 7. If you are using different Xcode version, please check out the previous versions. - -## Version 3 -This version has been upgraded to support iOS 9 only using Swift 2. - -There are two major version for the app released before. - -* V1.0 - Support iOS 7+ using CocoaPods and AFNetworking. [README.v1.md](https://github.com/JakeLin/SwiftWeather/blob/master/README.v1.md) and [Release V1 - Using Cocoapods and AFNetworking](https://github.com/JakeLin/SwiftWeather/releases/tag/V1) -* V2.0 - Support iOS 8+ using Carthage, Alamofire and SwiftyJSON. [README.v2.md](https://github.com/JakeLin/SwiftWeather/blob/master/README.v2.md) and [Release V2.0](https://github.com/JakeLin/SwiftWeather/releases/tag/v2.0) -* V2.1 - Support iOS 8+ using Alamofire and SwiftyJSON. This version has removed Carthage because some developers don't have a paid Apple iOS developer account and they have issues to build Carthage packages. - - -## Screenshots - - -## Features -* Swift Programming Language - fully upgraded to version 2 -* Design driven development - [Sketch design file ](https://raw.githubusercontent.com/JakeLin/SwiftWeather/master/Design/SwiftWeather.sketch) - -![Sketch design](https://raw.githubusercontent.com/JakeLin/SwiftWeather/master/screenshots/SketchDesign.png) - -* Custom UIView - -![Custom UIView](https://raw.githubusercontent.com/JakeLin/SwiftWeather/master/screenshots/Custom-UIView.png) - -* `@IBDesignable` and `@IBInspectable` - Reusable UI components - -![IBDesignable and IBInspectable](https://raw.githubusercontent.com/JakeLin/SwiftWeather/master/screenshots/IBDesignable-IBInspectable.png) - -* `UIStackView` - -![UIStackView](https://raw.githubusercontent.com/JakeLin/SwiftWeather/master/screenshots/UIStackView.png) - -* Size Classes - Support different devices with adpative layout - -![Size Classes](https://raw.githubusercontent.com/JakeLin/SwiftWeather/master/screenshots/UIStackView-with-Size-Classes.png) - -* MVVM - Reactively update `ViewController` UI from `ViewModel` - -* Protocal oriented programming - Still learning though and finding the best practise of that. - -* Value based programming - Use imutable value anywhere. - -* Icon fonts - Use [Weather Icons](https://erikflowers.github.io/weather-icons/) - -* [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) - -* Core Location - -## TODO -* App indexing like CoreSpotlight ans `NSUserActivity` -* Unit Tests -* UI Tests -* Animations - -## How to build - -1) Clone the repository - -``` -$ git clone https://github.com/JakeLin/SwiftWeather.git -$ cd SwiftWeather -``` - -2) Install pods - -``` -$ pod install -``` - -3) Open the workspace in Xcode - -``` -$ open "SwiftWeather.xcworkspace" -``` - -4) Compile and run the app in your simulator - -# Requirements - -* Xcode 7 -* iOS 9 +This is a fork of [JakeLin/SwiftWeather](https://github.com/JakeLin/SwiftWeather). Here are the steps I took to get Rollbar integrated into the project *without* cocoapods: + + 1. Download the [Rollbar Framework Files](https://github.com/rollbar/rollbar-ios/releases/download/v0.1.5/Rollbar.zip) + 2. Open XCode and Drag the (unzipped) framework files into your solution. + 3. If you don't have a bridging file already correctly working: + * Add an objective-c (.m) file. + * XCode will prompt you to create a bridging file, allow it to do so. + * Open the bridinging file, and add the following lines: + ```objective-c + #ifndef ContextJar_Bridging_Header_h + + #define ContextJar_Bridging_Header_h + + #import + #import + + #endif /* ContextJar_Bridging_Header_h */ + ``` + 4. Initialize Rollbar in AppDelegate like so: + ```swift + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + let config: RollbarConfiguration = RollbarConfiguration() + config.environment = "production" + + Rollbar.initWithAccessToken("YOUR ACCESS TOKEN", configuration: config) + + return true + } + ``` + 5. Now Any Uncaught Objective C style errors will be automatically reported to rollbar + 6. You can use `Rollbar.logWithLevel` to report Swift Style errors manually diff --git a/Rollbar.framework/Headers b/Rollbar.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Rollbar.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Rollbar.framework/Rollbar b/Rollbar.framework/Rollbar new file mode 120000 index 0000000..fb55402 --- /dev/null +++ b/Rollbar.framework/Rollbar @@ -0,0 +1 @@ +Versions/Current/Rollbar \ No newline at end of file diff --git a/Rollbar.framework/Versions/A/Headers/Rollbar.h b/Rollbar.framework/Versions/A/Headers/Rollbar.h new file mode 100644 index 0000000..5466f78 --- /dev/null +++ b/Rollbar.framework/Versions/A/Headers/Rollbar.h @@ -0,0 +1,45 @@ +// +// Rollbar.h +// Rollbar +// +// Created by Sergei Bezborodko on 3/18/14. +// Copyright (c) 2014 Rollbar, Inc. All rights reserved. +// + +#import +#import "RollbarConfiguration.h" + +@interface Rollbar : NSObject + ++ (void)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration + enableCrashReporter:(BOOL)enable; ++ (void)initWithAccessToken:(NSString*)accessToken; ++ (void)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration; + ++ (RollbarConfiguration*)currentConfiguration; + ++ (void)logWithLevel:(NSString*)level message:(NSString*)message; ++ (void)logWithLevel:(NSString*)level message:(NSString*)message data:(NSDictionary*)data; ++ (void)logWithLevel:(NSString*)level data:(NSDictionary*)data; + ++ (void)debugWithMessage:(NSString*)message; ++ (void)debugWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)debugWithData:(NSDictionary*)data; + ++ (void)infoWithMessage:(NSString*)message; ++ (void)infoWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)infoWithData:(NSDictionary*)data; + ++ (void)warningWithMessage:(NSString*)message; ++ (void)warningWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)warningWithData:(NSDictionary*)data; + ++ (void)errorWithMessage:(NSString*)message; ++ (void)errorWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)errorWithData:(NSDictionary*)data; + ++ (void)criticalWithMessage:(NSString*)message; ++ (void)criticalWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)criticalWithData:(NSDictionary*)data; + +@end diff --git a/Rollbar.framework/Versions/A/Headers/RollbarConfiguration.h b/Rollbar.framework/Versions/A/Headers/RollbarConfiguration.h new file mode 100644 index 0000000..2b467cd --- /dev/null +++ b/Rollbar.framework/Versions/A/Headers/RollbarConfiguration.h @@ -0,0 +1,36 @@ +// +// RollbarConfiguration.h +// Rollbar +// +// Created by Sergei Bezborodko on 3/21/14. +// Copyright (c) 2014 Rollbar, Inc. All rights reserved. +// + +#import + +@interface RollbarConfiguration : NSObject { + // Stores whether this configuration is the root level + // configuration used by the root level notifier + BOOL isRootConfiguration; +} + ++ (RollbarConfiguration*)configuration; + +- (id)initWithLoadedConfiguration; + +- (void)_setRoot; +- (void)save; + +- (void)setPersonId:(NSString*)personId username:(NSString*)username email:(NSString*)email; + +- (NSDictionary *)customData; + +@property (atomic, copy) NSString *accessToken; +@property (atomic, copy) NSString *environment; +@property (atomic, copy) NSString *endpoint; +@property (atomic, copy) NSString *crashLevel; +@property (readonly, atomic, copy) NSString *personId; +@property (readonly, atomic, copy) NSString *personUsername; +@property (readonly, atomic, copy) NSString *personEmail; + +@end diff --git a/Rollbar.framework/Versions/A/Rollbar b/Rollbar.framework/Versions/A/Rollbar new file mode 100644 index 0000000..65403c0 Binary files /dev/null and b/Rollbar.framework/Versions/A/Rollbar differ diff --git a/Rollbar.framework/Versions/Current b/Rollbar.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Rollbar.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Rollbar/CrashReporter.framework/CrashReporter b/Rollbar/CrashReporter.framework/CrashReporter new file mode 120000 index 0000000..92b400e --- /dev/null +++ b/Rollbar/CrashReporter.framework/CrashReporter @@ -0,0 +1 @@ +Versions/Current/CrashReporter \ No newline at end of file diff --git a/Rollbar/CrashReporter.framework/Headers b/Rollbar/CrashReporter.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Rollbar/CrashReporter.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Rollbar/CrashReporter.framework/Resources b/Rollbar/CrashReporter.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Rollbar/CrashReporter.framework/Versions/A/CrashReporter b/Rollbar/CrashReporter.framework/Versions/A/CrashReporter new file mode 100644 index 0000000..0150849 Binary files /dev/null and b/Rollbar/CrashReporter.framework/Versions/A/CrashReporter differ diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/CrashReporter.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/CrashReporter.h new file mode 100644 index 0000000..c654319 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/CrashReporter.h @@ -0,0 +1,363 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#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 google protobuf, 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 + * CERT programming guide - SIG30-C + * + * 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: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited 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. + */ diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h new file mode 100644 index 0000000..15f12a8 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashAsyncSignalInfo.h @@ -0,0 +1,58 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_ASYNC_SIGNAL_INFO_H +#define PLCRASH_ASYNC_SIGNAL_INFO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @internal + * + * @defgroup plcrash_async_signal_info Signal Information + * @ingroup plcrash_async + * + * Provides mapping of signal number and code to strings. + * + * @{ + */ + +const char *plcrash_async_signal_signame (int signal); +const char *plcrash_async_signal_sigcode (int signal, int si_code); + +/** + * @} plcrash_async_signal_info + */ + +#ifdef __cplusplus +} +#endif + +#endif /* PLCRASH_ASYNC_SIGNAL_INFO_H */ diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..a488048 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,104 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @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 */ diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..571d0a2 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h @@ -0,0 +1,80 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + +#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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h new file mode 100644 index 0000000..a179cd6 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h @@ -0,0 +1,200 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#import "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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..0f84c89 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,53 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + NSString *_applicationIdentifier; + + /** Application version */ + NSString *_applicationVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion; + +/** + * 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; + +@end diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..339fdbb --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,90 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..623b1d4 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,65 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..77c2029 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h @@ -0,0 +1,51 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#import "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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..a9d7f7c --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * 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 + +@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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..4d0597c --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,73 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#import "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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..f1bd051 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * 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 + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name */ + 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 */ + 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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..20b618d --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..2c5c5fe --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..997e762 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import "PLCrashReportSymbolInfo.h" + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..c6ceb6c --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..e98c969 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,145 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +/** + * @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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..2ba7e35 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,62 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * 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 + +#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 { +@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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..04c8604 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h new file mode 100644 index 0000000..88824a6 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h @@ -0,0 +1,133 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#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; + + /** 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 diff --git a/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..82f0bd9 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h @@ -0,0 +1,165 @@ +/* + * Author: Landon Fuller + * + * 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 +#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 always 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 '\' 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 + diff --git a/Rollbar/CrashReporter.framework/Versions/A/Resources/Info.plist b/Rollbar/CrashReporter.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..c147c0f --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,38 @@ + + + + + BuildMachineOSBuild + 13B42 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + coop.plausible.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 5A3005 + DTPlatformVersion + GM + DTSDKBuild + 13A595 + DTSDKName + macosx10.9 + DTXcode + 0502 + DTXcodeBuild + 5A3005 + + diff --git a/Rollbar/CrashReporter.framework/Versions/Current b/Rollbar/CrashReporter.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Rollbar/CrashReporter.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/Rollbar/Rollbar.framework/Headers b/Rollbar/Rollbar.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/Rollbar/Rollbar.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Rollbar/Rollbar.framework/Rollbar b/Rollbar/Rollbar.framework/Rollbar new file mode 120000 index 0000000..fb55402 --- /dev/null +++ b/Rollbar/Rollbar.framework/Rollbar @@ -0,0 +1 @@ +Versions/Current/Rollbar \ No newline at end of file diff --git a/Rollbar/Rollbar.framework/Versions/A/Headers/Rollbar.h b/Rollbar/Rollbar.framework/Versions/A/Headers/Rollbar.h new file mode 100644 index 0000000..5466f78 --- /dev/null +++ b/Rollbar/Rollbar.framework/Versions/A/Headers/Rollbar.h @@ -0,0 +1,45 @@ +// +// Rollbar.h +// Rollbar +// +// Created by Sergei Bezborodko on 3/18/14. +// Copyright (c) 2014 Rollbar, Inc. All rights reserved. +// + +#import +#import "RollbarConfiguration.h" + +@interface Rollbar : NSObject + ++ (void)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration + enableCrashReporter:(BOOL)enable; ++ (void)initWithAccessToken:(NSString*)accessToken; ++ (void)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration; + ++ (RollbarConfiguration*)currentConfiguration; + ++ (void)logWithLevel:(NSString*)level message:(NSString*)message; ++ (void)logWithLevel:(NSString*)level message:(NSString*)message data:(NSDictionary*)data; ++ (void)logWithLevel:(NSString*)level data:(NSDictionary*)data; + ++ (void)debugWithMessage:(NSString*)message; ++ (void)debugWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)debugWithData:(NSDictionary*)data; + ++ (void)infoWithMessage:(NSString*)message; ++ (void)infoWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)infoWithData:(NSDictionary*)data; + ++ (void)warningWithMessage:(NSString*)message; ++ (void)warningWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)warningWithData:(NSDictionary*)data; + ++ (void)errorWithMessage:(NSString*)message; ++ (void)errorWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)errorWithData:(NSDictionary*)data; + ++ (void)criticalWithMessage:(NSString*)message; ++ (void)criticalWithMessage:(NSString*)message data:(NSDictionary*)data; ++ (void)criticalWithData:(NSDictionary*)data; + +@end diff --git a/Rollbar/Rollbar.framework/Versions/A/Headers/RollbarConfiguration.h b/Rollbar/Rollbar.framework/Versions/A/Headers/RollbarConfiguration.h new file mode 100644 index 0000000..2b467cd --- /dev/null +++ b/Rollbar/Rollbar.framework/Versions/A/Headers/RollbarConfiguration.h @@ -0,0 +1,36 @@ +// +// RollbarConfiguration.h +// Rollbar +// +// Created by Sergei Bezborodko on 3/21/14. +// Copyright (c) 2014 Rollbar, Inc. All rights reserved. +// + +#import + +@interface RollbarConfiguration : NSObject { + // Stores whether this configuration is the root level + // configuration used by the root level notifier + BOOL isRootConfiguration; +} + ++ (RollbarConfiguration*)configuration; + +- (id)initWithLoadedConfiguration; + +- (void)_setRoot; +- (void)save; + +- (void)setPersonId:(NSString*)personId username:(NSString*)username email:(NSString*)email; + +- (NSDictionary *)customData; + +@property (atomic, copy) NSString *accessToken; +@property (atomic, copy) NSString *environment; +@property (atomic, copy) NSString *endpoint; +@property (atomic, copy) NSString *crashLevel; +@property (readonly, atomic, copy) NSString *personId; +@property (readonly, atomic, copy) NSString *personUsername; +@property (readonly, atomic, copy) NSString *personEmail; + +@end diff --git a/Rollbar/Rollbar.framework/Versions/A/Rollbar b/Rollbar/Rollbar.framework/Versions/A/Rollbar new file mode 100644 index 0000000..65403c0 Binary files /dev/null and b/Rollbar/Rollbar.framework/Versions/A/Rollbar differ diff --git a/Rollbar/Rollbar.framework/Versions/Current b/Rollbar/Rollbar.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/Rollbar/Rollbar.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/SwiftWeather-Bridging-Header.h b/SwiftWeather-Bridging-Header.h new file mode 100644 index 0000000..a6e1259 --- /dev/null +++ b/SwiftWeather-Bridging-Header.h @@ -0,0 +1,12 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#ifndef ContextJar_Bridging_Header_h + +#define ContextJar_Bridging_Header_h + +#import +#import + +#endif /* ContextJar_Bridging_Header_h */ diff --git a/SwiftWeather.xcodeproj/project.pbxproj b/SwiftWeather.xcodeproj/project.pbxproj index 86990e3..5161137 100644 --- a/SwiftWeather.xcodeproj/project.pbxproj +++ b/SwiftWeather.xcodeproj/project.pbxproj @@ -7,11 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - 47E92A220124B56850397BB2 /* Pods_SwiftWeather.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E01F72662147E87D287395 /* Pods_SwiftWeather.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - AE09C4301B9723DE00C7CCED /* LocationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE09C42F1B9723DE00C7CCED /* LocationService.swift */; settings = {ASSET_TAGS = (); }; }; + 47E92A220124B56850397BB2 /* Pods_SwiftWeather.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E01F72662147E87D287395 /* Pods_SwiftWeather.framework */; }; + 83D457D51C0E12A300919E15 /* CrashReporter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83D457D31C0E12A300919E15 /* CrashReporter.framework */; }; + 83D457D61C0E12A300919E15 /* Rollbar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83D457D41C0E12A300919E15 /* Rollbar.framework */; }; + AE09C4301B9723DE00C7CCED /* LocationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE09C42F1B9723DE00C7CCED /* LocationService.swift */; }; AE0DC2CD1B8E7B3900E67147 /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE0DC2CC1B8E7B3900E67147 /* Observable.swift */; }; AE26CCAB1B875C2400D518CB /* ForecastView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AE26CCAA1B875C2400D518CB /* ForecastView.xib */; }; - AE2C7D6C1BA028C000A7A714 /* WeatherIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE2C7D6B1BA028C000A7A714 /* WeatherIcon.swift */; settings = {ASSET_TAGS = (); }; }; + AE2C7D6C1BA028C000A7A714 /* WeatherIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE2C7D6B1BA028C000A7A714 /* WeatherIcon.swift */; }; AE6C34E91B84742900F726C2 /* weathericons-regular-webfont.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AE6C34E81B84742900F726C2 /* weathericons-regular-webfont.ttf */; }; AEBE643B1B8D1F90004A0814 /* ForecastViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEBE643A1B8D1F90004A0814 /* ForecastViewModel.swift */; }; AEBE643E1B8D2108004A0814 /* Forecast.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEBE643D1B8D2108004A0814 /* Forecast.swift */; }; @@ -25,10 +27,10 @@ AECBA5FB1B836BF20004A536 /* SwiftWeatherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AECBA5FA1B836BF20004A536 /* SwiftWeatherTests.swift */; }; AECBA6061B836BF20004A536 /* SwiftWeatherUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AECBA6051B836BF20004A536 /* SwiftWeatherUITests.swift */; }; AED4B2C21B876E8B0003D765 /* ForecastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AED4B2C01B876DF50003D765 /* ForecastView.swift */; }; - AEEDF6891B9F09E300C6067B /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEDF6881B9F09E300C6067B /* Error.swift */; settings = {ASSET_TAGS = (); }; }; - AEEDF68B1B9F99F800C6067B /* WeatherBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEDF68A1B9F99F800C6067B /* WeatherBuilder.swift */; settings = {ASSET_TAGS = (); }; }; - AEEDF68D1B9F9B2900C6067B /* Temperature.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEDF68C1B9F9B2900C6067B /* Temperature.swift */; settings = {ASSET_TAGS = (); }; }; - AEF61B281BA23B1200E8F259 /* ForecastDateTime.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF61B271BA23B1200E8F259 /* ForecastDateTime.swift */; settings = {ASSET_TAGS = (); }; }; + AEEDF6891B9F09E300C6067B /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEDF6881B9F09E300C6067B /* Error.swift */; }; + AEEDF68B1B9F99F800C6067B /* WeatherBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEDF68A1B9F99F800C6067B /* WeatherBuilder.swift */; }; + AEEDF68D1B9F9B2900C6067B /* Temperature.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEDF68C1B9F9B2900C6067B /* Temperature.swift */; }; + AEF61B281BA23B1200E8F259 /* ForecastDateTime.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF61B271BA23B1200E8F259 /* ForecastDateTime.swift */; }; CAB565DDADB61DF9053BD50F /* WeatherServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB56A3D23F4A93BB599E4BA /* WeatherServiceProtocol.swift */; }; CAB56F4267B3BC487990A92D /* OpenWeatherMapService.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB56D46471CA243B1FD646F /* OpenWeatherMapService.swift */; }; /* End PBXBuildFile section */ @@ -53,6 +55,9 @@ /* Begin PBXFileReference section */ 2A371C39E28FF7B95B5CF6ED /* Pods-SwiftWeather.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWeather.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftWeather/Pods-SwiftWeather.debug.xcconfig"; sourceTree = ""; }; 32E01F72662147E87D287395 /* Pods_SwiftWeather.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwiftWeather.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 83D457D31C0E12A300919E15 /* CrashReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CrashReporter.framework; sourceTree = ""; }; + 83D457D41C0E12A300919E15 /* Rollbar.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Rollbar.framework; sourceTree = ""; }; + 83D457D71C0E12D700919E15 /* SwiftWeather-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwiftWeather-Bridging-Header.h"; sourceTree = ""; }; 8FA2BD5A062481C5D83CDC17 /* Pods-SwiftWeather.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWeather.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwiftWeather/Pods-SwiftWeather.release.xcconfig"; sourceTree = ""; }; AE09C42F1B9723DE00C7CCED /* LocationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationService.swift; sourceTree = ""; }; AE0DC2CC1B8E7B3900E67147 /* Observable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Observable.swift; sourceTree = ""; }; @@ -91,6 +96,8 @@ buildActionMask = 2147483647; files = ( 47E92A220124B56850397BB2 /* Pods_SwiftWeather.framework in Frameworks */, + 83D457D61C0E12A300919E15 /* Rollbar.framework in Frameworks */, + 83D457D51C0E12A300919E15 /* CrashReporter.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -114,6 +121,8 @@ 55A8448042FE7DD1B099DE9F /* Frameworks */ = { isa = PBXGroup; children = ( + 83D457D31C0E12A300919E15 /* CrashReporter.framework */, + 83D457D41C0E12A300919E15 /* Rollbar.framework */, 32E01F72662147E87D287395 /* Pods_SwiftWeather.framework */, ); name = Frameworks; @@ -196,6 +205,7 @@ AECBA5E31B836BF20004A536 /* Products */, 634A94EE06FC450967999690 /* Pods */, 55A8448042FE7DD1B099DE9F /* Frameworks */, + 83D457D71C0E12D700919E15 /* SwiftWeather-Bridging-Header.h */, ); sourceTree = ""; }; @@ -326,6 +336,7 @@ AECBA5DA1B836BF20004A536 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0710; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Jake Lin"; TargetAttributes = { @@ -602,10 +613,17 @@ baseConfigurationReference = 2A371C39E28FF7B95B5CF6ED /* Pods-SwiftWeather.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); INFOPLIST_FILE = SwiftWeather/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.rushjet.SwiftWeather; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "SwiftWeather-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; @@ -614,10 +632,16 @@ baseConfigurationReference = 8FA2BD5A062481C5D83CDC17 /* Pods-SwiftWeather.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); INFOPLIST_FILE = SwiftWeather/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.rushjet.SwiftWeather; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "SwiftWeather-Bridging-Header.h"; }; name = Release; }; diff --git a/SwiftWeather/AppDelegate.swift b/SwiftWeather/AppDelegate.swift index c56be83..3ecef9f 100644 --- a/SwiftWeather/AppDelegate.swift +++ b/SwiftWeather/AppDelegate.swift @@ -16,6 +16,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. + let config: RollbarConfiguration = RollbarConfiguration() + config.environment = "production" + + Rollbar.initWithAccessToken("YOUR ACCESS TOKEN", configuration: config) + return true } diff --git a/SwiftWeather/WeatherViewModel.swift b/SwiftWeather/WeatherViewModel.swift index 2d70ea1..0314b24 100644 --- a/SwiftWeather/WeatherViewModel.swift +++ b/SwiftWeather/WeatherViewModel.swift @@ -78,7 +78,7 @@ class WeatherViewModel { case .JSONParsingFailed: self.errorMessage.value = "We're having trouble parsing weather data." } - + Rollbar.logWithLevel("warning", message: self.errorMessage.value) self.location.value = self.EmptyString self.iconText.value = self.EmptyString self.temperature.value = self.EmptyString