47 lines · python
1"""2Make sure 'frame var' using DIL parser/evaluator works for namespaces.3"""4 5import lldb6from lldbsuite.test.lldbtest import *7from lldbsuite.test.decorators import *8from lldbsuite.test import lldbutil9 10import os11import shutil12import time13 14 15class TestFrameVarDILQualifiedId(TestBase):16 # If your test case doesn't stress debug info, then17 # set this to true. That way it won't be run once for18 # each debug info format.19 NO_DEBUG_INFO_TESTCASE = True20 21 @skipIfWindows22 def test_frame_var(self):23 self.build()24 lldbutil.run_to_source_breakpoint(25 self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")26 )27 28 self.runCmd("settings set target.experimental.use-DIL true")29 self.expect_var_path("::ns::i", value="1")30 self.expect_var_path("ns::i", value="1")31 self.expect_var_path("::ns::ns::i", value="2")32 self.expect_var_path("ns::ns::i", value="2")33 34 self.expect_var_path("foo", value="1")35 self.expect_var_path("::(anonymous namespace)::foo", value="13")36 self.expect_var_path("(anonymous namespace)::foo", value="13")37 self.expect_var_path("ns1::(anonymous namespace)::foo", value="5")38 self.expect_var_path(39 "(anonymous namespace)::ns2::(anonymous namespace)::foo",40 value="7",41 )42 self.expect_var_path("::ns1::(anonymous namespace)::foo", value="5")43 self.expect_var_path(44 "::(anonymous namespace)::ns2::(anonymous namespace)::foo",45 value="7",46 )47