[PATCH] D45922: [DWARF v5] incorrect length of string offsets tables

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 21 06:19:21 PDT 2018


wolfgangp created this revision.
wolfgangp added reviewers: dblaikie, probinson, JDevlieghere, aprantl.

This patch fixes a bug with DWARF v5 string offsets tables found by David Anderson. Currently the length encodes the length of the contribution minus the size of the table header, when the standard demands it to be the contribution length minus the size of the length field. So it's basically off by 4 at the moment, failing to account for the version field and padding in the header.

This patch fixes this in both the reader and producer code.


https://reviews.llvm.org/D45922

Files:
  include/llvm/DebugInfo/DWARF/DWARFUnit.h
  lib/CodeGen/AsmPrinter/DwarfFile.cpp
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFUnit.cpp
  test/DebugInfo/X86/dwarfdump-str-offsets-invalid-3.s
  test/DebugInfo/X86/dwarfdump-str-offsets-invalid-4.s
  test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s
  test/DebugInfo/X86/dwarfdump-str-offsets-macho.s
  test/DebugInfo/X86/dwarfdump-str-offsets.s
  test/DebugInfo/X86/string-offsets-multiple-cus.ll
  test/DebugInfo/X86/string-offsets-table.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45922.143442.patch
Type: text/x-patch
Size: 14077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180421/c4ad80b6/attachment.bin>


More information about the llvm-commits mailing list