2 Test some lldb command abbreviations.
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
.lldbtest
import *
9 from lldbsuite
.test
import lldbutil
12 class FatArchiveTestCase(TestBase
):
14 mydir
= TestBase
.compute_mydir(__file__
)
16 NO_DEBUG_INFO_TESTCASE
= True
19 def test_breakpoint_resolution_dwarf(self
):
20 if self
.getArchitecture() == 'x86_64':
25 "This test requires x86_64 as the architecture for the inferior")
28 '''This test compiles a quick example by making a fat file (universal) full of
29 skinny .o files and makes sure we can use them to resolve breakpoints when doing
30 DWARF in .o file debugging. The only thing this test needs to do is to compile and
31 set a breakpoint in the target and verify any breakpoint locations have valid debug
32 info for the function, and source file and line.'''
33 exe
= self
.getBuildArtifact("a.out")
36 target
= self
.dbg
.CreateTarget(exe
)
38 # Create a breakpoint by name
39 breakpoint
= target
.BreakpointCreateByName('foo', exe
)
40 self
.assertTrue(breakpoint
, VALID_BREAKPOINT
)
42 # Make sure the breakpoint resolves to a function, file and line
43 for bp_loc
in breakpoint
:
44 # Get a section offset address (lldb.SBAddress) from the breakpoint
46 bp_loc_addr
= bp_loc
.GetAddress()
47 line_entry
= bp_loc_addr
.GetLineEntry()
48 function
= bp_loc_addr
.GetFunction()
51 "Verify breakpoint in fat BSD archive has valid function debug info")
53 line_entry
.GetFileSpec(),
54 "Verify breakpoint in fat BSD archive has source file information")
56 line_entry
.GetLine() != 0,
57 "Verify breakpoint in fat BSD archive has source line information")