Files
clang-p2996/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/base.py
Jonas Devlieghere a87b27fd51 [lldb] Fix the hardware breakpoint decorator (#146609)
A decorator to skip or XFAIL a test takes effect when the function
that's passed in returns a reason string. The wrappers around
hw_breakpoints_supported were doing that incorrectly by inverting
(calling `not`) on the result, turning it into a boolean, which means
the test is always skipped.
2025-07-01 18:01:19 -07:00

29 lines
820 B
Python

"""
Base class for hardware breakpoints tests.
"""
from lldbsuite.test.lldbtest import *
class HardwareBreakpointTestBase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def supports_hw_breakpoints(self):
self.build()
self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.runCmd("breakpoint set -b main --hardware")
self.runCmd("run")
if "stopped" in self.res.GetOutput():
return True
return False
def hw_breakpoints_supported(self):
if self.supports_hw_breakpoints():
return "Hardware breakpoints are supported"
return None
def hw_breakpoints_unsupported(self):
if not self.supports_hw_breakpoints():
return "Hardware breakpoints are unsupported"
return None