[Lldb-commits] [PATCH] D106466: 3/3: [llvm+lldb] Fix#2 of DW_AT_ranges DW_FORM_sec_offset not using DW_AT_rnglists_base (used by GCC)

Igor Kudrin via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 11 08:43:30 PDT 2021


ikudrin added a comment.

In D106466#2926185 <https://reviews.llvm.org/D106466#2926185>, @jankratochvil wrote:

> In D106466#2922549 <https://reviews.llvm.org/D106466#2922549>, @ikudrin wrote:
>
>> As far as I understand it, you need a specially constructed `llvm::DWARFDebugRnglistTable` object so that `DWARFUnit::FindRnglistFromOffset()` can call its `findList()` method and get a list of records located at a specific offset.
>
> Yes.
>
>> It looks like a newly created `llvm::DWARFDebugRnglistTable` object has its `Header.Length` set to `0`,
>
> But that is wrong `Length`, the correct one is to cover the whole section which I set by:
>
>   HeaderData.Length = Data.size() - dwarf::getUnitLengthFieldByteSize(Format);

This value is not incorrect, but a special one, with custom handling. `DWARFUnit::findRnglistFromOffset(uint64_t Offset)` fetches the list without creating a fake header.

>> so it already works as required for the usage, and there is no need to fill its fields with artificial values that do not represent real content of the section. Am I right?
>
> One needs to set at least `AddrSize` and `OffsetEntryCount` as callers do use it.

Could you please point me to that usage? I am not that familiar with the LLDB code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106466



More information about the lldb-commits mailing list