[Lldb-commits] [lldb] [lldb][windows] Reset m_pty in ProcessLaunchInfo::Clear (PR #197717)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Fri May 15 06:53:31 PDT 2026


https://github.com/charles-zablit updated https://github.com/llvm/llvm-project/pull/197717

>From 93d7de22df9077c1c93ea4e653808e214a6acb7d Mon Sep 17 00:00:00 2001
From: Charles Zablit <c_zablit at apple.com>
Date: Fri, 15 May 2026 15:53:16 +0200
Subject: [PATCH] [lldb][windows] always recreate the PTY

---
 lldb/source/Host/common/ProcessLaunchInfo.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lldb/source/Host/common/ProcessLaunchInfo.cpp b/lldb/source/Host/common/ProcessLaunchInfo.cpp
index b5b82c7475822..ee868a31bc462 100644
--- a/lldb/source/Host/common/ProcessLaunchInfo.cpp
+++ b/lldb/source/Host/common/ProcessLaunchInfo.cpp
@@ -231,8 +231,12 @@ void ProcessLaunchInfo::SetDetachOnError(bool enable) {
 llvm::Error ProcessLaunchInfo::SetUpPtyRedirection() {
   Log *log = GetLog(LLDBLog::Process);
 
+#ifdef _WIN32
+  m_pty = std::make_shared<PTY>();
+#else
   if (!m_pty)
     m_pty = std::make_shared<PTY>();
+#endif
 
   bool stdin_free = GetFileActionForFD(STDIN_FILENO) == nullptr;
   bool stdout_free = GetFileActionForFD(STDOUT_FILENO) == nullptr;
@@ -268,8 +272,7 @@ llvm::Error ProcessLaunchInfo::SetUpPtyRedirection() {
 
 #ifdef _WIN32
 llvm::Error ProcessLaunchInfo::SetUpPipeRedirection() {
-  if (!m_pty)
-    m_pty = std::make_shared<PTY>();
+  m_pty = std::make_shared<PTY>();
   return m_pty->OpenAnonymousPipes();
 }
 #endif



More information about the lldb-commits mailing list