[Lldb-commits] [lldb] r183289 - Small changes to diagnose_unwind. Correctly provide help text.

Jason Molenda jmolenda at apple.com
Tue Jun 4 19:56:58 PDT 2013


Author: jmolenda
Date: Tue Jun  4 21:56:58 2013
New Revision: 183289

URL: http://llvm.org/viewvc/llvm-project?rev=183289&view=rev
Log:
Small changes to diagnose_unwind.  Correctly provide help text.
Print the lldb version at the top of the output.


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

Modified: lldb/trunk/examples/python/diagnose_unwind.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/diagnose_unwind.py?rev=183289&r1=183288&r2=183289&view=diff
==============================================================================
--- lldb/trunk/examples/python/diagnose_unwind.py (original)
+++ lldb/trunk/examples/python/diagnose_unwind.py Tue Jun  4 21:56:58 2013
@@ -1,8 +1,10 @@
-# This implements the "diagnose-unwind" command, usually installed in the debug session like
+# This implements the "diagnose-unwind" command, usually installed
+# in the debug session like
 #   command script import lldb.diagnose
-# it is used when lldb's backtrace fails -- it collects and prints information about the stack frames,
-# and tries an alternate unwind algorithm, that will help to understand why lldb's unwind algorithm did
-# not succeed.
+# it is used when lldb's backtrace fails -- it collects and prints
+# information about the stack frames, and tries an alternate unwind
+# algorithm, that will help to understand why lldb's unwind algorithm
+# did not succeed.
 
 import optparse
 import lldb
@@ -88,8 +90,14 @@ def simple_backtrace(debugger):
   backtrace_print_frame (target, frame_num, cur_pc, cur_fp)
 
 def diagnose_unwind(debugger, command, result, dict):
-  # Use the Shell Lexer to properly parse up command options just like a
-  # shell would
+  """
+Gather diagnostic information to help debug incorrect unwind (backtrace) 
+behavior in lldb.  When there is a backtrace that doesn't look
+correct, run this command with the correct thread selected and a
+large amount of diagnostic information will be printed, it is likely
+to be helpful when reporting the problem.
+  """
+
   command_args = shlex.split(command)
   parser = create_diagnose_unwind_options()
   try:
@@ -110,6 +118,7 @@ def diagnose_unwind(debugger, command, r
         if len(lldb_versions_match.groups()) >= 5 and lldb_versions_match.groups()[4]:
           lldb_minor = int(lldb_versions_match.groups()[4])
 
+        print 'LLDB version %s' % debugger.GetVersionString()
         print 'Unwind diagnostics for thread %d' % thread.GetIndexID()
         print ""
         print "lldb's unwind algorithm:"





More information about the lldb-commits mailing list