1 """ Testing debugging of a binary with "mixed" dwarf (with/without fission). """
3 from lldbsuite.test.decorators import *
4 from lldbsuite.test.lldbtest import *
5 from lldbsuite.test import lldbutil
8 class TestMixedDwarfBinary(TestBase):
9 mydir = TestBase.compute_mydir(__file__)
11 @no_debug_info_test # Prevent the genaration of the dwarf version of this test
12 @add_test_categories(["dwo"])
13 @skipUnlessPlatform(["linux"])
14 def test_mixed_dwarf(self):
15 """Test that 'frame variable' works
16 for the executable built from two source files compiled
17 with/whithout -gsplit-dwarf correspondingly."""
20 exe = self.getBuildArtifact("a.out")
22 self.target = self.dbg.CreateTarget(exe)
23 self.assertTrue(self.target, VALID_TARGET)
25 main_bp = self.target.BreakpointCreateByName("g", "a.out")
26 self.assertTrue(main_bp, VALID_BREAKPOINT)
28 self.process = self.target.LaunchSimple(
29 None, None, self.get_process_working_directory())
30 self.assertTrue(self.process, PROCESS_IS_VALID)
32 # The stop reason of the thread should be breakpoint.
33 self.assertTrue(self.process.GetState() == lldb.eStateStopped,
34 STOPPED_DUE_TO_BREAKPOINT)
36 frame = self.process.GetThreadAtIndex(0).GetFrameAtIndex(0)
37 x = frame.FindVariable("x")
38 self.assertTrue(x.IsValid(), "x is not valid")
39 y = frame.FindVariable("y")
40 self.assertTrue(y.IsValid(), "y is not valid")