[DebugInfo][DWARF64] Fix dumping pre-standard .debug_str_offsets.dwo sections.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Sat, 25 Apr 2020 11:26:03 +0000 (18:26 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Sat, 25 Apr 2020 11:59:41 +0000 (18:59 +0700)
commitd1d5f0b10341fbc26c2907241124ffc2585b8ea1
tree573ed715460b80bd5277d5863cbd07fb532119c4
parent575d9ba107f4f9c6ec345ed972eaac99ad9354f7
[DebugInfo][DWARF64] Fix dumping pre-standard .debug_str_offsets.dwo sections.

The sizes of offsets in the `.debug_str_offsets.dwo` section depend on
the format of compilation or type units referencing them: 4 bytes for
DWARF32 units and 8 bytes for DWARF64 ones. The fix uses parsed units
to determine the actual size of offsets in the corresponding part of
the `.debug_str_offsets.dwo` section.

Differential Revision: https://reviews.llvm.org/D78555
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
llvm/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-5.s
llvm/test/DebugInfo/X86/dwarfdump-str-offsets-v4-dwarf64-dwo.s [new file with mode: 0644]
llvm/test/DebugInfo/X86/dwarfdump-str-offsets-v4-dwarf64-dwp.s [new file with mode: 0644]