From c191595d3701b87289b14c8eace29b4a65a17edd Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:51:55 -0500 Subject: [PATCH] convert `lldb_batchmode` to a package --- src/etc/lldb_batchmode/__init__.py | 1 + src/etc/{lldb_batchmode.py => lldb_batchmode/runner.py} | 6 +----- src/tools/compiletest/src/lib.rs | 2 +- tests/debuginfo/basic-stepping.rs | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 src/etc/lldb_batchmode/__init__.py rename src/etc/{lldb_batchmode.py => lldb_batchmode/runner.py} (98%) diff --git a/src/etc/lldb_batchmode/__init__.py b/src/etc/lldb_batchmode/__init__.py new file mode 100644 index 00000000000..0da71ca40ee --- /dev/null +++ b/src/etc/lldb_batchmode/__init__.py @@ -0,0 +1 @@ +from .runner import main as main diff --git a/src/etc/lldb_batchmode.py b/src/etc/lldb_batchmode/runner.py similarity index 98% rename from src/etc/lldb_batchmode.py rename to src/etc/lldb_batchmode/runner.py index 54e796bb2bb..e9b106390f6 100644 --- a/src/etc/lldb_batchmode.py +++ b/src/etc/lldb_batchmode/runner.py @@ -166,7 +166,7 @@ def start_watchdog(): def watchdog(): while clock() < watchdog_max_time: time.sleep(1) - print("TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!") + print("TIMEOUT: lldb_batchmode has been running for too long. Aborting!") thread.interrupt_main() # Start the listener and let it run as a daemon @@ -252,7 +252,3 @@ def main(): sys.exit(1) finally: script_file.close() - - -if __name__ == "__main__": - main() diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 5494d3f26eb..0836caa590f 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -705,7 +705,7 @@ fn common_inputs_stamp(config: &Config) -> Stamp { "src/etc/gdb_load_rust_pretty_printers.py", "src/etc/gdb_lookup.py", "src/etc/gdb_providers.py", - "src/etc/lldb_batchmode.py", + "src/etc/lldb_batchmode", "src/etc/lldb_lookup.py", "src/etc/lldb_providers.py", ]; diff --git a/tests/debuginfo/basic-stepping.rs b/tests/debuginfo/basic-stepping.rs index f81c5cf7d35..cb9cb225d1c 100644 --- a/tests/debuginfo/basic-stepping.rs +++ b/tests/debuginfo/basic-stepping.rs @@ -58,10 +58,10 @@ //@ lldb-command: settings set stop-line-count-after 0 //@ lldb-command: run -// In `breakpoint_callback()` in `./src/etc/lldb_batchmode.py` we do +// In `breakpoint_callback()` in `./src/etc/lldb_batchmode/runner.py` we do // `SetSelectedFrame()`, which causes LLDB to show the current line and one line // before (since we changed `stop-line-count-before`). Note that -// `normalize_whitespace()` in `lldb_batchmode.py` removes the newlines of the +// `normalize_whitespace()` in `lldb_batchmode/runner.py` removes the newlines of the // output. So the current line and the line before actually ends up on the same // output line. That's fine. //@ lldb-check: [...]let mut c = 27;[...]