2 Test the Intel(R) MPX bound violation signal.
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class RegisterCommandsTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
17 @skipIf(compiler="clang")
18 @skipIf(oslist=no_match(['linux']))
19 @skipIf(archs=no_match(['i386', 'x86_64']))
20 @skipIf(oslist=["linux"], compiler="gcc", compiler_version=["<", "5"]) #GCC version >= 5 supports Intel(R) MPX.
21 def test_mpx_boundary_violation(self):
22 """Test Intel(R) MPX bound violation signal."""
24 self.mpx_boundary_violation()
26 def mpx_boundary_violation(self):
27 exe = self.getBuildArtifact("a.out")
28 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
30 self.runCmd("run", RUN_SUCCEEDED)
32 target = self.dbg.GetSelectedTarget()
33 process = target.GetProcess()
35 if (process.GetState() == lldb.eStateExited):
36 self.skipTest("Intel(R) MPX is not supported.")
38 if (process.GetState() == lldb.eStateStopped):
39 self.expect("thread backtrace", STOPPED_DUE_TO_SIGNAL,
40 substrs = ['stop reason = signal SIGSEGV: upper bound violation',
41 'fault address:', 'lower bound:', 'upper bound:'])
43 self.runCmd("continue")
45 if (process.GetState() == lldb.eStateStopped):
46 self.expect("thread backtrace", STOPPED_DUE_TO_SIGNAL,
47 substrs = ['stop reason = signal SIGSEGV: lower bound violation',
48 'fault address:', 'lower bound:', 'upper bound:'])
50 self.runCmd("continue")
51 self.assertTrue(process.GetState() == lldb.eStateExited,