[DebugInfo] Fix printing CIE offsets in EH FDEs.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Thu, 13 Feb 2020 11:20:14 +0000 (18:20 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 25 Feb 2020 10:10:29 +0000 (17:10 +0700)
commitbd2df13ee0f972ac386fd2d8edf5a9205ace04bb
treedace9b504515c79309796731d8a987a4bc6e2212
parentdcd89b3de6de891bfcc59189cda1ea059fbdcdb5
[DebugInfo] Fix printing CIE offsets in EH FDEs.

While the value of the CIE pointer field in a DWARF FDE record is
an offset to the corresponding CIE record from the beginning of
the section, for EH FDE records it is relative to the current offset.
Previously, we did not make that distinction when dumped both kinds
of FDE records and just printed the same value for the CIE pointer
field and the CIE offset; that was acceptable for DWARF FDEs but was
wrong for EH FDEs.

This patch fixes the issue by explicitly printing the offset of the
linked CIE object.

Differential Revision: https://reviews.llvm.org/D74613
lld/test/ELF/eh-frame-hdr-augmentation.s
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/test/DebugInfo/RISCV/eh-frame.s
llvm/test/DebugInfo/X86/debug_frame-invalid-cie-offset.s [new file with mode: 0644]
llvm/test/MC/Mips/eh-frame.s
llvm/test/tools/llvm-dwarfdump/X86/debug_frame_GNU_args_size.s
llvm/test/tools/llvm-dwarfdump/X86/debug_frame_offset.test
llvm/test/tools/llvm-objdump/eh_frame-arm64.test
llvm/test/tools/llvm-objdump/eh_frame-coff.test
llvm/test/tools/llvm-objdump/eh_frame-mipsel.test