aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/base.py
blob: 0ad903befc65e5d87bdc01444d9b747b234e030d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
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