tberghammer added a comment. In https://reviews.llvm.org/D39825#920739, @alexshap wrote:
> @tberghammer, SymbolFileDWARF (the base class of SymbolFileDWARFDwo) calls > Index() > "lazily" in may places, so indexing of dwo happens almost inevitably (at the > moment) > (FindCompleteObjCDefinitionTypeForDIE is just one example). The main point is that you should almost always interact with the SymbolFileDWARF instance belonging to the main object file and it (actually DWARFCompileUnit) will know when to access data from the Dwo file instead. The original goal was to not leak pointers to SymbolFileDWARFDwo instances out from symbol file dwarf and the dwarf parsing logic. >> because this way you will index the compile unit twice (once from the main >> object file and once from the dwo), >> then create 2 CompilerType for the 2 indexed version and will start hitting >> random issues in >> expression evaluation when clang will get confused by 2 declaration for the >> same type. > > there are two separate CompileUnits here, not one, > There is a compile unit represented by m_base_dwarf_cu (roughly speaking for > .o) and and there is another one > (which we can get, for example, via SymbolFileDWARFDwo::GetCompileUnit()) > (roughly speaking for dwo). > (please, correct me if i'm wrong). For the latter GetOffset() would > typically return 0, > for the former GetOffset() typically returns the higher 32 bits of Id. We have 2 DWARFCompileUnit but actually they belong to the same "compile time compile unit" so when you call Index on the one in the main object file (SymbolFileDWARF instance) it will read the data in from the Dwo file as well, add that data into its index and create some stub types in clang (they will be filled in later lazily). Repository: rL LLVM https://reviews.llvm.org/D39825 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits