summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-06-23 20:26:45 +0000
committerJim Ingham <jingham@apple.com>2015-06-23 20:26:45 +0000
commitc917a381f8fbfb0971d4012dbf9315e9c19b6335 (patch)
tree6d181e92db52528b58f84a858562f205236d62eb /lldb/examples/python
parent4a39e80809f6160fbf95e4a6cbc4161346db50a6 (diff)
downloadbcm5719-llvm-c917a381f8fbfb0971d4012dbf9315e9c19b6335.tar.gz
bcm5719-llvm-c917a381f8fbfb0971d4012dbf9315e9c19b6335.zip
Remove a few uses of lldb.target, which is not valid
in a scripted command. llvm-svn: 240451
Diffstat (limited to 'lldb/examples/python')
-rwxr-xr-xlldb/examples/python/crashlog.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 403b92f353f..60a6a1f50f0 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -630,13 +630,14 @@ def save_crashlog(debugger, command, result, dict):
if not out_file:
result.PutCString ("error: failed to open file '%s' for writing...", args[0]);
return
- if lldb.target:
- identifier = lldb.target.executable.basename
+ target = debugger.GetSelectedTarget()
+ if target:
+ identifier = target.executable.basename
if lldb.process:
pid = lldb.process.id
if pid != lldb.LLDB_INVALID_PROCESS_ID:
out_file.write('Process: %s [%u]\n' % (identifier, pid))
- out_file.write('Path: %s\n' % (lldb.target.executable.fullpath))
+ out_file.write('Path: %s\n' % (target.executable.fullpath))
out_file.write('Identifier: %s\n' % (identifier))
out_file.write('\nDate/Time: %s\n' % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
out_file.write('OS Version: Mac OS X %s (%s)\n' % (platform.mac_ver()[0], commands.getoutput('sysctl -n kern.osversion')));
@@ -673,10 +674,10 @@ def save_crashlog(debugger, command, result, dict):
out_file.write('\n')
out_file.write('\nBinary Images:\n')
- for module in lldb.target.modules:
+ for module in target.modules:
text_segment = module.section['__TEXT']
if text_segment:
- text_segment_load_addr = text_segment.GetLoadAddress(lldb.target)
+ text_segment_load_addr = text_segment.GetLoadAddress(target)
if text_segment_load_addr != lldb.LLDB_INVALID_ADDRESS:
text_segment_end_load_addr = text_segment_load_addr + text_segment.size
identifier = module.file.basename
OpenPOWER on IntegriCloud