[Lldb-commits] [PATCH] D106270: [DWARF5] Fix offset check when using .debug_names

Kim-Anh Tran via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 19 23:06:39 PDT 2021

kimanh added inline comments.

Comment at: lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp:82
+  const DWARFUnit &non_skeleton_cu = cu.GetNonSkeletonUnit();
   DWARFMappedHash::DIEInfoArray hash_data;
JDevlieghere wrote:
> I assume the `const` of the `DWARFUnit` is being dropped because `GetNonSkeletonUnit`? Rather than doing that, can't that function be const instead? 
Yes correct. I agree with your point that dropping `const` here is not very nice, but I'm not sure whether we can make that function const easily. 
As is `GetNonSkeletonUnit` is updating itself in `ExtractUnitDIEIfNeeded()`, which kicks off many non-const operations for updating itself. As far as I understand, if we would want to make it const, we'd need to change the architectural logic in how the skeleton and non-skeleton units are connected. I'm not very familiar with the code base, so any advice here is welcome!

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list