[Lldb-commits] [PATCH] D46810: 3/3: Fix DWARFUnit::GetUnitDIEPtrOnly stale pointer

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 24 14:23:11 PDT 2018


clayborg added a comment.

A better solution here would be to have two functions: one for parsing the Unit DIE only and one for parsing all DIEs:

  class DWARFUnit {
    void ExtractUnitDIEIfNeeded();
    size_t ExtractDIEsIfNeeded();
  }

Then the code becomes much simpler, we don't need the "m_die_array_size" function and logic is much cleaner,

DWARFUnit::ExtractUnitDIEIfNeeded() will extract into m_first_die only and won't touch m_die_array at all. DWARFUnit::ExtractDIEsIfNeeded() will extract all DIEs into m_die_array. Then there is no need for worrying about m_die_array.size().


https://reviews.llvm.org/D46810





More information about the lldb-commits mailing list