[DWARFASTParserClang] Complete external record types before using them as a decl context.
Summary: When in a gmodules-like debugging scenario, you can have a parent decl context that gets imported from an external AST. When this happens, we must be careful to complete this type before adding children to it, otherwise it sometimes results in a crash. Reviewers: clayborg, jingham Subscribers: aprantl, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D43592 llvm-svn: 327750
This commit is contained in:
@@ -69,3 +69,26 @@ class TestWithGmodulesDebugInfo(TestBase):
|
||||
42,
|
||||
memberValue.GetValueAsSigned(),
|
||||
"Member value incorrect")
|
||||
|
||||
testValue = frame.EvaluateExpression("bar")
|
||||
self.assertTrue(
|
||||
testValue.GetError().Success(),
|
||||
"Test expression value invalid: %s" %
|
||||
(testValue.GetError().GetCString()))
|
||||
self.assertTrue(
|
||||
testValue.GetTypeName() == "Foo::Bar",
|
||||
"Test expression type incorrect")
|
||||
|
||||
memberValue = testValue.GetChildMemberWithName("i")
|
||||
self.assertTrue(
|
||||
memberValue.GetError().Success(),
|
||||
"Member value missing or invalid: %s" %
|
||||
(testValue.GetError().GetCString()))
|
||||
self.assertTrue(
|
||||
memberValue.GetTypeName() == "int",
|
||||
"Member type incorrect")
|
||||
self.assertEqual(
|
||||
123,
|
||||
memberValue.GetValueAsSigned(),
|
||||
"Member value incorrect")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user