• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""
2Test 'target modules dump symtab -m' doesn't demangle symbols.
3"""
4
5from lldbsuite.test.decorators import *
6from lldbsuite.test.lldbtest import *
7from lldbsuite.test import lldbutil
8
9class TestCase(TestBase):
10
11    mydir = TestBase.compute_mydir(__file__)
12
13    @no_debug_info_test
14    def test(self):
15        src_dir = self.getSourceDir()
16        yaml_path = os.path.join(src_dir, "a.yaml")
17        yaml_base, ext = os.path.splitext(yaml_path)
18        obj_path = self.getBuildArtifact("main.o")
19        self.yaml2obj(yaml_path, obj_path)
20
21        # Create a target with the object file we just created from YAML
22        target = self.dbg.CreateTarget(obj_path)
23        self.assertTrue(target, VALID_TARGET)
24
25        # First test that we demangle by default and our mangled symbol isn't in the output.
26        self.expect("target modules dump symtab", substrs=["foo::bar(int)"])
27        self.expect("target modules dump symtab", matching=False, substrs=["_ZN3foo3barEi"])
28
29        # Turn off demangling and make sure that we now see the mangled name in the output.
30        self.expect("target modules dump symtab -m", substrs=["_ZN3foo3barEi"])
31