[Lldb-commits] [PATCH] D107456: [lldb] Support .debug_rnglists.dwo sections in dwp file

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 27 13:26:41 PDT 2021


jankratochvil accepted this revision.
jankratochvil added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp:556
+          " (ranges list base: 0x%" PRIx64 "): %s",
+          offset, m_ranges_base, toString(table_or_error.takeError()).c_str());
   }
----------------
kimanh wrote:
> jankratochvil wrote:
> > One such reason can be missing DWP absolute offset for the error report. That could be returned from `GetRnglistData()`.
> > 
> If I understand your comment correctly, you are suggesting to incorporate the contribution offset into the error message of `GetRnglistData`, is that correct? However, `GetRnglistData` will only return an error message if the contribution offset cannot be read, so the contribution offset cannot be specified in the error message (and thus the absolute offset cannot be inferred) . Or maybe I'm misunderstanding your comment here?
Not so correct. The callers of `GetRnglistData` need to know the contribution offset to properly report it during parsing errors in the callers. `GetRnglistTable` can report error if `extractHeaderAndOffsets` finds invalid header data. In such case LLDB will report (with https://www.jankratochvil.net/t/debug_rnglists-dwp.s.patch):
```
error: debug_rnglists-dwp.s.tmp Failed to extract range list table at offset 0xc: parsing .debug_rnglists table at offset 0x0: unsupported reserved unit length of value 0xfffffff0
```
And one has no idea which DWO in that DWP file was invalid, that `0xc` is relative to start of contribution, not to start of the `.debug_rnglists.dwo` section. `GetRnglistData` knows the contribution offset but its caller `DWARFDebugRnglistTable` does not.
I am not sure how perfect the error messages should be so giving an approval (if I am authorized to give one) but it would be nice to improve the error reporting.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107456



More information about the lldb-commits mailing list