zequanwu added inline comments.
================ Comment at: lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:681 + auto &ts = llvm::cast<TypeSystemClang>(*ct.GetTypeSystem()); + ts.GetMetadata(&tag)->SetIsForcefullyCompleted(); + } ---------------- zequanwu wrote: > labath wrote: > > zequanwu wrote: > > > rnk wrote: > > > > Is this what we do for DWARF? The same kind of situation seems like it > > > > can arise, where clang requires a type to be complete, but the > > > > information is missing, and we still try to proceed with evaluation. > > > I think it's here: > > > https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp#L221-L250, > > > relevant: https://reviews.llvm.org/D85968. > > The trick is to do the forced completion only when the type is used within > > contexts where the c++ rules require it to be complete. something like > > `class A; A* a;` is perfectly legal c++. `class A; class B : A {};` is not. > > You can't do this from within the completion callback. In DWARF code, we > > check for this when we're parsing the enclosing entity (so, when we're > > parsing `B`, we'd check, and if needed, "forcefully complete" the class `A`. > What does dwarf plugin do in this case that we don't have debug info for > class A: `class A; class B : A {};`? The problem I'm trying to fix is when > the base class has no debug info to complete it. @labath, Do you see anything would go wrong if we forcefully complete a class that has no debug info? It seems fine, for the chrome crash report I was checking. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134066/new/ https://reviews.llvm.org/D134066 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits