Skip to content

Commit 423dca7

Browse files
debuginfo: Print more output in lldb_batchmode.py for better error logs.
1 parent 7fadda6 commit 423dca7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/etc/lldb_batchmode.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def listen():
141141
target_path = sys.argv[1]
142142
script_path = sys.argv[2]
143143

144+
print("LLDB batch-mode script")
145+
print("----------------------")
146+
print("Debugger commands script is '%s'." % script_path)
147+
print("Target executable is '%s'." % target_path)
148+
print("Current working directory is '%s'" % os.getcwd())
144149

145150
# Create a new debugger instance
146151
debugger = lldb.SBDebugger.Create()
@@ -151,10 +156,12 @@ def listen():
151156

152157
# Create a target from a file and arch
153158
print("Creating a target for '%s'" % target_path)
154-
target = debugger.CreateTargetWithFileAndArch(target_path, lldb.LLDB_ARCH_DEFAULT)
159+
target_error = lldb.SBError()
160+
target = debugger.CreateTarget(target_path, None, None, True, target_error)
155161

156162
if not target:
157-
print("Could not create debugging target '" + target_path + "'. Aborting.", file=sys.stderr)
163+
print("Could not create debugging target '" + target_path + "': " + str(target_error) +
164+
". Aborting.", file=sys.stderr)
158165
sys.exit(1)
159166

160167

0 commit comments

Comments
 (0)