clayborg added inline comments.

================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:437
+      m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate) {
+  auto first_code_section_sp =
+      m_objfile_sp->GetModule()->GetSectionList()->FindSectionByType(
----------------
labath wrote:
> This is really the _first_ text section (as listed in the section headers), 
> is it not? But, I assume you really want the section with the lowest file 
> address?
> 
> The linkers (and other producers) will normally output the sections in 
> ascending address order (because it's the simplest thing to do). However, I 
> don't believe that is actually required by anything, and I /think/ it should 
> be possible (with a moderately funky linker script) to produce a fully 
> functional executable which does not have the sections listed in this order.
We do need to iterate over all sections and find the one with the lowest 
address, good catch. No sorting is required in object files.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:441
+  if (first_code_section_sp)
+    m_first_code_address = first_code_section_sp->GetFileAddress();
+}
----------------
And doing the work in InitializeObject() is better.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h:520
   std::vector<uint32_t> m_lldb_cu_to_dwarf_unit;
+  /// Many linkers will concatenate all available DWARF, even if parts of that 
DWARF
+  /// should have been dead stripped. Some linkers will place tombstone values 
in for
----------------
Fine to reword this to not appear hostile toward the linkers. If any judgement 
should be passed, it should be on the DWARF format itself and how unfriendly it 
is to link!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87172

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to