[Lldb-commits] [PATCH] D43592: [DWARFASTParserClang] Always complete types read from a module/PCH AST context.
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 22 08:12:21 PST 2018
clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.
Sean was the person with the most experience working on the expression parser and he wrote the clang AST importer, but Jim is now the expression parser expert. Jim: and ideas on how this really should be fixed?
Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:182-184
+ // 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))
We typically should never need to do the completion of a type manually like this. Many times we have variables that are like "foo *". For this variable, we might never need to complete the type since it is only a pointer. Furthermore, always completing a type will make LLDB very slow as every type we touch is now completing as soon as we import it. So while this patch might work, it will really affect LLDB performance. I think the right fix is probably elsewhere where someone isn't checking if the type is complete before doing the work that crashes clang...
More information about the lldb-commits