[Lldb-commits] [lldb] r315549 - The save_crashlog command was still looking at lldb.target and

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 11 19:21:41 PDT 2017


Author: jingham
Date: Wed Oct 11 19:21:41 2017
New Revision: 315549

URL: http://llvm.org/viewvc/llvm-project?rev=315549&view=rev
Log:
The save_crashlog command was still looking at lldb.target and
lldb.process.  That hasn't worked for a long time.  Convert it
to the form that takes an SBExecutionContext and use that instead.

Modified:
    lldb/trunk/examples/python/crashlog.py

Modified: lldb/trunk/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=315549&r1=315548&r2=315549&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Wed Oct 11 19:21:41 2017
@@ -680,7 +680,7 @@ def interactive_crashlogs(options, args)
     interpreter.cmdloop()
 
 
-def save_crashlog(debugger, command, result, dict):
+def save_crashlog(debugger, command, exe_ctx, result, dict):
     usage = "usage: %prog [options] <output-path>"
     description = '''Export the state of current target into a crashlog file'''
     parser = optparse.OptionParser(
@@ -709,11 +709,12 @@ def save_crashlog(debugger, command, res
             "error: failed to open file '%s' for writing...",
             args[0])
         return
-    target = debugger.GetSelectedTarget()
+    target = exe_ctx.target
     if target:
         identifier = target.executable.basename
-        if lldb.process:
-            pid = lldb.process.id
+        process = exe_ctx.process
+        if process:
+            pid = process.id
             if pid != lldb.LLDB_INVALID_PROCESS_ID:
                 out_file.write(
                     'Process:         %s [%u]\n' %
@@ -726,8 +727,8 @@ def save_crashlog(debugger, command, res
             'OS Version:      Mac OS X %s (%s)\n' %
             (platform.mac_ver()[0], commands.getoutput('sysctl -n kern.osversion')))
         out_file.write('Report Version:  9\n')
-        for thread_idx in range(lldb.process.num_threads):
-            thread = lldb.process.thread[thread_idx]
+        for thread_idx in range(process.num_threads):
+            thread = process.thread[thread_idx]
             out_file.write('\nThread %u:\n' % (thread_idx))
             for (frame_idx, frame) in enumerate(thread.frames):
                 frame_pc = frame.pc




More information about the lldb-commits mailing list