99from lldb .macosx .crashlog import CrashLog ,CrashLogParser
1010
1111class 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
1917 self .loaded_images = []
20- self .exception = crash_log .exception
18+ self .exception = self . crashlog .exception
2119 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
2624
2725 def load_images (self , images ):
2826 #TODO: Add to self.loaded_images and load images in lldb
@@ -38,12 +36,12 @@ def load_images(self, images):
3836 else :
3937 self .loaded_images .append (image )
4038
41- for thread in crash_log .threads :
39+ for thread in self . crashlog .threads :
4240 if self .load_all_images :
43- load_images (self , crash_log .images )
41+ load_images (self , self . crashlog .images )
4442 elif thread .did_crash ():
4543 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 ))
4745
4846 if hasattr (thread , 'app_specific_backtrace' ) and thread .app_specific_backtrace :
4947 # We don't want to include the Application Specific Backtrace
@@ -92,7 +90,6 @@ def __init__(self, exe_ctx: lldb.SBExecutionContext, args : lldb.SBStructuredDat
9290 self .crashed_thread_idx = 0
9391 self .exception = None
9492 self .extended_thread_info = None
95- self .parse_crashlog ()
9693
9794 def read_memory_at_address (self , addr : int , size : int , error : lldb .SBError ) -> lldb .SBData :
9895 # NOTE: CrashLogs don't contain any memory.
0 commit comments