From be981ebcf07fee5a14c6a298d83bed5a473db7cc Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 8 Jan 2014 03:28:09 +0000 Subject: llvm-readobj: add support for ARM EHABI unwind info This adds some preliminary support for decoding ARM EHABI unwinding information. The major functionality that remains from complete support is bytecode translation. Each Unwind Index Table is printed out as a separate entity along with its section index, name, offset, and entries. Each entry lists the function address, and if possible, the name, of the function to which it corresponds. The encoding model, personality routine or index, and byte code is also listed. llvm-svn: 198734 --- llvm/tools/llvm-readobj/ELFDumper.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/tools/llvm-readobj/ELFDumper.cpp') diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 0e0c0e0..b82cecd 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -16,6 +16,7 @@ #include "Error.h" #include "ObjDumper.h" #include "StreamWriter.h" +#include "ARMEHABIPrinter.h" #include "llvm/ADT/SmallString.h" #include "llvm/Object/ELFObjectFile.h" @@ -774,6 +775,18 @@ void ELFDumper::printUnwindInfo() { W.startLine() << "UnwindInfo not implemented.\n"; } +namespace { +template <> +void ELFDumper >::printUnwindInfo() { + const unsigned Machine = Obj->getHeader()->e_machine; + if (Machine == EM_ARM) { + ARM::EHABI::PrinterContext > Ctx(W, Obj); + return Ctx.PrintUnwindInformation(); + } + W.startLine() << "UnwindInfo not implemented.\n"; +} +} + template void ELFDumper::printDynamicTable() { typedef typename ELFO::Elf_Dyn_Iter EDI; -- cgit v1.1