diff --git a/src/etc/lldb_batchmode.py b/src/etc/lldb_batchmode.py index 760daf425557..a6008ad66465 100644 --- a/src/etc/lldb_batchmode.py +++ b/src/etc/lldb_batchmode.py @@ -176,18 +176,22 @@ def start_watchdog(): watchdog_thread.start() +def get_env_arg(name): + value = os.environ.get(name) + if value is None: + print("must set %s" % name) + sys.exit(1) + return value + + #################################################################################################### # ~main #################################################################################################### def main(): - if len(sys.argv) != 3: - print("usage: python lldb_batchmode.py target-path script-path") - sys.exit(1) - - target_path = sys.argv[1] - script_path = sys.argv[2] + target_path = get_env_arg("LLDB_BATCHMODE_TARGET_PATH") + script_path = get_env_arg("LLDB_BATCHMODE_SCRIPT_PATH") print("LLDB batch-mode script") print("----------------------") diff --git a/src/tools/compiletest/src/runtest/debuginfo.rs b/src/tools/compiletest/src/runtest/debuginfo.rs index bc597597ce12..95143867a911 100644 --- a/src/tools/compiletest/src/runtest/debuginfo.rs +++ b/src/tools/compiletest/src/runtest/debuginfo.rs @@ -458,8 +458,8 @@ impl TestCx<'_> { self.run_command_to_procres( Command::new(&self.config.python) .arg(&lldb_script_path) - .arg(test_executable) - .arg(debugger_script) + .env("LLDB_BATCHMODE_TARGET_PATH", test_executable) + .env("LLDB_BATCHMODE_SCRIPT_PATH", debugger_script) .env("PYTHONUNBUFFERED", "1") // Help debugging #78665 .env("PYTHONPATH", pythonpath), )