brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · ca56436 Raw
55 lines · python
1"""2Test thread step-in ignores frames according to the "Avoid regexp" option.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8from lldbsuite.test import lldbutil9 10 11class StepAvoidsRegexTestCase(TestBase):12    def hit_correct_function(self, pattern):13        name = self.thread.frames[0].GetFunctionName()14        self.assertIn(15            pattern,16            name,17            "Got to '%s' not the expected function '%s'." % (name, pattern),18        )19 20    def setUp(self):21        TestBase.setUp(self)22        self.dbg.HandleCommand(23            "settings set target.process.thread.step-avoid-regexp ^ignore::"24        )25 26    @skipIfWindows27    @skipIf(compiler="clang", compiler_version=["<", "11.0"])28    def test_step_avoid_regex(self):29        """Tests stepping into a function which matches the avoid regex"""30        self.build()31        (_, _, self.thread, _) = lldbutil.run_to_source_breakpoint(32            self, "main", lldb.SBFileSpec("main.cpp")33        )34 35        # Try to step into ignore::auto_ret36        self.thread.StepInto()37        self.hit_correct_function("main")38 39        # Try to step into ignore::with_tag40        self.thread.StepInto()41        self.hit_correct_function("main")42 43        # Try to step into ignore::decltype_auto_ret44        self.thread.StepInto()45        self.hit_correct_function("main")46 47        # Try to step into ignore::with_tag_template48        self.thread.StepInto()49        self.hit_correct_function("main")50 51        # Step into with_tag_template_returns_ignore which is outside the 'ignore::'52        # namespace but returns a type from 'ignore::'53        self.thread.StepInto()54        self.hit_correct_function("with_tag_template_returns_ignore")55