https://github.com/charles-zablit created 
https://github.com/llvm/llvm-project/pull/183126

This reverts commit 980c24897e1d6114e8a5795045e6b1b39bee1887.

>From dd4e2963e39aa296b00e0110eaa0df3016ce86f4 Mon Sep 17 00:00:00 2001
From: Charles Zablit <[email protected]>
Date: Tue, 24 Feb 2026 18:52:42 +0000
Subject: [PATCH] Revert "[lldb] fix Makefile.rules cross platform macros
 (#183090)"

This reverts commit 980c24897e1d6114e8a5795045e6b1b39bee1887.
---
 .../Python/lldbsuite/test/make/Makefile.rules | 10 +++---
 .../API/tools/lldb-dap/conpty-drain/Makefile  |  3 --
 .../conpty-drain/TestDAP_conpty_drain.py      | 32 -------------------
 .../API/tools/lldb-dap/conpty-drain/main.c    | 11 -------
 4 files changed, 4 insertions(+), 52 deletions(-)
 delete mode 100644 lldb/test/API/tools/lldb-dap/conpty-drain/Makefile
 delete mode 100644 
lldb/test/API/tools/lldb-dap/conpty-drain/TestDAP_conpty_drain.py
 delete mode 100644 lldb/test/API/tools/lldb-dap/conpty-drain/main.c

diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules 
b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index f7f6e48f71e55..eeaf651792fee 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -46,9 +46,8 @@ ifeq "$(OS)" "Windows_NT"
        RM_F = del /f /q $(subst /,\,$(1))
        RM_RF = rd /s /q $(subst /,\,$(1))
        LN_SF = mklink /D "$(subst /,\,$(2))" "$(subst /,\,$(1))"
-       ECHO = echo $(1);
-       ECHO_TO_FILE = printf "%s\n" $(1) > "$(subst /,\,$(2))"
-       ECHO_APPEND_FILE = printf "%s\n" $(1) >> "$(subst /,\,$(2))"
+       ECHO = echo $(1)
+       ECHO_TO_FILE = echo $(1) > $(subst /,\,$(2))
 else
        MKDIR_P = mkdir -p $(1)
        CP = cp $(1) $(2)
@@ -57,9 +56,8 @@ else
        RM_F = rm -f $(1)
        RM_RF = rm -rf $(1)
        LN_SF = ln -sf $(1) $(2)
-       ECHO = echo $(1);
-       ECHO_TO_FILE = printf '%s\n' $(1) > "$(2)"
-       ECHO_APPEND_FILE = printf '%s\n' $(1) >> "$(2)"
+       ECHO = echo "$(1)"
+       ECHO_TO_FILE = echo $(1) > $(2)
 endif
 
 # Suppress built-in suffix rules. We explicitly define rules for %.o.
diff --git a/lldb/test/API/tools/lldb-dap/conpty-drain/Makefile 
b/lldb/test/API/tools/lldb-dap/conpty-drain/Makefile
deleted file mode 100644
index 10495940055b6..0000000000000
--- a/lldb/test/API/tools/lldb-dap/conpty-drain/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-C_SOURCES := main.c
-
-include Makefile.rules
diff --git a/lldb/test/API/tools/lldb-dap/conpty-drain/TestDAP_conpty_drain.py 
b/lldb/test/API/tools/lldb-dap/conpty-drain/TestDAP_conpty_drain.py
deleted file mode 100644
index abf765d5e8ab2..0000000000000
--- a/lldb/test/API/tools/lldb-dap/conpty-drain/TestDAP_conpty_drain.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""
-Test that all debuggee output is captured when the process exits quickly
-after producing output. This exercises the ConPTY pipe drain logic on
-Windows to ensure no data is lost at process exit.
-"""
-
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-import lldbdap_testcase
-
-
-class TestDAP_conpty_drain(lldbdap_testcase.DAPTestCaseBase):
-    @skipUnlessWindows
-    def test_output_not_lost_at_exit(self):
-        """Test that stdout is fully captured when the debuggee exits
-        immediately after writing output, exercising the ConPTY drain path."""
-        program = self.getBuildArtifact("a.out")
-        self.build_and_launch(program, disconnectAutomatically=False)
-        self.continue_to_exit()
-        self.dap_server.request_disconnect()
-
-        output = self.get_stdout()
-        self.assertIsNotNone(output, "expect program stdout")
-        self.assertIn(
-            "DONE",
-            output,
-            "final output marker not found, data was lost in the ConPTY pipe: "
-            + repr(output[-200:] if output else output),
-        )
-        # Verify we got a reasonable amount of the output
-        self.assertIn("line 99:", output, "last numbered line not found")
-        self.assertIn("line 0:", output, "first numbered line not found")
diff --git a/lldb/test/API/tools/lldb-dap/conpty-drain/main.c 
b/lldb/test/API/tools/lldb-dap/conpty-drain/main.c
deleted file mode 100644
index 76c1d1356af66..0000000000000
--- a/lldb/test/API/tools/lldb-dap/conpty-drain/main.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-int main() {
-  // Print a large amount of output to increase the chance that data is still 
in
-  // the ConPTY pipe buffer when the process exits. The test verifies that all
-  // lines are received, including the final marker.
-  for (int i = 0; i < 100; i++)
-    printf("line %d: the quick brown fox jumps over the lazy dog\n", i);
-  printf("DONE\n");
-  return 0;
-}

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to