2011-09-20 01:56:04 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
|
|
|
|
#define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
|
2011-09-20 01:56:04 +08:00
|
|
|
|
2016-01-26 23:09:42 +08:00
|
|
|
#include "llvm/DebugInfo/DIContext.h"
|
2011-09-20 01:56:04 +08:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2015-12-29 21:41:02 +08:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2011-09-20 01:56:04 +08:00
|
|
|
#include "llvm/Support/DataTypes.h"
|
2016-05-18 01:10:12 +08:00
|
|
|
#include "llvm/Object/Archive.h"
|
2011-09-20 01:56:04 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2016-04-18 17:17:29 +08:00
|
|
|
class StringRef;
|
|
|
|
|
2012-12-06 04:12:35 +08:00
|
|
|
namespace object {
|
|
|
|
class COFFObjectFile;
|
2016-08-19 00:39:19 +08:00
|
|
|
class COFFImportFile;
|
2014-08-01 21:07:19 +08:00
|
|
|
class MachOObjectFile;
|
2013-01-06 11:56:49 +08:00
|
|
|
class ObjectFile;
|
2016-05-18 01:10:12 +08:00
|
|
|
class Archive;
|
2012-12-06 04:12:35 +08:00
|
|
|
class RelocationRef;
|
|
|
|
}
|
|
|
|
|
2011-09-20 01:56:04 +08:00
|
|
|
extern cl::opt<std::string> TripleName;
|
|
|
|
extern cl::opt<std::string> ArchName;
|
2014-08-07 07:24:41 +08:00
|
|
|
extern cl::opt<std::string> MCPU;
|
|
|
|
extern cl::list<std::string> MAttrs;
|
2015-07-30 03:08:10 +08:00
|
|
|
extern cl::list<std::string> FilterSections;
|
2015-07-29 23:45:39 +08:00
|
|
|
extern cl::opt<bool> Disassemble;
|
2015-07-24 04:58:49 +08:00
|
|
|
extern cl::opt<bool> DisassembleAll;
|
2014-09-25 07:08:22 +08:00
|
|
|
extern cl::opt<bool> NoShowRawInsn;
|
2017-02-09 02:11:31 +08:00
|
|
|
extern cl::opt<bool> NoLeadingAddr;
|
2015-01-08 05:02:18 +08:00
|
|
|
extern cl::opt<bool> PrivateHeaders;
|
2016-01-13 08:25:36 +08:00
|
|
|
extern cl::opt<bool> FirstPrivateHeader;
|
2015-01-08 05:02:18 +08:00
|
|
|
extern cl::opt<bool> ExportsTrie;
|
|
|
|
extern cl::opt<bool> Rebase;
|
|
|
|
extern cl::opt<bool> Bind;
|
|
|
|
extern cl::opt<bool> LazyBind;
|
|
|
|
extern cl::opt<bool> WeakBind;
|
2015-07-08 10:04:15 +08:00
|
|
|
extern cl::opt<bool> RawClangAST;
|
2015-01-10 03:22:37 +08:00
|
|
|
extern cl::opt<bool> UniversalHeaders;
|
2015-01-16 07:19:11 +08:00
|
|
|
extern cl::opt<bool> ArchiveHeaders;
|
2015-01-23 02:55:27 +08:00
|
|
|
extern cl::opt<bool> IndirectSymbols;
|
2015-01-24 02:52:17 +08:00
|
|
|
extern cl::opt<bool> DataInCode;
|
2015-01-28 05:28:24 +08:00
|
|
|
extern cl::opt<bool> LinkOptHints;
|
2015-03-12 06:06:32 +08:00
|
|
|
extern cl::opt<bool> InfoPlist;
|
2015-03-17 04:08:09 +08:00
|
|
|
extern cl::opt<bool> DylibsUsed;
|
|
|
|
extern cl::opt<bool> DylibId;
|
2015-04-02 04:57:01 +08:00
|
|
|
extern cl::opt<bool> ObjcMetaData;
|
2015-03-18 01:10:57 +08:00
|
|
|
extern cl::opt<std::string> DisSymName;
|
2015-03-14 01:56:32 +08:00
|
|
|
extern cl::opt<bool> NonVerbose;
|
2015-01-21 05:47:46 +08:00
|
|
|
extern cl::opt<bool> Relocations;
|
|
|
|
extern cl::opt<bool> SectionHeaders;
|
|
|
|
extern cl::opt<bool> SectionContents;
|
|
|
|
extern cl::opt<bool> SymbolTable;
|
|
|
|
extern cl::opt<bool> UnwindInfo;
|
2015-06-08 05:07:17 +08:00
|
|
|
extern cl::opt<bool> PrintImmHex;
|
2016-01-26 23:09:42 +08:00
|
|
|
extern cl::opt<DIDumpType> DwarfDumpType;
|
2011-09-20 01:56:04 +08:00
|
|
|
|
|
|
|
// Various helper functions.
|
2015-08-05 15:18:31 +08:00
|
|
|
void error(std::error_code ec);
|
2012-12-06 04:12:35 +08:00
|
|
|
bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
|
2015-01-08 05:02:18 +08:00
|
|
|
void ParseInputMachO(StringRef Filename);
|
2012-12-06 04:12:35 +08:00
|
|
|
void printCOFFUnwindInfo(const object::COFFObjectFile* o);
|
2014-08-01 21:07:19 +08:00
|
|
|
void printMachOUnwindInfo(const object::MachOObjectFile* o);
|
2014-08-30 08:20:14 +08:00
|
|
|
void printMachOExportsTrie(const object::MachOObjectFile* o);
|
2017-03-21 03:46:55 +08:00
|
|
|
void printMachORebaseTable(object::MachOObjectFile* o);
|
|
|
|
void printMachOBindTable(object::MachOObjectFile* o);
|
|
|
|
void printMachOLazyBindTable(object::MachOObjectFile* o);
|
|
|
|
void printMachOWeakBindTable(object::MachOObjectFile* o);
|
2013-01-06 11:56:49 +08:00
|
|
|
void printELFFileHeader(const object::ObjectFile *o);
|
2013-09-28 05:04:00 +08:00
|
|
|
void printCOFFFileHeader(const object::ObjectFile *o);
|
2016-08-19 00:39:19 +08:00
|
|
|
void printCOFFSymbolTable(const object::COFFImportFile *i);
|
2015-12-20 17:54:34 +08:00
|
|
|
void printCOFFSymbolTable(const object::COFFObjectFile *o);
|
2014-08-23 04:35:18 +08:00
|
|
|
void printMachOFileHeader(const object::ObjectFile *o);
|
2016-01-13 08:25:36 +08:00
|
|
|
void printMachOLoadCommands(const object::ObjectFile *o);
|
2016-12-01 00:49:11 +08:00
|
|
|
void printWasmFileHeader(const object::ObjectFile *o);
|
2015-01-08 05:02:18 +08:00
|
|
|
void printExportsTrie(const object::ObjectFile *o);
|
2017-03-21 03:46:55 +08:00
|
|
|
void printRebaseTable(object::ObjectFile *o);
|
|
|
|
void printBindTable(object::ObjectFile *o);
|
|
|
|
void printLazyBindTable(object::ObjectFile *o);
|
|
|
|
void printWeakBindTable(object::ObjectFile *o);
|
2015-07-08 10:04:15 +08:00
|
|
|
void printRawClangAST(const object::ObjectFile *o);
|
2015-01-21 05:47:46 +08:00
|
|
|
void PrintRelocations(const object::ObjectFile *o);
|
|
|
|
void PrintSectionHeaders(const object::ObjectFile *o);
|
|
|
|
void PrintSectionContents(const object::ObjectFile *o);
|
2016-06-01 04:35:34 +08:00
|
|
|
void PrintSymbolTable(const object::ObjectFile *o, StringRef ArchiveName,
|
|
|
|
StringRef ArchitectureName = StringRef());
|
2016-06-29 07:16:13 +08:00
|
|
|
LLVM_ATTRIBUTE_NORETURN void error(Twine Message);
|
2016-11-17 06:17:38 +08:00
|
|
|
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, Twine Message);
|
2015-12-29 21:41:02 +08:00
|
|
|
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, std::error_code EC);
|
2016-04-07 06:14:09 +08:00
|
|
|
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, llvm::Error E);
|
2016-05-18 01:10:12 +08:00
|
|
|
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef FileName,
|
|
|
|
StringRef ArchiveName,
|
2016-06-01 04:35:34 +08:00
|
|
|
llvm::Error E,
|
|
|
|
StringRef ArchitectureName
|
|
|
|
= StringRef());
|
2016-05-18 01:10:12 +08:00
|
|
|
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef ArchiveName,
|
|
|
|
const object::Archive::Child &C,
|
2016-06-01 04:35:34 +08:00
|
|
|
llvm::Error E,
|
|
|
|
StringRef ArchitectureName
|
|
|
|
= StringRef());
|
2011-09-20 01:56:04 +08:00
|
|
|
|
2013-09-28 05:04:00 +08:00
|
|
|
} // end namespace llvm
|
2011-09-20 01:56:04 +08:00
|
|
|
|
|
|
|
#endif
|