[Lldb-commits] [PATCH] D147606: [lldb] fix #61942, discard "empty" ranges in DWARF to better handle gcc binary

LU Hongyi via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 11 01:43:41 PDT 2023

jwnhy added a comment.

In D147606#4246832 <https://reviews.llvm.org/D147606#4246832>, @JDevlieghere wrote:

> The change looks fine and regardless of whether this makes sense or even complies with the standard, we should be resilient against it. I would like to see a test though.

It seems that DWARFv5 indeed specifies how to deal with these empty ranges

> A bounded range entry whose beginning and ending address offsets are equal
> (including zero) indicates an empty range and may be ignored.

Also, I kind of searched through the codebase, and noticed that there are multiple places like this, and they adapt a similar approach discarding those empty ranges.
e.g. in `DWARFDebugRanges.cpp`

    // Filter out empty ranges
    if (begin < end)
      range_list.Append(DWARFRangeList::Entry(begin + base_addr, end - begin));



More information about the lldb-commits mailing list