You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d64bd02
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(windows): report the end of a Rust/C++/COBOL program when it happens, not 2 s later (#856) (#859)
* fix(windows): report the end of a Rust/C++/COBOL program when it happens, not 2 s later
The worker holds exited/terminated until the adapter's forwarded stdio
has drained, and took "the pipes closed" as the sign. CodeLLDB outlives
its debuggee and keeps the pipes open until teardown, so on Windows
(where the debuggee writes straight into them) the wait ran to its 2 s
backstop at the end of every program.
- AdapterSpawnConfig.forwardStdio gains adapterOutlivesDebuggee;
buildLldbSpawnConfig sets it on win32 (rust, cpp, cobol).
- For such an adapter the drain also settles when the pipes have been
quiet for 100 ms, counted from the later of the last chunk and the first
terminal signal, and re-checked after one full turn of the event loop so
a descheduled worker cannot take unread output for silence. Output still
arriving keeps the wait open; the 2 s backstop is unchanged.
- rdbg, whose pipes close with the program, still waits for the close.
Measured: end reported 110-134 ms after launch (was 2009-2030 ms); the
longest gap inside 9 MB of exit-time output was 14 ms idle, 39 ms with
every core busy.
Closes#856.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* docs(proxy): say what the stdio drain guarantees in each of its three endings
Review follow-up on #859. The comment on trackStdioActivity said a counted
chunk's lines have been forwarded; that holds for complete lines only (a
trailing fragment waits in the line buffer for the pipe to close, #860).
The drain's doc stated the output-before-exit order as a guarantee; it is
one when the wait ends on the close, a measured expectation when it ends
on silence, and neither at the backstop.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* test(proxy): the quiet window's event-loop turn is pinned, and its dead cancel flag goes
Output that lands in the same instant the quiet window closes must restart
the window: a test now fails if the turn after the timer stops checking for
it (verified by removing the check). The cancelled flag in
waitForAdapterStdioQuiet could never be read — at most one of the timer and
the immediate is pending, and cancel clears both — so it is removed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: JF <john.franklin@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
**On Windows, the end of a Rust, C/C++ or COBOL program is reported when it happens, not 2 s later** — the proxy holds a program's exit until the output it printed on the way out has been forwarded, and took "the adapter's stdio pipes closed" as the sign of that. CodeLLDB outlives its debuggee and keeps those pipes open until the session is torn down, so on Windows (where the debuggee writes straight into them) the wait ran to its 2 s backstop at the end of every program: `list_debug_sessions` kept saying `running`, `wait_for_stop` kept blocking, and a `start_debugging` of a short program answered `running` with `pending: true` for a program that had already ended. For an adapter that outlives its debuggee the proxy now takes the pipes going quiet as the sign — 100 ms without output, counted from the adapter's `exited` and re-checked after a full turn of the event loop; the longest pause measured inside 9 MB of exit-time output was 14 ms idle and 39 ms with every core busy — so the end is reported about 100 ms after the fact and output that is still arriving keeps the wait open. The 2 s backstop is unchanged, as is rdbg, whose pipes do close with the program (#856)
0 commit comments