[Lldb-commits] [lldb] d3993ac - [lldb][test] Correctly fix break at _dl_debug_state test on arm.

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 18 08:15:22 PDT 2024


Author: Zequan Wu
Date: 2024-04-18T11:13:17-04:00
New Revision: d3993ac1890731d2b24543646961c95680788207

URL: https://github.com/llvm/llvm-project/commit/d3993ac1890731d2b24543646961c95680788207
DIFF: https://github.com/llvm/llvm-project/commit/d3993ac1890731d2b24543646961c95680788207.diff

LOG: [lldb][test] Correctly fix break at _dl_debug_state test on arm.

If lldb finds the dynamic linker in the search path or if the binary is linked staticlly, it will fail at `lldbutil.run_break_set_by_symbol` because the breakpoint is resolved. Otherwise, it's not resolved at this point. But we don't care if it's resolved or not. This test cares about if the breakpoint is hit or not after launching.

This changes the num_expected_locations to -2, which means don't assert on if this breakpoint resolved or not.

Added: 
    

Modified: 
    lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index b6bdd2d6041935..c219a4ee5bd9c6 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -672,7 +672,7 @@ def test_breakpoint_statistics_hitcount(self):
         for breakpoint_stats in breakpoints_stats:
             self.assertIn("hitCount", breakpoint_stats)
 
-    @skipIf(oslist=no_match(["linux"]), archs=["arm", "aarch64"])
+    @skipIf(oslist=no_match(["linux"]))
     def test_break_at__dl_debug_state(self):
         """
         Test lldb is able to stop at _dl_debug_state if it is set before the
@@ -682,7 +682,7 @@ def test_break_at__dl_debug_state(self):
         exe = self.getBuildArtifact("a.out")
         self.runCmd("target create %s" % exe)
         bpid = lldbutil.run_break_set_by_symbol(
-            self, "_dl_debug_state", num_expected_locations=0
+            self, "_dl_debug_state", num_expected_locations=-2
         )
         self.runCmd("run")
         self.assertIsNotNone(


        


More information about the lldb-commits mailing list