brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · a3b752e Raw
41 lines · python
1"""2Test SBFunction::GetBaseName() and SBSymbol::GetBaseName() APIs.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8from lldbsuite.test import lldbutil9 10 11class GetBaseNameTestCase(TestBase):12    NO_DEBUG_INFO_TESTCASE = True13 14    def setUp(self):15        TestBase.setUp(self)16        self.main_source_file = lldb.SBFileSpec("main.cpp")17 18    @expectedFailureAll(19        oslist=["windows"],20        bugnumber="https://github.com/llvm/llvm-project/issues/156861",21    )22    def test(self):23        """Test SBFunction.GetBaseName() and SBSymbol.GetBaseName()"""24        self.build()25        _, _, thread, _ = lldbutil.run_to_source_breakpoint(26            self, "Set a breakpoint here", self.main_source_file27        )28 29        frame0 = thread.GetFrameAtIndex(0)30 31        # Get both function and symbol32        function = frame0.GetFunction()33        symbol = frame0.GetSymbol()34 35        # Test consistency between function and symbol basename36        function_basename = function.GetBaseName()37        symbol_basename = symbol.GetBaseName()38 39        self.assertEqual(function_basename, "templateFunc")40        self.assertEqual(symbol_basename, "templateFunc")41