brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 856b3a0 Raw
78 lines · python
1"""2Make sure 'frame var' using DIL parser/evaultor works for local variables.3"""4 5import lldb6from lldbsuite.test.lldbtest import *7from lldbsuite.test.decorators import *8from lldbsuite.test import lldbutil9 10import os11import shutil12import time13 14class TestFrameVarDILMemberOfAnonymousMember(TestBase):15    # If your test case doesn't stress debug info, then16    # set this to true.  That way it won't be run once for17    # each debug info format.18    NO_DEBUG_INFO_TESTCASE = True19 20    def test_frame_var(self):21        self.build()22        lldbutil.run_to_source_breakpoint(self, "Set a breakpoint here",23                                          lldb.SBFileSpec("main.cpp"))24 25        self.expect("settings set target.experimental.use-DIL true",26                    substrs=[""])27        self.expect_var_path("a.x", value="1")28        self.expect_var_path("a.y", value="2")29 30        self.expect(31            "frame variable 'b.x'",32            error=True,33            substrs=['"x" is not a member of "(B) b"'],34        )35        #self.expect_var_path("b.y", value="0")36        self.expect_var_path("b.z", value="3")37        self.expect_var_path("b.w", value="4")38        self.expect_var_path("b.a.x", value="1")39        self.expect_var_path("b.a.y", value="2")40 41        self.expect_var_path("c.x", value="5")42        self.expect_var_path("c.y", value="6")43 44        self.expect_var_path("d.x", value="7")45        self.expect_var_path("d.y", value="8")46        self.expect_var_path("d.z", value="9")47        self.expect_var_path("d.w", value="10")48 49        self.expect(50            "frame variable 'e.x'",51            error=True,52            substrs=['"x" is not a member of "(E) e"'],53        )54        self.expect(55            "frame variable 'f.x'",56            error=True,57            substrs=['"x" is not a member of "(F) f"'],58        )59        self.expect_var_path("f.named_field.x", value="12")60 61        self.expect_var_path("unnamed_derived.y", value="2")62        self.expect_var_path("unnamed_derived.z", value="13")63 64        self.expect(65            "frame variable 'derb.x'",66            error=True,67            substrs=['"x" is not a member of "(DerivedB) derb"'],68        )69        self.expect(70            "frame variable 'derb.y'",71            error=True,72            substrs=['"y" is not a member of "(DerivedB) derb"'],73        )74        self.expect_var_path("derb.w", value="14")75        self.expect_var_path("derb.k", value="15")76        self.expect_var_path("derb.a.x", value="1")77        self.expect_var_path("derb.a.y", value="2")78