[Lldb-commits] [PATCH] D63399: DWARF: Make DIERefs always valid

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 17 12:17:42 PDT 2019


labath marked 2 inline comments as done.
labath added a comment.

In D63399#1546330 <https://reviews.llvm.org/D63399#1546330>, @clayborg wrote:

> I am concerned that our mapping from DIERef to lldb::user_id_t won't work for all cases now that we are/have expanded the DIERef class (including as we add the DWO field). I voiced this concern in https://reviews.llvm.org/D63428. Let me know what you think.


I'll reply to that review tomorrow, for now here's a quick reply to the comments in this review.



================
Comment at: source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp:59
 
   DWARFUnit *cu = m_debug_info.GetUnitAtOffset(DIERef::Section::DebugInfo, *cu_offset);
   if (!cu)
----------------
clayborg wrote:
> Shouldn't we be using the section from the DIERef in "entry" instead of hard coding to "DIERef::Section::DebugInfo" here? If so we need a test to cover this case so we don't regress
debug_names is DWARF5 only, which has moved back type units into the debug_info section. So `entry` does not contain the section, nor does it need to because we can always assume all units will be in the debug_info section.


================
Comment at: source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h:64
+    explicit operator DIERef() const {
+      return DIERef(DIERef::Section::DebugInfo, DW_INVALID_OFFSET, die_offset);
+    }
----------------
clayborg wrote:
> DIEInfo objects are only ever used in .debug_info?
Yes. They are only used with apple indexes, and those only work with debug_info sections. -fdebug-types-section is hard-disabled on apple targets nowadays (it used to crash the compiler before that).


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

https://reviews.llvm.org/D63399





More information about the lldb-commits mailing list