[PATCH] D105469: [Debug-Info] [llvm-dwarfdump] Don't treat DW_FORM_data4/8 to be section offsets in DWARF3.

EsmeYi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 03:06:04 PDT 2021


Esme created this revision.
Esme added reviewers: aprantl, probinson, dblaikie, jhenderson, shchenz, JDevlieghere, PowerPC.
Herald added subscribers: cmtice, hiraditya, emaste.
Esme requested review of this revision.
Herald added subscribers: llvm-commits, sstefan1, MaskRay.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.

We found a similar error as the description in D58698 <https://reviews.llvm.org/D58698> when dumping the debug info of the SPEC xalancbmk_r with llvm-dwarfdump under DWARF3, ie. the location list overflows the debug_loc section.

Although in DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section offset, but they may actually be size values instead of offsets in some scenarios. The overflow-error occurred when we try to dump the location list for such scenarios.

After narrowing down the cases, we found the error occurs for three attributes, DW_AT_data_member_location, DW_AT_count and DW_AT_byte_size.

DW_FORM_data4 and DW_FORM_data8 are obviously not offsets in DWARF3+, but it’s hard to tell whether they are offsets in DWARF3.  In this patch, we are dropping the support of dumping location for DW_AT_data_member_location, DW_AT_count and DW_AT_byte_size if the form is DW_FORM_data4 and DW_FORM_data8.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105469

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
  llvm/lib/DWARFLinker/DWARFLinker.cpp
  llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
  llvm/test/tools/llvm-dwarfdump/ELF/formclass3-atcount.s
  llvm/test/tools/llvm-dwarfdump/ELF/formclass3-atmemloc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105469.356645.patch
Type: text/x-patch
Size: 34521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210706/98722365/attachment-0001.bin>


More information about the llvm-commits mailing list