about summary refs log tree commit diff
path: root/src/etc/lldb_batchmode.py
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2014-10-22 10:45:29 +0200
committerMichael Woerister <michaelwoerister@posteo>2014-10-22 11:08:21 +0200
commit423dca7fc6a74e1d1e6a341545222134a27dd13f (patch)
tree9d7cbd69b9b4113f1c4cb6110afd6b97f7ef0a0e /src/etc/lldb_batchmode.py
parent7fadda6e7ed8a26c297a17759b350e77bebb39dc (diff)
downloadrust-423dca7fc6a74e1d1e6a341545222134a27dd13f.tar.gz
rust-423dca7fc6a74e1d1e6a341545222134a27dd13f.zip
debuginfo: Print more output in lldb_batchmode.py for better error logs.
Diffstat (limited to 'src/etc/lldb_batchmode.py')
-rw-r--r--src/etc/lldb_batchmode.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/etc/lldb_batchmode.py b/src/etc/lldb_batchmode.py
index 06bd2a13d22..467463a39c6 100644
--- a/src/etc/lldb_batchmode.py
+++ b/src/etc/lldb_batchmode.py
@@ -141,6 +141,11 @@ if len(sys.argv) != 3:
 target_path = sys.argv[1]
 script_path = sys.argv[2]
 
+print("LLDB batch-mode script")
+print("----------------------")
+print("Debugger commands script is '%s'." % script_path)
+print("Target executable is '%s'." % target_path)
+print("Current working directory is '%s'" % os.getcwd())
 
 # Create a new debugger instance
 debugger = lldb.SBDebugger.Create()
@@ -151,10 +156,12 @@ debugger.SetAsync(False)
 
 # Create a target from a file and arch
 print("Creating a target for '%s'" % target_path)
-target = debugger.CreateTargetWithFileAndArch(target_path, lldb.LLDB_ARCH_DEFAULT)
+target_error = lldb.SBError()
+target = debugger.CreateTarget(target_path, None, None, True, target_error)
 
 if not target:
-  print("Could not create debugging target '" + target_path + "'. Aborting.", file=sys.stderr)
+  print("Could not create debugging target '" + target_path + "': " + str(target_error) +
+        ". Aborting.", file=sys.stderr)
   sys.exit(1)