[Lldb-commits] [lldb] [lldb] Quit automatically if --batch has no commands to run (PR #179969)

via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 5 08:15:01 PST 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 33301 tests passed
* 512 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### lldb-api
<details>
<summary>lldb-api.driver/batch_mode/TestBatchMode.py</summary>

```
Script:
--
/usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib --env LLVM_INCLUDE_DIR=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include --env LLVM_TOOLS_DIR=/home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin --libcxx-include-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/c++/v1 --libcxx-include-target-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/include/x86_64-unknown-linux-gnu/c++/v1 --libcxx-library-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib/x86_64-unknown-linux-gnu --arch x86_64 --build-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build.noindex --lldb-module-cache-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/lldb --compiler /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/clang --dsymutil /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./bin --lldb-obj-root /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb --lldb-libs-dir /home/gha/actions-runner/_work/llvm-project/llvm-project/build/./lib --cmake-build-type Release /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/driver/batch_mode -p TestBatchMode.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 23.0.0git (https://github.com/llvm/llvm-project revision b0bcfde3e76636c776b3883c3ebce4595f10a166)
  clang revision b0bcfde3e76636c776b3883c3ebce4595f10a166
  llvm revision b0bcfde3e76636c776b3883c3ebce4595f10a166
Skipping the following test categories: msvcstl, dsym, pdb, gmodules, debugserver, objc

--
Command Output (stderr):
--
PASS: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_batch_mode_attach_exit (TestBatchMode.DriverBatchModeTest.test_batch_mode_attach_exit)
PASS: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_batch_mode_launch_stop_at_entry (TestBatchMode.DriverBatchModeTest.test_batch_mode_launch_stop_at_entry)
PASS: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_batch_mode_no_commands_quits (TestBatchMode.DriverBatchModeTest.test_batch_mode_no_commands_quits)
FAIL: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_batch_mode_run_crash (TestBatchMode.DriverBatchModeTest.test_batch_mode_run_crash)
PASS: LLDB (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang-x86_64) :: test_batch_mode_run_exit (TestBatchMode.DriverBatchModeTest.test_batch_mode_run_exit)
======================================================================
ERROR: test_batch_mode_run_crash (TestBatchMode.DriverBatchModeTest.test_batch_mode_run_crash)
   Test that the lldb driver's batch mode works correctly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 160, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 160, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 592, in wrapper
    func(*args, **kwargs)
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/driver/batch_mode/TestBatchMode.py", line 70, in test_batch_mode_run_crash
    self.expect_prompt()
  File "/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/lldbpexpect.py", line 20, in expect_prompt
    self.child.expect_exact(self.PROMPT)
  File "/home/gha/.local/lib/python3.12/site-packages/pexpect/spawnbase.py", line 432, in expect_exact
    return exp.expect_loop(timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gha/.local/lib/python3.12/site-packages/pexpect/expect.py", line 179, in expect_loop
    return self.eof(e)
           ^^^^^^^^^^^
  File "/home/gha/.local/lib/python3.12/site-packages/pexpect/expect.py", line 122, in eof
    raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7a09cba421b0>
command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/lldb
args: ['/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/lldb', '--no-lldbinit', '--no-use-colors', '-O', 'settings clear --all', '-O', 'settings set symbols.enable-external-lookup false', '-O', 'settings set target.inherit-tcc true', '-O', 'settings set target.disable-aslr false', '-O', 'settings set target.detach-on-error false', '-O', 'settings set target.auto-apply-fixits false', '-O', 'settings set plugin.process.gdb-remote.packet-timeout 60', '-O', 'settings set symbols.clang-modules-cache-path "/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build.noindex/module-cache-lldb/lldb-api"', '-O', 'settings set use-color false', '-O', 'settings set show-statusline false', '--file', '/home/gha/actions-runner/_work/llvm-project/llvm-project/build/lldb-test-build.noindex/driver/batch_mode/TestBatchMode.test_batch_mode_run_crash/a.out', '-b', '-o', 'break set -n main', '-o', 'run', '-o', 'continue', '-k', 'frame var touch_me_not', '--', 'CRASH']
buffer (last 100 chars): b''
before (last 100 chars): b' = 0x0000000000000000\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 374460
child_fd: 5
closed: False
timeout: 60
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_string:
    0: b'(lldb) '
Config=x86_64-/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang
----------------------------------------------------------------------
Ran 5 tests in 23.585s

FAILED (errors=1)

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/179969


More information about the lldb-commits mailing list