[all-commits] [llvm/llvm-project] be7661: [lldb][Windows] Check for EOF before the ctrl-c re...
Charles Zablit via All-commits
all-commits at lists.llvm.org
Wed Jul 29 08:24:44 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: be76618bc973b0009fa0618fbc6978f4c74bfdc7
https://github.com/llvm/llvm-project/commit/be76618bc973b0009fa0618fbc6978f4c74bfdc7
Author: Charles Zablit <c_zablit at apple.com>
Date: 2026-07-29 (Wed, 29 Jul 2026)
Changed paths:
M lldb/source/Core/IOHandler.cpp
Log Message:
-----------
[lldb][Windows] Check for EOF before the ctrl-c retry in GetLine (#212745)
On Windows `lldb --repl` can hang forever instead of exiting at EOF.
`IOHandlerEditline::GetLine` checks `GetLastError() ==
ERROR_OPERATION_ABORTED` and does a `continue` before checking `feof`.
However `fgets` is a CRT function and does not set the Win32 last error
value, so the `GetLastError` read is not the expected error. When it
happens to be `ERROR_OPERATION_ABORTED` (995) the loop never reaches the
EOF check.
This reorders the checks so EOF wins unconditionally, and adds
`clearerr` before the ctrl-c retry (a real interrupt leaves the error
flag set, which would fail the next `fgets`). ctrl-c handling is
otherwise unchanged.
rdar://183335061
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