@@ -680,7 +680,7 @@ def interactive_crashlogs(options, args):
680
680
interpreter .cmdloop ()
681
681
682
682
683
- def save_crashlog (debugger , command , result , dict ):
683
+ def save_crashlog (debugger , command , exe_ctx , result , dict ):
684
684
usage = "usage: %prog [options] <output-path>"
685
685
description = '''Export the state of current target into a crashlog file'''
686
686
parser = optparse .OptionParser (
@@ -709,11 +709,12 @@ def save_crashlog(debugger, command, result, dict):
709
709
"error: failed to open file '%s' for writing..." ,
710
710
args [0 ])
711
711
return
712
- target = debugger . GetSelectedTarget ()
712
+ target = exe_ctx . target
713
713
if target :
714
714
identifier = target .executable .basename
715
- if lldb .process :
716
- pid = lldb .process .id
715
+ process = exe_ctx .process
716
+ if process :
717
+ pid = process .id
717
718
if pid != lldb .LLDB_INVALID_PROCESS_ID :
718
719
out_file .write (
719
720
'Process: %s [%u]\n ' %
@@ -726,8 +727,8 @@ def save_crashlog(debugger, command, result, dict):
726
727
'OS Version: Mac OS X %s (%s)\n ' %
727
728
(platform .mac_ver ()[0 ], commands .getoutput ('sysctl -n kern.osversion' )))
728
729
out_file .write ('Report Version: 9\n ' )
729
- for thread_idx in range (lldb . process .num_threads ):
730
- thread = lldb . process .thread [thread_idx ]
730
+ for thread_idx in range (process .num_threads ):
731
+ thread = process .thread [thread_idx ]
731
732
out_file .write ('\n Thread %u:\n ' % (thread_idx ))
732
733
for (frame_idx , frame ) in enumerate (thread .frames ):
733
734
frame_pc = frame .pc
0 commit comments