forked from OSchip/llvm-project
Small changes to diagnose_unwind. Correctly provide help text.
Print the lldb version at the top of the output. llvm-svn: 183289
This commit is contained in:
parent
7595447b15
commit
811d259bb1
|
@ -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
|
# command script import lldb.diagnose
|
||||||
# it is used when lldb's backtrace fails -- it collects and prints information about the stack frames,
|
# it is used when lldb's backtrace fails -- it collects and prints
|
||||||
# and tries an alternate unwind algorithm, that will help to understand why lldb's unwind algorithm did
|
# information about the stack frames, and tries an alternate unwind
|
||||||
# not succeed.
|
# algorithm, that will help to understand why lldb's unwind algorithm
|
||||||
|
# did not succeed.
|
||||||
|
|
||||||
import optparse
|
import optparse
|
||||||
import lldb
|
import lldb
|
||||||
|
@ -88,8 +90,14 @@ def simple_backtrace(debugger):
|
||||||
backtrace_print_frame (target, frame_num, cur_pc, cur_fp)
|
backtrace_print_frame (target, frame_num, cur_pc, cur_fp)
|
||||||
|
|
||||||
def diagnose_unwind(debugger, command, result, dict):
|
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)
|
command_args = shlex.split(command)
|
||||||
parser = create_diagnose_unwind_options()
|
parser = create_diagnose_unwind_options()
|
||||||
try:
|
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]:
|
if len(lldb_versions_match.groups()) >= 5 and lldb_versions_match.groups()[4]:
|
||||||
lldb_minor = int(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 'Unwind diagnostics for thread %d' % thread.GetIndexID()
|
||||||
print ""
|
print ""
|
||||||
print "lldb's unwind algorithm:"
|
print "lldb's unwind algorithm:"
|
||||||
|
|
Loading…
Reference in New Issue