summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-06-05 02:56:58 +0000
committerJason Molenda <jmolenda@apple.com>2013-06-05 02:56:58 +0000
commit811d259bb1535916d3ade11123fda22a664c2669 (patch)
treef2f50de37f4d09818606d8c4eaa2f2118de139db
parent7595447b15608fe60378b472b759cb5c5187eaa2 (diff)
downloadbcm5719-llvm-811d259bb1535916d3ade11123fda22a664c2669.tar.gz
bcm5719-llvm-811d259bb1535916d3ade11123fda22a664c2669.zip
Small changes to diagnose_unwind. Correctly provide help text.
Print the lldb version at the top of the output. llvm-svn: 183289
-rw-r--r--lldb/examples/python/diagnose_unwind.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/lldb/examples/python/diagnose_unwind.py b/lldb/examples/python/diagnose_unwind.py
index f261382a5e5..ab95d23a257 100644
--- a/lldb/examples/python/diagnose_unwind.py
+++ b/lldb/examples/python/diagnose_unwind.py
@@ -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, result, dict):
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:"
OpenPOWER on IntegriCloud