[Lldb-commits] [PATCH] D96194: Defer the decision whether to use the CU or TU index until after reading the unit header.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Feb 6 04:31:32 PST 2021


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Nice catch. Regarding the implementation, I think it might be slightly cleaner (and slightly more consistent with the llvm dwarf parser) if the index handling has moved to the DWARFUnit class (as there's nothing to be gained now by doing it higher up). In `DWARFUnit::extract`, you could do something like:

  if (dwarf.GetDWARFContext().isDWO()) {
    cu_index = &dwarf.GetDWARFContext().GetAsLLVM().getCUIndex();
    ...



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:808-809
 
+  if (cu_index && (header.m_unit_type == llvm::dwarf::DW_UT_compile ||
+                   header.m_unit_type == llvm::dwarf::DW_UT_split_compile)) {
+    header.m_index_entry = cu_index->getFromOffset(header.m_offset);
----------------
I guess this could be `header.IsTypeUnit()` (and `!header.IsTypeUnit())`)...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96194/new/

https://reviews.llvm.org/D96194



More information about the lldb-commits mailing list