2015-07-21 15:42:38 +02:00
|
|
|
//===-- ObjDumper.h ---------------------------------------------*- C++ -*-===//
|
2013-04-03 20:31:38 +02:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
|
|
#define LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
2013-04-03 20:31:38 +02:00
|
|
|
|
2014-03-06 06:51:42 +01:00
|
|
|
#include <memory>
|
2014-06-12 19:38:55 +02:00
|
|
|
#include <system_error>
|
2014-03-06 06:51:42 +01:00
|
|
|
|
2013-04-03 20:31:38 +02:00
|
|
|
namespace llvm {
|
|
|
|
namespace object {
|
2015-08-28 12:27:50 +02:00
|
|
|
class COFFImportFile;
|
|
|
|
class ObjectFile;
|
2013-04-03 20:31:38 +02:00
|
|
|
}
|
2016-05-14 02:02:53 +02:00
|
|
|
namespace codeview {
|
|
|
|
class MemoryTypeTableBuilder;
|
2016-05-17 01:09:32 +02:00
|
|
|
}
|
2013-04-03 20:31:38 +02:00
|
|
|
|
2016-05-03 02:28:04 +02:00
|
|
|
class ScopedPrinter;
|
2013-04-03 20:31:38 +02:00
|
|
|
|
|
|
|
class ObjDumper {
|
|
|
|
public:
|
2016-05-03 02:28:04 +02:00
|
|
|
ObjDumper(ScopedPrinter &Writer);
|
2013-04-03 20:31:38 +02:00
|
|
|
virtual ~ObjDumper();
|
|
|
|
|
|
|
|
virtual void printFileHeaders() = 0;
|
|
|
|
virtual void printSections() = 0;
|
|
|
|
virtual void printRelocations() = 0;
|
|
|
|
virtual void printSymbols() = 0;
|
|
|
|
virtual void printDynamicSymbols() = 0;
|
|
|
|
virtual void printUnwindInfo() = 0;
|
|
|
|
|
|
|
|
// Only implemented for ELF at this time.
|
2015-06-25 23:47:32 +02:00
|
|
|
virtual void printDynamicRelocations() { }
|
2013-04-03 20:31:38 +02:00
|
|
|
virtual void printDynamicTable() { }
|
|
|
|
virtual void printNeededLibraries() { }
|
2013-04-12 06:07:39 +02:00
|
|
|
virtual void printProgramHeaders() { }
|
2015-07-10 00:32:24 +02:00
|
|
|
virtual void printHashTable() { }
|
2015-10-14 14:11:50 +02:00
|
|
|
virtual void printGnuHashTable() { }
|
2015-07-21 15:48:41 +02:00
|
|
|
virtual void printLoadName() {}
|
2015-10-17 01:19:01 +02:00
|
|
|
virtual void printVersionInfo() {}
|
2016-01-26 20:46:39 +01:00
|
|
|
virtual void printGroupSections() {}
|
2016-04-11 19:15:30 +02:00
|
|
|
virtual void printHashHistogram() {}
|
2013-04-03 20:31:38 +02:00
|
|
|
|
2014-01-30 05:46:33 +01:00
|
|
|
// Only implemented for ARM ELF at this time.
|
|
|
|
virtual void printAttributes() { }
|
|
|
|
|
2014-06-18 10:47:09 +02:00
|
|
|
// Only implemented for MIPS ELF at this time.
|
|
|
|
virtual void printMipsPLTGOT() { }
|
2015-05-07 17:40:35 +02:00
|
|
|
virtual void printMipsABIFlags() { }
|
2015-06-16 23:47:43 +02:00
|
|
|
virtual void printMipsReginfo() { }
|
2016-05-04 07:58:57 +02:00
|
|
|
virtual void printMipsOptions() { }
|
2014-06-18 10:47:09 +02:00
|
|
|
|
2014-10-02 19:02:18 +02:00
|
|
|
// Only implemented for PE/COFF.
|
|
|
|
virtual void printCOFFImports() { }
|
2015-01-03 22:35:09 +01:00
|
|
|
virtual void printCOFFExports() { }
|
2014-10-07 21:37:52 +02:00
|
|
|
virtual void printCOFFDirectives() { }
|
2014-11-19 01:18:07 +01:00
|
|
|
virtual void printCOFFBaseReloc() { }
|
2015-12-16 19:28:12 +01:00
|
|
|
virtual void printCodeViewDebugInfo() { }
|
2016-05-14 02:02:53 +02:00
|
|
|
virtual void
|
|
|
|
mergeCodeViewTypes(llvm::codeview::MemoryTypeTableBuilder &CVTypes) {}
|
2014-10-02 19:02:18 +02:00
|
|
|
|
2015-08-21 22:28:30 +02:00
|
|
|
// Only implemented for MachO.
|
|
|
|
virtual void printMachODataInCode() { }
|
2015-08-27 17:11:32 +02:00
|
|
|
virtual void printMachOVersionMin() { }
|
2015-08-31 21:32:31 +02:00
|
|
|
virtual void printMachODysymtab() { }
|
2015-09-02 18:24:24 +02:00
|
|
|
virtual void printMachOSegment() { }
|
2015-09-03 20:10:28 +02:00
|
|
|
virtual void printMachOIndirectSymbols() { }
|
2015-09-09 02:21:18 +02:00
|
|
|
virtual void printMachOLinkerOptions() { }
|
2015-08-21 22:28:30 +02:00
|
|
|
|
2015-06-27 01:56:53 +02:00
|
|
|
virtual void printStackMap() const = 0;
|
|
|
|
|
2013-04-03 20:31:38 +02:00
|
|
|
protected:
|
2016-05-03 02:28:04 +02:00
|
|
|
ScopedPrinter &W;
|
2013-04-03 20:31:38 +02:00
|
|
|
};
|
|
|
|
|
2014-06-13 03:25:41 +02:00
|
|
|
std::error_code createCOFFDumper(const object::ObjectFile *Obj,
|
2016-05-03 02:28:04 +02:00
|
|
|
ScopedPrinter &Writer,
|
2014-06-13 03:25:41 +02:00
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-03 20:31:38 +02:00
|
|
|
|
2014-06-13 03:25:41 +02:00
|
|
|
std::error_code createELFDumper(const object::ObjectFile *Obj,
|
2016-05-03 02:28:04 +02:00
|
|
|
ScopedPrinter &Writer,
|
2014-06-13 03:25:41 +02:00
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-03 20:31:38 +02:00
|
|
|
|
2014-06-13 03:25:41 +02:00
|
|
|
std::error_code createMachODumper(const object::ObjectFile *Obj,
|
2016-05-03 02:28:04 +02:00
|
|
|
ScopedPrinter &Writer,
|
2014-06-13 03:25:41 +02:00
|
|
|
std::unique_ptr<ObjDumper> &Result);
|
2013-04-03 20:31:38 +02:00
|
|
|
|
2015-08-28 12:27:50 +02:00
|
|
|
void dumpCOFFImportFile(const object::COFFImportFile *File);
|
|
|
|
|
2016-05-14 02:02:53 +02:00
|
|
|
void dumpCodeViewMergedTypes(ScopedPrinter &Writer,
|
|
|
|
llvm::codeview::MemoryTypeTableBuilder &CVTypes);
|
|
|
|
|
2013-04-03 20:31:38 +02:00
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif
|