| 1 |
""" |
| 2 |
Make sure 'frame var' using DIL parser/evaluator works for namespaces. |
| 3 |
""" |
| 4 |
|
| 5 |
import lldb |
| 6 |
from lldbsuite.test.lldbtest import * |
| 7 |
from lldbsuite.test.decorators import * |
| 8 |
from lldbsuite.test import lldbutil |
| 9 |
|
| 10 |
import os |
| 11 |
import shutil |
| 12 |
import time |
| 13 |
|
| 14 |
|
| 15 |
class TestFrameVarDILQualifiedId(TestBase): |
| 16 |
# If your test case doesn't stress debug info, then |
| 17 |
# set this to true. That way it won't be run once for |
| 18 |
# each debug info format. |
| 19 |
NO_DEBUG_INFO_TESTCASE = True |
| 20 |
|
| 21 |
@skipIfWindows |
| 22 |
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 |
) |