|
12 | 12 | class FoundationDisassembleTestCase(TestBase): |
13 | 13 | NO_DEBUG_INFO_TESTCASE = True |
14 | 14 |
|
15 | | - @skipIfAsan |
16 | | - def test_foundation_disasm(self): |
17 | | - """Do 'disassemble -n func' on each and every 'Code' symbol entry from the Foundation.framework.""" |
18 | | - self.build() |
19 | | - |
20 | | - # Enable synchronous mode |
21 | | - self.dbg.SetAsync(False) |
22 | | - |
23 | | - # Create a target by the debugger. |
24 | | - target = self.dbg.CreateTarget(self.getBuildArtifact("a.out")) |
25 | | - self.assertTrue(target, VALID_TARGET) |
26 | | - |
27 | | - # Now launch the process, and do not stop at entry point. |
28 | | - process = target.LaunchSimple(None, None, self.get_process_working_directory()) |
29 | | - self.assertTrue(process, PROCESS_IS_VALID) |
30 | | - |
31 | | - foundation_framework = None |
32 | | - for module in target.modules: |
33 | | - if module.file.basename == "Foundation": |
34 | | - foundation_framework = module.file.fullpath |
35 | | - break |
36 | | - |
37 | | - self.assertIsNotNone(foundation_framework, "Foundation.framework path located") |
38 | | - self.runCmd("image dump symtab '%s'" % foundation_framework) |
39 | | - raw_output = self.res.GetOutput() |
40 | | - # Now, grab every 'Code' symbol and feed it into the command: |
41 | | - # 'disassemble -n func'. |
42 | | - # |
43 | | - # The symbol name is on the last column and trails the flag column which |
44 | | - # looks like '0xhhhhhhhh', i.e., 8 hexadecimal digits. |
45 | | - codeRE = re.compile( |
46 | | - r""" |
47 | | - \ Code\ {9} # ' Code' followed by 9 SPCs, |
48 | | - .* # the wildcard chars, |
49 | | - 0x[0-9a-f]{8} # the flag column, and |
50 | | - \ (.+)$ # finally the function symbol. |
51 | | - """, |
52 | | - re.VERBOSE, |
53 | | - ) |
54 | | - for line in raw_output.split(os.linesep): |
55 | | - match = codeRE.search(line) |
56 | | - if match: |
57 | | - func = match.group(1) |
58 | | - self.runCmd('image lookup -s "%s"' % func) |
59 | | - self.runCmd('disassemble --force -n "%s"' % func) |
60 | | - |
61 | 15 | @skipIfAsan |
62 | 16 | def test_simple_disasm(self): |
63 | 17 | """Test the lldb 'disassemble' command""" |
|
0 commit comments