[Lldb-commits] [PATCH] D59611: Move the rest of the section loading over to DWARFContext

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 22 09:08:58 PDT 2019

labath added a comment.

This broke the DWO flavours of some tests:

  lldb-Suite :: lang/c/const_variables/TestConstVariables.py
  lldb-Suite :: lang/c/local_variables/TestLocalVariables.py
  lldb-Suite :: lang/c/vla/TestVLA.py

I believe the problem is that DWARFContext::LoadOrGetSection does not take DWO files into account. It was modelled based on SymbolFileDWARF's notion of loading sections, but you probably missed the fact that SymbolFileDWARFDwo overrides `LoadSectionData` to load the data from a different object file https://github.com/llvm-mirror/lldb/blob/master/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp#L32. The DWARFContext does not have that, and so it always loads the sections from the main module object file, which results in things going south.

I think the fix for this should be relatively simple. We just need to give SymbolFileDWARFDwo the opportunity to initialize the DWARFContext with a different set of sections. However, since this will require changing it's constructor to not accept a Module object (since dwo files do not have one -- the next best thing might be to take a SectionList), and change the DWARFContext ownership model (so that subclasses can customize it's initialization), I did not want to try make a hasty unreviewed fix for that. Instead I just reverted this patch for now. (The problem was kind of already introduced by the previous patch in this series, but I believe that one is fine to keep because there is no DWO flavour of debug_aranges).

Let me know if you have trouble reproducing these failures on your side.




More information about the lldb-commits mailing list