[Lldb-commits] [lldb] [lldb][test] StepUntil disable test for unsupported linkers. (PR #157474)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 9 04:54:32 PDT 2025


https://github.com/da-viper updated https://github.com/llvm/llvm-project/pull/157474

>From d31564848a9d64c088f5cb549fd75a949a589eef Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Mon, 8 Sep 2025 15:23:25 +0100
Subject: [PATCH] [lldb][test] StepUntil skip test for unsupported linkers.

`INSERT BEFORE` keyword is not supported in current versions gold and mold linkers. Since we cannot confirm accurately what linker and version is available on the system and when it will be supported.
---
 .../thread/step_until/TestStepUntil.py        | 10 ++--
 .../thread/step_until/TestStepUntilAPI.py     | 50 ++++++++++++-------
 2 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/lldb/test/API/functionalities/thread/step_until/TestStepUntil.py b/lldb/test/API/functionalities/thread/step_until/TestStepUntil.py
index 965da02ed0f98..afdc92dd40001 100644
--- a/lldb/test/API/functionalities/thread/step_until/TestStepUntil.py
+++ b/lldb/test/API/functionalities/thread/step_until/TestStepUntil.py
@@ -1,10 +1,9 @@
 """Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
 
-
-import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
+from lldbsuite.test_event.build_exception import BuildError
 
 
 class StepUntilTestCase(TestBase):
@@ -112,10 +111,15 @@ def test_bad_line(self):
     @no_debug_info_test
     @skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
     @skipIf(archs=no_match(["x86_64", "aarch64"]))
+    @skipIf(compiler=no_match(["clang"]))
     def test_bad_line_discontinuous(self):
         """Test that we get an error if attempting to step outside the current
         function -- and the function is discontinuous"""
-        self.build(dictionary=self._build_dict_for_discontinuity())
+        try:
+            self.build(dictionary=self._build_dict_for_discontinuity())
+        except BuildError as ex:
+            self.skipTest(f"failed to build with linker script.")
+
         _, _, thread, _ = lldbutil.run_to_source_breakpoint(
             self, "At the start", lldb.SBFileSpec(self.main_source)
         )
diff --git a/lldb/test/API/functionalities/thread/step_until/TestStepUntilAPI.py b/lldb/test/API/functionalities/thread/step_until/TestStepUntilAPI.py
index 59e028acf014c..08d78fb996c75 100644
--- a/lldb/test/API/functionalities/thread/step_until/TestStepUntilAPI.py
+++ b/lldb/test/API/functionalities/thread/step_until/TestStepUntilAPI.py
@@ -1,7 +1,7 @@
-import lldb
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
+from lldbsuite.test_event.build_exception import BuildError
 
 
 class TestStepUntilAPI(TestBase):
@@ -74,15 +74,20 @@ def test_hitting(self):
 
     @skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
     @skipIf(archs=no_match(["x86_64", "aarch64"]))
+    @skipIf(compiler=no_match(["clang"]))
     def test_hitting_discontinuous(self):
         """Test SBThread.StepOverUntil - targeting a line and hitting it -- with
         discontinuous functions"""
-        self._do_until(
-            self._build_dict_for_discontinuity(),
-            None,
-            self.less_than_two,
-            self.less_than_two,
-        )
+        try:
+            self._do_until(
+                self._build_dict_for_discontinuity(),
+                None,
+                self.less_than_two,
+                self.less_than_two,
+            )
+        except BuildError as ex:
+            self.skipTest(f"failed to build with linker script.")
+
         self._assertDiscontinuity()
 
     def test_missing(self):
@@ -93,15 +98,20 @@ def test_missing(self):
 
     @skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
     @skipIf(archs=no_match(["x86_64", "aarch64"]))
+    @skipIf(compiler=no_match(["clang"]))
     def test_missing_discontinuous(self):
         """Test SBThread.StepOverUntil - targeting a line and missing it by
         stepping out to call site -- with discontinuous functions"""
-        self._do_until(
-            self._build_dict_for_discontinuity(),
-            ["foo", "bar", "baz"],
-            self.less_than_two,
-            self.back_out_in_main,
-        )
+        try:
+            self._do_until(
+                self._build_dict_for_discontinuity(),
+                ["foo", "bar", "baz"],
+                self.less_than_two,
+                self.back_out_in_main,
+            )
+        except BuildError as ex:
+            self.skipTest(f"failed to build with linker script.")
+
         self._assertDiscontinuity()
 
     def test_bad_line(self):
@@ -120,13 +130,19 @@ def test_bad_line(self):
 
     @skipIf(oslist=lldbplatformutil.getDarwinOSTriples() + ["windows"])
     @skipIf(archs=no_match(["x86_64", "aarch64"]))
+    @skipIf(compiler=no_match(["clang"]))
     def test_bad_line_discontinuous(self):
         """Test that we get an error if attempting to step outside the current
         function -- and the function is discontinuous"""
-        self.build(dictionary=self._build_dict_for_discontinuity())
-        _, _, thread, _ = lldbutil.run_to_source_breakpoint(
-            self, "At the start", self.main_spec
-        )
+
+        try:
+            self.build(dictionary=self._build_dict_for_discontinuity())
+            _, _, thread, _ = lldbutil.run_to_source_breakpoint(
+                self, "At the start", self.main_spec
+            )
+        except BuildError as ex:
+            self.skipTest(f"failed to build with linker script.")
+
         self.assertIn(
             "step until target not in current function",
             thread.StepOverUntil(



More information about the lldb-commits mailing list