2017-06-10 04:46:17 +08:00
|
|
|
//===- llvm-pdbutil.h ----------------------------------------- *- C++ --*-===//
|
2015-02-23 06:03:38 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_LLVMPDBDUMP_H
|
|
|
|
|
2016-09-10 02:17:52 +08:00
|
|
|
#include "llvm/ADT/Optional.h"
|
2015-03-02 12:39:56 +08:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2015-02-23 06:03:38 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
|
2017-05-14 09:13:40 +08:00
|
|
|
#include <memory>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace pdb {
|
|
|
|
class PDBSymbolData;
|
|
|
|
class PDBSymbolFunc;
|
|
|
|
uint32_t getTypeLength(const PDBSymbolData &Symbol);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-02 12:39:56 +08:00
|
|
|
namespace opts {
|
2016-06-04 03:28:33 +08:00
|
|
|
|
2017-06-16 06:24:24 +08:00
|
|
|
enum class DumpLevel { None, Basic, Verbose };
|
|
|
|
|
2017-06-09 07:39:33 +08:00
|
|
|
enum class ModuleSubsection {
|
|
|
|
Unknown,
|
|
|
|
Lines,
|
|
|
|
FileChecksums,
|
|
|
|
InlineeLines,
|
|
|
|
CrossScopeImports,
|
|
|
|
CrossScopeExports,
|
2017-06-09 08:28:08 +08:00
|
|
|
StringTable,
|
|
|
|
Symbols,
|
|
|
|
FrameData,
|
2017-06-10 04:46:52 +08:00
|
|
|
CoffSymbolRVAs,
|
2017-06-09 07:39:33 +08:00
|
|
|
All
|
|
|
|
};
|
|
|
|
|
2016-07-01 01:42:48 +08:00
|
|
|
namespace pretty {
|
2017-04-11 03:33:29 +08:00
|
|
|
|
2017-04-25 01:47:52 +08:00
|
|
|
enum class ClassDefinitionFormat { None, Layout, All };
|
2017-04-26 04:22:29 +08:00
|
|
|
enum class ClassSortMode {
|
|
|
|
None,
|
|
|
|
Name,
|
|
|
|
Size,
|
|
|
|
Padding,
|
|
|
|
PaddingPct,
|
|
|
|
PaddingImmediate,
|
|
|
|
PaddingPctImmediate
|
|
|
|
};
|
2017-04-07 07:43:39 +08:00
|
|
|
|
2017-05-14 09:13:40 +08:00
|
|
|
enum class SymbolSortMode { None, Name, Size };
|
|
|
|
|
|
|
|
enum class SymLevel { Functions, Data, Thunks, All };
|
|
|
|
|
|
|
|
bool shouldDumpSymLevel(SymLevel Level);
|
|
|
|
bool compareFunctionSymbols(
|
|
|
|
const std::unique_ptr<llvm::pdb::PDBSymbolFunc> &F1,
|
|
|
|
const std::unique_ptr<llvm::pdb::PDBSymbolFunc> &F2);
|
|
|
|
bool compareDataSymbols(const std::unique_ptr<llvm::pdb::PDBSymbolData> &F1,
|
|
|
|
const std::unique_ptr<llvm::pdb::PDBSymbolData> &F2);
|
|
|
|
|
2015-03-02 12:39:56 +08:00
|
|
|
extern llvm::cl::opt<bool> Compilands;
|
|
|
|
extern llvm::cl::opt<bool> Symbols;
|
|
|
|
extern llvm::cl::opt<bool> Globals;
|
2017-04-07 07:43:12 +08:00
|
|
|
extern llvm::cl::opt<bool> Classes;
|
|
|
|
extern llvm::cl::opt<bool> Enums;
|
|
|
|
extern llvm::cl::opt<bool> Typedefs;
|
2015-03-02 12:39:56 +08:00
|
|
|
extern llvm::cl::opt<bool> All;
|
2016-07-01 01:42:48 +08:00
|
|
|
extern llvm::cl::opt<bool> ExcludeCompilerGenerated;
|
|
|
|
|
|
|
|
extern llvm::cl::opt<bool> NoEnumDefs;
|
|
|
|
extern llvm::cl::list<std::string> ExcludeTypes;
|
|
|
|
extern llvm::cl::list<std::string> ExcludeSymbols;
|
|
|
|
extern llvm::cl::list<std::string> ExcludeCompilands;
|
|
|
|
extern llvm::cl::list<std::string> IncludeTypes;
|
|
|
|
extern llvm::cl::list<std::string> IncludeSymbols;
|
|
|
|
extern llvm::cl::list<std::string> IncludeCompilands;
|
2017-05-14 09:13:40 +08:00
|
|
|
extern llvm::cl::opt<SymbolSortMode> SymbolOrder;
|
2017-04-14 05:11:00 +08:00
|
|
|
extern llvm::cl::opt<ClassSortMode> ClassOrder;
|
|
|
|
extern llvm::cl::opt<uint32_t> SizeThreshold;
|
|
|
|
extern llvm::cl::opt<uint32_t> PaddingThreshold;
|
2017-04-26 04:22:29 +08:00
|
|
|
extern llvm::cl::opt<uint32_t> ImmediatePaddingThreshold;
|
2017-04-11 03:33:29 +08:00
|
|
|
extern llvm::cl::opt<ClassDefinitionFormat> ClassFormat;
|
2017-04-25 01:47:52 +08:00
|
|
|
extern llvm::cl::opt<uint32_t> ClassRecursionDepth;
|
2016-07-01 01:42:48 +08:00
|
|
|
}
|
2015-02-23 06:03:38 +08:00
|
|
|
|
2017-06-23 04:58:11 +08:00
|
|
|
namespace bytes {
|
2017-06-24 03:54:44 +08:00
|
|
|
struct NumberRange {
|
|
|
|
uint64_t Min;
|
|
|
|
llvm::Optional<uint64_t> Max;
|
2016-09-10 02:17:52 +08:00
|
|
|
};
|
2017-06-24 03:54:44 +08:00
|
|
|
|
|
|
|
extern llvm::Optional<NumberRange> DumpBlockRange;
|
|
|
|
extern llvm::Optional<NumberRange> DumpByteRange;
|
2017-06-23 04:58:11 +08:00
|
|
|
extern llvm::cl::list<std::string> DumpStreamData;
|
2017-06-24 04:18:38 +08:00
|
|
|
extern llvm::cl::opt<bool> NameMap;
|
2017-06-23 04:58:11 +08:00
|
|
|
} // namespace bytes
|
|
|
|
|
|
|
|
namespace dump {
|
2016-09-10 02:17:52 +08:00
|
|
|
|
2017-06-16 06:24:24 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpSummary;
|
|
|
|
extern llvm::cl::opt<bool> DumpStreams;
|
2017-06-24 04:28:14 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpStreamBlocks;
|
2017-06-16 07:56:19 +08:00
|
|
|
|
|
|
|
extern llvm::cl::opt<bool> DumpLines;
|
|
|
|
extern llvm::cl::opt<bool> DumpInlineeLines;
|
2017-06-16 08:04:24 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpXmi;
|
|
|
|
extern llvm::cl::opt<bool> DumpXme;
|
2017-06-16 06:24:24 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpStringTable;
|
|
|
|
extern llvm::cl::opt<bool> DumpTypes;
|
|
|
|
extern llvm::cl::opt<bool> DumpTypeData;
|
2017-06-16 07:04:42 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpTypeExtras;
|
2017-06-17 07:42:15 +08:00
|
|
|
extern llvm::cl::list<uint32_t> DumpTypeIndex;
|
|
|
|
|
2017-06-16 06:24:24 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpIds;
|
|
|
|
extern llvm::cl::opt<bool> DumpIdData;
|
2017-06-16 07:04:42 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpIdExtras;
|
2017-06-17 07:42:15 +08:00
|
|
|
extern llvm::cl::list<uint32_t> DumpIdIndex;
|
2017-06-16 06:24:24 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpSymbols;
|
|
|
|
extern llvm::cl::opt<bool> DumpSymRecordBytes;
|
2016-06-04 03:28:33 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpPublics;
|
|
|
|
extern llvm::cl::opt<bool> DumpSectionContribs;
|
|
|
|
extern llvm::cl::opt<bool> DumpSectionMap;
|
2017-06-16 06:24:24 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpModules;
|
|
|
|
extern llvm::cl::opt<bool> DumpModuleFiles;
|
|
|
|
extern llvm::cl::opt<bool> RawAll;
|
2016-07-01 01:42:48 +08:00
|
|
|
}
|
2016-06-04 03:28:33 +08:00
|
|
|
|
2016-07-01 01:42:48 +08:00
|
|
|
namespace pdb2yaml {
|
2017-05-27 07:46:20 +08:00
|
|
|
extern llvm::cl::opt<bool> All;
|
2016-07-12 05:45:09 +08:00
|
|
|
extern llvm::cl::opt<bool> NoFileHeaders;
|
2017-03-16 06:18:53 +08:00
|
|
|
extern llvm::cl::opt<bool> Minimal;
|
2016-07-01 01:42:48 +08:00
|
|
|
extern llvm::cl::opt<bool> StreamMetadata;
|
|
|
|
extern llvm::cl::opt<bool> StreamDirectory;
|
2017-01-21 06:42:09 +08:00
|
|
|
extern llvm::cl::opt<bool> StringTable;
|
2016-07-07 02:05:57 +08:00
|
|
|
extern llvm::cl::opt<bool> PdbStream;
|
2016-07-12 05:45:26 +08:00
|
|
|
extern llvm::cl::opt<bool> DbiStream;
|
2016-08-19 00:49:29 +08:00
|
|
|
extern llvm::cl::opt<bool> TpiStream;
|
2016-09-16 02:22:31 +08:00
|
|
|
extern llvm::cl::opt<bool> IpiStream;
|
2016-07-01 01:42:48 +08:00
|
|
|
extern llvm::cl::list<std::string> InputFilename;
|
2017-06-09 07:39:33 +08:00
|
|
|
extern llvm::cl::opt<bool> DumpModules;
|
|
|
|
extern llvm::cl::opt<bool> DumpModuleFiles;
|
|
|
|
extern llvm::cl::list<ModuleSubsection> DumpModuleSubsections;
|
|
|
|
extern llvm::cl::opt<bool> DumpModuleSyms;
|
2017-06-16 06:24:24 +08:00
|
|
|
} // namespace pdb2yaml
|
2015-02-23 06:03:38 +08:00
|
|
|
}
|
|
|
|
|
2016-05-14 05:21:53 +08:00
|
|
|
#endif
|