9
9
from lldb .macosx .crashlog import CrashLog ,CrashLogParser
10
10
11
11
class CrashLogScriptedProcess (ScriptedProcess ):
12
- def parse_crashlog (self ):
13
- crashlog_parser = CrashLogParser .create (self .dbg , self .crashlog_path , False )
14
- crash_log = crashlog_parser .parse ()
15
-
16
- self .pid = crash_log .process_id
17
- self .addr_mask = crash_log .addr_mask
18
- self .crashed_thread_idx = crash_log .crashed_thread_idx
12
+ def set_crashlog (self , crashlog ):
13
+ self .crashlog = crashlog
14
+ self .pid = self .crashlog .process_id
15
+ self .addr_mask = self .crashlog .addr_mask
16
+ self .crashed_thread_idx = self .crashlog .crashed_thread_idx
19
17
self .loaded_images = []
20
- self .exception = crash_log .exception
18
+ self .exception = self . crashlog .exception
21
19
self .app_specific_thread = None
22
- if hasattr (crash_log , 'asi' ):
23
- self .metadata ['asi' ] = crash_log .asi
24
- if hasattr (crash_log , 'asb' ):
25
- self .extended_thread_info = crash_log .asb
20
+ if hasattr (self . crashlog , 'asi' ):
21
+ self .metadata ['asi' ] = self . crashlog .asi
22
+ if hasattr (self . crashlog , 'asb' ):
23
+ self .extended_thread_info = self . crashlog .asb
26
24
27
25
def load_images (self , images ):
28
26
#TODO: Add to self.loaded_images and load images in lldb
@@ -38,12 +36,12 @@ def load_images(self, images):
38
36
else :
39
37
self .loaded_images .append (image )
40
38
41
- for thread in crash_log .threads :
39
+ for thread in self . crashlog .threads :
42
40
if self .load_all_images :
43
- load_images (self , crash_log .images )
41
+ load_images (self , self . crashlog .images )
44
42
elif thread .did_crash ():
45
43
for ident in thread .idents :
46
- load_images (self , crash_log .find_images_with_identifier (ident ))
44
+ load_images (self , self . crashlog .find_images_with_identifier (ident ))
47
45
48
46
if hasattr (thread , 'app_specific_backtrace' ) and thread .app_specific_backtrace :
49
47
# We don't want to include the Application Specific Backtrace
@@ -92,7 +90,6 @@ def __init__(self, exe_ctx: lldb.SBExecutionContext, args : lldb.SBStructuredDat
92
90
self .crashed_thread_idx = 0
93
91
self .exception = None
94
92
self .extended_thread_info = None
95
- self .parse_crashlog ()
96
93
97
94
def read_memory_at_address (self , addr : int , size : int , error : lldb .SBError ) -> lldb .SBData :
98
95
# NOTE: CrashLogs don't contain any memory.
0 commit comments