brintos

brintos / llvm-project-archived public Read only

0
0
Text · 820 B · 0ad903b Raw
29 lines · python
1"""2Base class for hardware breakpoints tests.3"""4 5from lldbsuite.test.lldbtest import *6 7 8class HardwareBreakpointTestBase(TestBase):9    NO_DEBUG_INFO_TESTCASE = True10 11    def supports_hw_breakpoints(self):12        self.build()13        self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)14        self.runCmd("breakpoint set -b main --hardware")15        self.runCmd("run")16        if "stopped" in self.res.GetOutput():17            return True18        return False19 20    def hw_breakpoints_supported(self):21        if self.supports_hw_breakpoints():22            return "Hardware breakpoints are supported"23        return None24 25    def hw_breakpoints_unsupported(self):26        if not self.supports_hw_breakpoints():27            return "Hardware breakpoints are unsupported"28        return None29