summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-04-30 23:03:56 +0000
committerJason Molenda <jmolenda@apple.com>2013-04-30 23:03:56 +0000
commit14c84cdb9cb19bb1ca3a5e61a375edb0ba231c7a (patch)
treeb1d8ef00676f7911776bfb5709a5bd32f831a106 /lldb/examples/python
parent699808ceb2799c2377c49d6833bcbd0f8835ac34 (diff)
downloadbcm5719-llvm-14c84cdb9cb19bb1ca3a5e61a375edb0ba231c7a.tar.gz
bcm5719-llvm-14c84cdb9cb19bb1ca3a5e61a375edb0ba231c7a.zip
Put a try/catch block around the SBAddress setting; don't want to
terminate the command early if we happen to have an invalid load address. llvm-svn: 180826
Diffstat (limited to 'lldb/examples/python')
-rw-r--r--lldb/examples/python/diagnose_unwind.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/lldb/examples/python/diagnose_unwind.py b/lldb/examples/python/diagnose_unwind.py
index 1e182e27eb5..4dc20a58a5b 100644
--- a/lldb/examples/python/diagnose_unwind.py
+++ b/lldb/examples/python/diagnose_unwind.py
@@ -17,19 +17,22 @@ def backtrace_print_frame (target, frame_num, addr, fp):
addr = addr - 1
sbaddr = lldb.SBAddress()
- sbaddr.SetLoadAddress(addr, target)
- module_description = ""
- if sbaddr.GetModule():
- module_filename = ""
- module_uuid_str = sbaddr.GetModule().GetUUIDString()
- if module_uuid_str == None:
- module_uuid_str = ""
- if sbaddr.GetModule().GetFileSpec():
- module_filename = sbaddr.GetModule().GetFileSpec().GetFilename()
- if module_filename == None:
- module_filename = ""
- if module_uuid_str != "" or module_filename != "":
- module_description = '%s %s' % (module_filename, module_uuid_str)
+ try:
+ sbaddr.SetLoadAddress(addr, target)
+ module_description = ""
+ if sbaddr.GetModule():
+ module_filename = ""
+ module_uuid_str = sbaddr.GetModule().GetUUIDString()
+ if module_uuid_str == None:
+ module_uuid_str = ""
+ if sbaddr.GetModule().GetFileSpec():
+ module_filename = sbaddr.GetModule().GetFileSpec().GetFilename()
+ if module_filename == None:
+ module_filename = ""
+ if module_uuid_str != "" or module_filename != "":
+ module_description = '%s %s' % (module_filename, module_uuid_str)
+ except Exception:
+ return
addr_width = process.GetAddressByteSize() * 2
sym_ctx = target.ResolveSymbolContextForAddress(sbaddr, lldb.eSymbolContextEverything)
OpenPOWER on IntegriCloud