2010-04-25 03:21:00 +04:00
|
|
|
/*
|
|
|
|
* Author: Damian Morris <damian@moso.com.au>
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010 MOSO Corporation, Pty Ltd.
|
2013-01-02 02:02:34 +04:00
|
|
|
* Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc.
|
2010-04-25 03:21:00 +04:00
|
|
|
*
|
|
|
|
* 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 "PLCrashReportProcessInfo.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Crash log process data.
|
|
|
|
*
|
|
|
|
* Provides the process name, ID, path, parent process name and ID for the crashed
|
|
|
|
* application process.
|
|
|
|
*/
|
2023-07-07 18:35:04 +03:00
|
|
|
@implementation PLCrashReportProcessInfo {
|
2023-07-19 17:19:50 +03:00
|
|
|
|
2023-07-07 18:35:04 +03:00
|
|
|
/** Process name, or nil if unavailable. */
|
|
|
|
__strong NSString *_processName;
|
|
|
|
|
|
|
|
/** Process ID */
|
|
|
|
NSUInteger _processID;
|
|
|
|
|
|
|
|
/** Process path */
|
|
|
|
__strong NSString* _processPath;
|
|
|
|
|
|
|
|
/** Date and time that the crashing process was started. This may be unavailable, and this property
|
|
|
|
* will be nil. */
|
|
|
|
__strong NSDate *_processStartTime;
|
|
|
|
|
|
|
|
/** Parent process name, or nil if unavailable. */
|
|
|
|
__strong NSString *_parentProcessName;
|
|
|
|
|
|
|
|
/** Parent process ID */
|
|
|
|
NSUInteger _parentProcessID;
|
|
|
|
|
|
|
|
/** If false, the process is being run via process-level CPU emulation (such as Rosetta). */
|
|
|
|
BOOL _native;
|
|
|
|
}
|
2010-04-25 03:21:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize with the provided process details.
|
|
|
|
*
|
|
|
|
* @param processName Process name. May be nil.
|
|
|
|
* @param processID Process PID.
|
|
|
|
* @param processPath Full path to the process' binary. May be nil.
|
2013-07-11 00:41:21 +04:00
|
|
|
* @param processStartTime Date and time that the crashing process was started. May be nil.
|
2010-04-25 03:21:00 +04:00
|
|
|
* @param parentProcessName Parent process' name. May be nil.
|
|
|
|
* @param parentProcessID Parent process' PID.
|
2013-07-17 21:36:38 +04:00
|
|
|
* @param native Flag designating whether this process is native. If false, the process is being run via process-level
|
2011-06-12 04:30:21 +04:00
|
|
|
* CPU emulation (such as Rosetta).
|
2010-04-25 03:21:00 +04:00
|
|
|
*/
|
|
|
|
- (id) initWithProcessName: (NSString *) processName
|
|
|
|
processID: (NSUInteger) processID
|
|
|
|
processPath: (NSString *) processPath
|
2013-07-11 00:41:21 +04:00
|
|
|
processStartTime: (NSDate *) processStartTime
|
2010-04-25 03:21:00 +04:00
|
|
|
parentProcessName: (NSString *) parentProcessName
|
|
|
|
parentProcessID: (NSUInteger) parentProcessID
|
2011-06-12 04:30:21 +04:00
|
|
|
native: (BOOL) native
|
2010-04-25 03:21:00 +04:00
|
|
|
{
|
|
|
|
if ((self = [super init]) == nil)
|
|
|
|
return nil;
|
|
|
|
|
2020-04-27 14:46:56 +03:00
|
|
|
_processName = processName;
|
2010-04-25 03:21:00 +04:00
|
|
|
_processID = processID;
|
2020-04-27 14:46:56 +03:00
|
|
|
_processPath = processPath;
|
|
|
|
_processStartTime = processStartTime;
|
|
|
|
_parentProcessName = parentProcessName;
|
2010-04-25 03:21:00 +04:00
|
|
|
_parentProcessID = parentProcessID;
|
2011-06-12 04:30:21 +04:00
|
|
|
_native = native;
|
|
|
|
|
2010-04-25 03:21:00 +04:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
@synthesize processName = _processName;
|
|
|
|
@synthesize processID = _processID;
|
|
|
|
@synthesize processPath = _processPath;
|
2013-07-11 00:41:21 +04:00
|
|
|
@synthesize processStartTime = _processStartTime;
|
2010-04-25 03:21:00 +04:00
|
|
|
@synthesize parentProcessName = _parentProcessName;
|
|
|
|
@synthesize parentProcessID = _parentProcessID;
|
2011-06-12 04:30:21 +04:00
|
|
|
@synthesize native = _native;
|
2010-04-25 03:21:00 +04:00
|
|
|
|
|
|
|
@end
|