https://github.com/charles-zablit updated https://github.com/llvm/llvm-project/pull/177934
>From c3ec9d7ff698816f363ca7cdb95b5044540680a8 Mon Sep 17 00:00:00 2001 From: Charles Zablit <[email protected]> Date: Mon, 26 Jan 2026 12:00:27 +0000 Subject: [PATCH 1/2] [lldb][windows] do not attach to a PseudoConsole if it is not opened --- .../Plugins/Platform/Windows/PlatformWindows.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp index 7d5a5a503474c..77552f1073879 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -522,9 +522,13 @@ ProcessSP PlatformWindows::DebugProcess(ProcessLaunchInfo &launch_info, return nullptr; error = process_sp->Launch(launch_info); #ifdef _WIN32 - if (error.Success()) - process_sp->SetPseudoConsoleHandle(launch_info.GetPTYSP()); - else { + if (error.Success()) { + if (launch_info.GetPTY().GetPseudoTerminalHandle() != + INVALID_HANDLE_VALUE && + launch_info.GetNumFileActions() == 0 && + launch_info.GetFlags().Test(lldb::eLaunchFlagLaunchInTTY)) + process_sp->SetPseudoConsoleHandle(launch_info.GetPTYSP()); + } else { Log *log = GetLog(LLDBLog::Platform); LLDB_LOGF(log, "Platform::%s LaunchProcess() failed: %s", __FUNCTION__, error.AsCString()); >From 2e0c921becbf9ec09a8f557d6bd5cf9d6afc219a Mon Sep 17 00:00:00 2001 From: Charles Zablit <[email protected]> Date: Mon, 26 Jan 2026 17:43:46 +0000 Subject: [PATCH 2/2] mark tests as expected failures --- .../API/tools/lldb-dap/launch/TestDAP_launch.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py index f7f4a8016dc19..799574c4daab5 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py @@ -16,7 +16,7 @@ class TestDAP_launch(lldbdap_testcase.DAPTestCaseBase): - @skipIfWindowsWithoutConPTY + @expectedFailureWindows def test_default(self): """ Tests the default launch of a simple program. No arguments, @@ -76,7 +76,6 @@ def test_failing_console(self): r"unexpected value, expected 'internalConsole\', 'integratedTerminal\' or 'externalTerminal\' at arguments.console", ) - @skipIfWindowsWithoutConPTY def test_termination(self): """ Tests the correct termination of lldb-dap upon a 'disconnect' @@ -142,6 +141,7 @@ def test_cwd(self): ) self.assertTrue(found, "verified program working directory") + @expectedFailureWindows def test_debuggerRoot(self): """ Tests the "debuggerRoot" will change the working directory of @@ -210,7 +210,7 @@ def test_disableSTDIO(self): self.assertEqual(output, "", "expect no program output") @skipIfLinux # shell argument expansion doesn't seem to work on Linux - @skipIfWindowsWithoutConPTY + @expectedFailureWindows @expectedFailureAll(oslist=["freebsd", "netbsd"], bugnumber="llvm.org/pr48349") def test_shellExpandArguments_enabled(self): """ @@ -233,7 +233,7 @@ def test_shellExpandArguments_enabled(self): quote_path, line, 'verify "%s" expanded to "%s"' % (glob, program) ) - @skipIfWindowsWithoutConPTY + @expectedFailureWindows def test_shellExpandArguments_disabled(self): """ Tests the default launch of a simple program with shell expansion @@ -255,7 +255,7 @@ def test_shellExpandArguments_disabled(self): quote_path, line, 'verify "%s" stayed to "%s"' % (glob, glob) ) - @skipIfWindowsWithoutConPTY + @expectedFailureWindows def test_args(self): """ Tests launch of a simple program with arguments @@ -280,7 +280,7 @@ def test_args(self): 'arg[%i] "%s" not in "%s"' % (i + 1, quoted_arg, lines[i]), ) - @skipIfWindowsWithoutConPTY + @expectedFailureWindows def test_environment_with_object(self): """ Tests launch of a simple program with environment variables @@ -558,7 +558,7 @@ def test_terminate_commands(self): output = self.collect_console(pattern=terminateCommands[0]) self.verify_commands("terminateCommands", output, terminateCommands) - @skipIfWindowsWithoutConPTY + @expectedFailureWindows def test_version(self): """ Tests that "initialize" response contains the "version" string the same @@ -642,7 +642,7 @@ def test_stdio_redirection(self): ) @skipIfAsan - @skipIfWindowsWithoutConPTY + @expectedFailureWindows @skipIf(oslist=["linux"], archs=no_match(["x86_64"])) @skipIfBuildType(["debug"]) def test_stdio_redirection_and_console(self): _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
