Index: packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py =================================================================== --- packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py +++ packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py @@ -69,3 +69,26 @@ 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") + Index: packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp =================================================================== --- packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp +++ packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp @@ -1,5 +1,8 @@ +class Foo::Bar { int i = 123; }; + int main(int argc, const char * argv[]) { IntContainer test(42); + Foo::Bar bar; return 0; // break here } Index: packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h =================================================================== --- packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h +++ packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h @@ -10,3 +10,8 @@ }; typedef GenericContainer IntContainer; + +struct Foo { + class Bar; + Bar *bar; +}; Index: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -179,10 +179,9 @@ lldb_private::CompilerType type = GetClangASTImporter().CopyType(m_ast, dwo_type); - // printf ("copied_qual_type: ast = %p, clang_type = %p, name = - // '%s'\n", m_ast, copied_qual_type.getAsOpaquePtr(), - // external_type->GetName().GetCString()); - if (!type) + // The type we retrieve from the PCM debug info needs to be + // complete, otherwise we might crash when trying to extend it. + if (!type || !GetClangASTImporter().CompleteType(type)) return TypeSP(); SymbolFileDWARF *dwarf = die.GetDWARF();