]> git.lizzy.rs Git - rust.git/commitdiff
debuginfo: Print more output in lldb_batchmode.py for better error logs.
authorMichael Woerister <michaelwoerister@posteo>
Wed, 22 Oct 2014 08:45:29 +0000 (10:45 +0200)
committerMichael Woerister <michaelwoerister@posteo>
Wed, 22 Oct 2014 09:08:21 +0000 (11:08 +0200)
src/etc/lldb_batchmode.py

index 06bd2a13d22cd827cdb67ea8db53e833bcdd6a9a..467463a39c646b6227c935c040d1530bd046a391 100644 (file)
@@ -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)