[DebugInfo] Support DWARF expressions in eh_frame
authorRafael Auler <rafaelauler@fb.com>
Wed, 7 Mar 2018 19:19:51 +0000 (19:19 +0000)
committerRafael Auler <rafaelauler@fb.com>
Wed, 7 Mar 2018 19:19:51 +0000 (19:19 +0000)
commit7fdf44440ca47bbb3f52e2c01d77895fe1a2e0e1
treefc008db81a38d91377f5af2425bef4cd69b6b362
parent915b4dbf8a3cf694390243050f63ebccd3e10cf2
[DebugInfo] Support DWARF expressions in eh_frame

This patch enhances DWARFDebugFrame with the capability of parsing and
printing DWARF expressions in CFI instructions. It also makes FDEs and
CIEs accessible to lib users, so they can process them in client tools
that rely on LLVM. To make it self-contained with a test case, it
teaches llvm-readobj to be able to dump EH frames and checks they are
correct in a unit test. The llvm-readobj code is Maksim Panchenko's work
(maksfb).

Reviewers: JDevlieghere, espindola

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D43313

llvm-svn: 326932
14 files changed:
llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
llvm/include/llvm/Support/ScopedPrinter.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
llvm/lib/ObjectYAML/ELFYAML.cpp
llvm/test/tools/llvm-readobj/Inputs/dwarf-exprs.exe-x86-64.yaml [new file with mode: 0644]
llvm/test/tools/llvm-readobj/unwind.test [new file with mode: 0644]
llvm/tools/llvm-readobj/CMakeLists.txt
llvm/tools/llvm-readobj/DwarfCFIEHPrinter.h [new file with mode: 0644]
llvm/tools/llvm-readobj/ELFDumper.cpp