[Lldb-commits] [lldb] r180835 - Print a backtrace line for a pc value even if we can't make an SBAddress
Jason Molenda
jmolenda at apple.com
Tue Apr 30 18:26:52 PDT 2013
Author: jmolenda
Date: Tue Apr 30 20:26:52 2013
New Revision: 180835
URL: http://llvm.org/viewvc/llvm-project?rev=180835&view=rev
Log:
Print a backtrace line for a pc value even if we can't make an SBAddress
out of it.
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=180835&r1=180834&r2=180835&view=diff
==============================================================================
--- lldb/trunk/examples/python/diagnose_unwind.py (original)
+++ lldb/trunk/examples/python/diagnose_unwind.py Tue Apr 30 20:26:52 2013
@@ -13,6 +13,7 @@ import shlex
def backtrace_print_frame (target, frame_num, addr, fp):
process = target.GetProcess()
addr_for_printing = addr
+ addr_width = process.GetAddressByteSize() * 2
if frame_num > 0:
addr = addr - 1
@@ -32,9 +33,9 @@ def backtrace_print_frame (target, frame
if module_uuid_str != "" or module_filename != "":
module_description = '%s %s' % (module_filename, module_uuid_str)
except Exception:
+ print '%2d: pc==0x%-*x fp==0x%-*x' % (frame_num, addr_width, addr_for_printing, addr_width, fp)
return
- addr_width = process.GetAddressByteSize() * 2
sym_ctx = target.ResolveSymbolContextForAddress(sbaddr, lldb.eSymbolContextEverything)
if sym_ctx.IsValid() and sym_ctx.GetSymbol().IsValid():
function_start = sym_ctx.GetSymbol().GetStartAddress().GetLoadAddress(target)
More information about the lldb-commits
mailing list