blob: 8d191cbe07def9d604ae7588c264208da6896db1 [file] [log] [blame]
Eric Christopher76e70f32013-04-03 18:31:38 +00001//===-- ObjDumper.h -------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_READOBJ_OBJDUMPER_H
11#define LLVM_READOBJ_OBJDUMPER_H
12
13namespace llvm {
14
15namespace object {
16 class ObjectFile;
17}
18
19class error_code;
20
21template<typename T>
22class OwningPtr;
23
24class StreamWriter;
25
26class ObjDumper {
27public:
28 ObjDumper(StreamWriter& Writer);
29 virtual ~ObjDumper();
30
31 virtual void printFileHeaders() = 0;
32 virtual void printSections() = 0;
33 virtual void printRelocations() = 0;
34 virtual void printSymbols() = 0;
35 virtual void printDynamicSymbols() = 0;
36 virtual void printUnwindInfo() = 0;
37
38 // Only implemented for ELF at this time.
39 virtual void printDynamicTable() { }
40 virtual void printNeededLibraries() { }
41
42protected:
43 StreamWriter& W;
44};
45
46error_code createCOFFDumper(const object::ObjectFile *Obj,
47 StreamWriter& Writer,
48 OwningPtr<ObjDumper> &Result);
49
50error_code createELFDumper(const object::ObjectFile *Obj,
51 StreamWriter& Writer,
52 OwningPtr<ObjDumper> &Result);
53
54error_code createMachODumper(const object::ObjectFile *Obj,
55 StreamWriter& Writer,
56 OwningPtr<ObjDumper> &Result);
57
58} // namespace llvm
59
60#endif