2 from lldbsuite
.test
.decorators
import *
3 from lldbsuite
.test
.lldbtest
import *
4 from lldbsuite
.test
import lldbutil
7 class TestCase(TestBase
):
11 lldbutil
.run_to_source_breakpoint(
12 self
, "// break here", lldb
.SBFileSpec("main.cpp")
15 m_val
= self
.expect_expr(
17 result_type
="WithMember",
18 result_children
=[ValueCheck(name
="i", value
="1")],
20 # FIXME: The non-display name doesn't include the function, so users
21 # can't actually match specific classes by their name. Either document
23 self
.assertEqual(m_val
.GetType().GetName(), "WithMember")
24 # Try accessing the type in the expression evaluator.
25 self
.expect_expr("m.i", result_type
="int", result_value
="1")
29 result_type
="TypedefUnnamed",
30 result_children
=[ValueCheck(name
="a", value
="2")],
34 result_type
="TypedefUnnamed2",
35 result_children
=[ValueCheck(name
="b", value
="3")],
39 result_type
="(unnamed struct)",
40 result_children
=[ValueCheck(name
="i", value
="4")],
44 result_type
="(unnamed struct)",
45 result_children
=[ValueCheck(name
="j", value
="5")],
48 # Try a class that is only forward declared.
49 self
.expect_expr("fwd", result_type
="Forward *")
51 "expression -- fwd->i",
53 substrs
=["member access into incomplete type 'Forward'"],
58 substrs
=["incomplete type 'Forward' where a complete type is required"],
61 # Try a class that has a name that matches a class in the global scope.
62 self
.expect_expr("fwd_conflict", result_type
="ForwardConflict *")
63 # FIXME: This pulls in the unrelated type with the same name from the
66 "expression -- fwd_conflict->i",
69 # This should point out that ForwardConflict is incomplete.
70 "no member named 'i' in 'ForwardConflict'"
74 "expression -- *fwd_conflict",
77 # This should fail to parse instead.
78 "couldn't read its memory"