[all-commits] [llvm/llvm-project] 29ce63: [lldb] [Windows] Let LLGS TestClient tolerate asyn...

Yao Qi via All-commits all-commits at lists.llvm.org
Wed Sep 23 06:04:44 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29ce634abb29fc59a147e63e72426c343becf4f9
      https://github.com/llvm/llvm-project/commit/29ce634abb29fc59a147e63e72426c343becf4f9
  Author: Yao Qi <yao_qi at apple.com>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M lldb/unittests/tools/lldb-server/tests/LLGSTest.cpp
    M lldb/unittests/tools/lldb-server/tests/TestClient.cpp

  Log Message:
  -----------
  [lldb] [Windows] Let LLGS TestClient tolerate async `O` output packets (#225521)

My PR (swiftlang/llvm-project#14269) has a pre-merge test failure on
Windows, and that lead me looking at test LLGSTest.cpp deeply

  ```
  Send Packet: vCont;c
  Read Packet: O1b5b3f32356c
  lldb-server exiting...
LLGSTest.cpp(30): error: Value of:
llvm::detail::TakeError(Client.ContinueAll())
  Expected: succeeded
    Actual: failed  (Unable to parse StopReply: Invalid packet)
  ```

`TestClient::SendMessage` read exactly one packet and had no handling
for `O`
(inferior stdout) packets, but inferior output arriving before a stop
reply
was parsed as the stop reply itself. `StopReply::create` accepts only
`T` and
`W`, so it failed.  The `O1b5b3f32356c` decodes to `ESC [ ? 2 5 l`, the
sequence that hides the cursor. Windows lldb-server gives the inferior a
ConPTY
created with `PSEUDOCONSOLE_INHERIT_CURSOR`, and ConPTY writes its own
VT
initialization bytes to the output pipe, which reach the client as an
`O` packet.

The fix is that `SendMessage` now uses the inherited
`SendPacketAndReceiveResponseWithOutputSupport`, which loops over
leading `O`
packets via `ReadPacketWithOutputSupport` and passes each payload to a
callback. `TestClient::Continue` had the same gap in the opposite order:
after a
`W` or `X` reply it read one raw packet and required
`ErrorDisconnected`, so an `O`
packet arriving before the socket closed failed the test. It now reads
through
`ReadPacketWithOutputSupport` as well.

The fix reverts 5032c6ea0803 ("[lldb-server] Disable a test on Windows
until it can be
fixed"), which disabled `LaunchModePreservesEnvironment` on Windows.

18b211cb1521 ("Disable stdin/stdout for environment_check inferior
process")
worked around the same root cause from a different source, where an
allocator
message on stderr under sanitizers reached the client the same way. That
commit noted the client "doesn't handle that unexpected output"; this
handles
it.

Assisted-by: claude



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list