[Lldb-commits] [lldb] [lldb][windows] add STDIN and STDOUT forwarding support (PR #175812)
Charles Zablit via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 22 11:50:18 PST 2026
================
@@ -133,3 +137,52 @@ void PseudoConsole::Close() {
m_conpty_input = INVALID_HANDLE_VALUE;
m_conpty_output = INVALID_HANDLE_VALUE;
}
+
+llvm::Error PseudoConsole::DrainInitSequences() {
+ STARTUPINFOEXW startupinfoex = {};
+ startupinfoex.StartupInfo.cb = sizeof(STARTUPINFOEXW);
+ startupinfoex.StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
+
+ auto attributelist_or_err = ProcThreadAttributeList::Create(startupinfoex);
+ if (!attributelist_or_err)
+ return llvm::errorCodeToError(attributelist_or_err.getError());
+ ProcThreadAttributeList attributelist = std::move(*attributelist_or_err);
+ if (auto error = attributelist.SetupPseudoConsole(m_conpty_handle))
+ return error;
+
+ PROCESS_INFORMATION pi = {};
+ wchar_t cmdline[] = L"cmd.exe /c 'echo foo && exit'";
----------------
charles-zablit wrote:
Fixed, thanks! If we don't find the variable, this is not a fatal error and it's only logged.
https://github.com/llvm/llvm-project/pull/175812
More information about the lldb-commits
mailing list