Author: Charles Zablit Date: 2026-02-18T17:05:29Z New Revision: 6a365b004d8b1952315dfe39011f2abd39d64474
URL: https://github.com/llvm/llvm-project/commit/6a365b004d8b1952315dfe39011f2abd39d64474 DIFF: https://github.com/llvm/llvm-project/commit/6a365b004d8b1952315dfe39011f2abd39d64474.diff LOG: [lldb-dap][windows] fix lldb-dap's self.get_stdout() method (#181813) `DAPTestCaseBase.get_stdout()` was originally not supported on Windows due to the lack of ConPTY support. https://github.com/llvm/llvm-project/pull/168729 fixed that by implenenting the ConPTY support. It was partly reverted in https://github.com/llvm/llvm-project/pull/177610 due to hard to reproduce test failures. The tests are now fixed (see the 2 patches below) and removing the check for `GetFlags().Test(lldb::eLaunchFlagLaunchInTTY);` is the last step to re-enabling ConPTY support. This patch requires: - https://github.com/llvm/llvm-project/pull/181811 - https://github.com/llvm/llvm-project/pull/181809 Fixes https://github.com/llvm/llvm-project/issues/137599. rdar://168932366 Added: Modified: lldb/include/lldb/Host/ProcessLaunchInfo.h lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp lldb/test/API/lldbutil-tests/failed-to-hit-breakpoint/TestLLDBUtilFailedToHitBreakpoint.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_args.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_basic.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_debuggerRoot.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_object.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_disabled.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_enabled.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_version.py Removed: ################################################################################ diff --git a/lldb/include/lldb/Host/ProcessLaunchInfo.h b/lldb/include/lldb/Host/ProcessLaunchInfo.h index d89fe68b2d0d4..e13eecc9463ea 100644 --- a/lldb/include/lldb/Host/ProcessLaunchInfo.h +++ b/lldb/include/lldb/Host/ProcessLaunchInfo.h @@ -137,8 +137,7 @@ class ProcessLaunchInfo : public ProcessInfo { bool ShouldUsePTY() const { #ifdef _WIN32 return GetPTY().GetPseudoTerminalHandle() != ((HANDLE)(long long)-1) && - GetNumFileActions() == 0 && - GetFlags().Test(lldb::eLaunchFlagLaunchInTTY); + GetNumFileActions() == 0; #else return true; #endif diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index 9a53252b2b4ae..8c1919eca7dda 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -215,10 +215,6 @@ Status ProcessWindows::DoLaunch(Module *exe_module, if (error.Success()) SetID(launch_info.GetProcessID()); m_pty = launch_info.TakePTY(); - // At this point, Process owns the ConPTY. If ProcessLaunchInfo still has a - // reference to it, it might get closed prematurely if another target is - // created. - assert(m_pty.use_count() == 1 && "More than one reference to the ConPTY"); return error; } diff --git a/lldb/test/API/lldbutil-tests/failed-to-hit-breakpoint/TestLLDBUtilFailedToHitBreakpoint.py b/lldb/test/API/lldbutil-tests/failed-to-hit-breakpoint/TestLLDBUtilFailedToHitBreakpoint.py index 632645ac7c7df..60a94e9c25b34 100644 --- a/lldb/test/API/lldbutil-tests/failed-to-hit-breakpoint/TestLLDBUtilFailedToHitBreakpoint.py +++ b/lldb/test/API/lldbutil-tests/failed-to-hit-breakpoint/TestLLDBUtilFailedToHitBreakpoint.py @@ -11,7 +11,6 @@ class LLDBUtilFailedToHitBreakpointTest(TestBase): NO_DEBUG_INFO_TESTCASE = True - @expectedFailureAll(oslist=["windows"]) def test_error_message(self): """ Tests that run_to_source_breakpoint prints the right error message diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_args.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_args.py index 221147f535958..6774f0516ae79 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_args.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_args.py @@ -11,9 +11,6 @@ class TestDAP_launch_args(lldbdap_testcase.DAPTestCaseBase): Tests launch of a simple program with arguments """ - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) def test(self): program = self.getBuildArtifact("a.out") args = ["one", "with space", "'with single quotes'", '"with double quotes"'] diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_basic.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_basic.py index d0e8a792e4e25..93ae5d05e9d6c 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_basic.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_basic.py @@ -12,9 +12,6 @@ class TestDAP_launch_basic(lldbdap_testcase.DAPTestCaseBase): environment, or anything else is specified. """ - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) def test(self): program = self.getBuildArtifact("a.out") self.build_and_launch(program) diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_debuggerRoot.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_debuggerRoot.py index 39397120bf5d8..deeab23d3ec56 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_debuggerRoot.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_debuggerRoot.py @@ -14,9 +14,6 @@ class TestDAP_launch_debuggerRoot(lldbdap_testcase.DAPTestCaseBase): the lldb-dap debug adapter. """ - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) def test(self): program = self.getBuildArtifact("a.out") program_parent_dir = os.path.realpath(os.path.dirname(os.path.dirname(program))) diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_object.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_object.py index f84aff742eed2..8c7994eac7926 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_object.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_environment_with_object.py @@ -7,9 +7,6 @@ class TestDAP_launch(lldbdap_testcase.DAPTestCaseBase): - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) def test_environment_with_object(self): """ Tests launch of a simple program with environment variables diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_disabled.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_disabled.py index b71bfc8152b69..d7b8579845956 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_disabled.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_disabled.py @@ -13,9 +13,6 @@ class TestDAP_launch_shellExpandArguments_disabled(lldbdap_testcase.DAPTestCaseB disabled. """ - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) def test(self): program = self.getBuildArtifact("a.out") program_dir = os.path.dirname(program) diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_enabled.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_enabled.py index 443bb6f6fee54..7ddde219fc88d 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_enabled.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_shellExpandArguments_enabled.py @@ -18,10 +18,9 @@ class TestDAP_launch_shellExpandArguments_enabled(lldbdap_testcase.DAPTestCaseBa """ @skipIfLinux # shell argument expansion doesn't seem to work on Linux - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" + @expectedFailureAll( + oslist=["freebsd", "netbsd", "windows"], bugnumber="llvm.org/pr48349" ) - @expectedFailureAll(oslist=["freebsd", "netbsd"], bugnumber="llvm.org/pr48349") def test(self): program = self.getBuildArtifact("a.out") program_dir = os.path.dirname(program) diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py index 0ed8a5e11bf8b..bec76fb4ef5e1 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_stdio_redirection_and_console.py @@ -4,10 +4,10 @@ from lldbsuite.test.decorators import ( skipIfAsan, - expectedFailureWindows, skipIf, skipIfBuildType, no_match, + skipIfWindows, ) import lldbdap_testcase import tempfile @@ -19,9 +19,7 @@ class TestDAP_launch_stdio_redirection_and_console(lldbdap_testcase.DAPTestCaseB """ @skipIfAsan - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) + @skipIfWindows # https://github.com/llvm/llvm-project/issues/62336 @skipIf(oslist=["linux"], archs=no_match(["x86_64"])) @skipIfBuildType(["debug"]) def test(self): diff --git a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_version.py b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_version.py index a598db41595a5..fca153044da82 100644 --- a/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_version.py +++ b/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch_version.py @@ -13,9 +13,6 @@ class TestDAP_launch_version(lldbdap_testcase.DAPTestCaseBase): as the one returned by "version" command. """ - @expectedFailureWindows( - bugnumber="https://github.com/llvm/llvm-project/issues/137599" - ) def test(self): program = self.getBuildArtifact("a.out") self.build_and_launch(program) _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
