[Lldb-commits] [PATCH] D99401: Fix .debug_aranges parsing issues introduced with llvm error handling in LLDB

David Blaikie via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 26 15:07:48 PDT 2021


dblaikie added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp:56
+  if (m_header.length > 0)
+    m_next_offset = m_offset + *offset_ptr - m_offset + m_header.length;
+  else
----------------
clayborg wrote:
> dblaikie wrote:
> > This maths seems strange - the `m_offset ... - m_offset` cancel each other out, right?
> Math is good. We are adding the number of bytes that were used to encode the length (4 or 12) by saying:
> ```
> m_offset + <length of length encoding> + m_header.length
> ```
The net effect ends up a bit convoluted & I think it'd be (at least I'd find it) easier to read as `*offset_ptr + m_header.length`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99401



More information about the lldb-commits mailing list