Skip to content

Commit cc03923

Browse files
committed
Merge remote-tracking branch 'origin/swift-4.1-branch' into stable
2 parents def7eb4 + 9a68c85 commit cc03923

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

examples/python/crashlog.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def interactive_crashlogs(options, args):
680680
interpreter.cmdloop()
681681

682682

683-
def save_crashlog(debugger, command, result, dict):
683+
def save_crashlog(debugger, command, exe_ctx, result, dict):
684684
usage = "usage: %prog [options] <output-path>"
685685
description = '''Export the state of current target into a crashlog file'''
686686
parser = optparse.OptionParser(
@@ -709,11 +709,12 @@ def save_crashlog(debugger, command, result, dict):
709709
"error: failed to open file '%s' for writing...",
710710
args[0])
711711
return
712-
target = debugger.GetSelectedTarget()
712+
target = exe_ctx.target
713713
if target:
714714
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
717718
if pid != lldb.LLDB_INVALID_PROCESS_ID:
718719
out_file.write(
719720
'Process: %s [%u]\n' %
@@ -726,8 +727,8 @@ def save_crashlog(debugger, command, result, dict):
726727
'OS Version: Mac OS X %s (%s)\n' %
727728
(platform.mac_ver()[0], commands.getoutput('sysctl -n kern.osversion')))
728729
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]
731732
out_file.write('\nThread %u:\n' % (thread_idx))
732733
for (frame_idx, frame) in enumerate(thread.frames):
733734
frame_pc = frame.pc

0 commit comments

Comments
 (0)