2017-06-10 13:44:06 +00:00
|
|
|
//===- llvm-pdbutil.h ----------------------------------------- *- C++ --*-===//
|
2015-05-27 18:44:32 +00: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
|
|
|
|
|
2017-12-18 20:10:56 +00:00
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2017-01-02 19:17:04 +00:00
|
|
|
#include "llvm/ADT/Optional.h"
|
2017-12-18 20:10:56 +00:00
|
|
|
#include "llvm/ADT/PointerUnion.h"
|
2015-05-27 18:44:32 +00:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
|
2017-05-16 19:46:52 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace llvm {
|
2017-12-18 20:10:56 +00:00
|
|
|
namespace object {
|
|
|
|
class COFFObjectFile;
|
|
|
|
}
|
2017-05-16 19:46:52 +00:00
|
|
|
namespace pdb {
|
|
|
|
class PDBSymbolData;
|
|
|
|
class PDBSymbolFunc;
|
2017-12-18 20:10:56 +00:00
|
|
|
class PDBFile;
|
2017-05-16 19:46:52 +00:00
|
|
|
uint32_t getTypeLength(const PDBSymbolData &Symbol);
|
|
|
|
}
|
2017-12-18 20:10:56 +00:00
|
|
|
typedef llvm::PointerUnion<object::COFFObjectFile *, pdb::PDBFile *>
|
|
|
|
PdbOrCoffObj;
|
2017-05-16 19:46:52 +00:00
|
|
|
}
|
|
|
|
|
2015-05-27 18:44:32 +00:00
|
|
|
namespace opts {
|
2016-07-23 20:41:05 +00:00
|
|
|
|
2017-06-16 21:03:24 +00:00
|
|
|
enum class DumpLevel { None, Basic, Verbose };
|
|
|
|
|
2017-06-10 13:44:06 +00:00
|
|
|
enum class ModuleSubsection {
|
|
|
|
Unknown,
|
|
|
|
Lines,
|
|
|
|
FileChecksums,
|
|
|
|
InlineeLines,
|
|
|
|
CrossScopeImports,
|
|
|
|
CrossScopeExports,
|
|
|
|
StringTable,
|
|
|
|
Symbols,
|
|
|
|
FrameData,
|
|
|
|
CoffSymbolRVAs,
|
|
|
|
All
|
|
|
|
};
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
namespace pretty {
|
2017-04-16 16:01:22 +00:00
|
|
|
|
2017-04-26 19:45:00 +00:00
|
|
|
enum class ClassDefinitionFormat { None, Layout, All };
|
|
|
|
enum class ClassSortMode {
|
|
|
|
None,
|
|
|
|
Name,
|
|
|
|
Size,
|
|
|
|
Padding,
|
|
|
|
PaddingPct,
|
|
|
|
PaddingImmediate,
|
|
|
|
PaddingPctImmediate
|
|
|
|
};
|
2017-04-16 16:01:22 +00:00
|
|
|
|
2017-05-16 19:46:52 +00: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-05-27 18:44:32 +00:00
|
|
|
extern llvm::cl::opt<bool> Compilands;
|
|
|
|
extern llvm::cl::opt<bool> Symbols;
|
|
|
|
extern llvm::cl::opt<bool> Globals;
|
2017-04-16 16:01:22 +00:00
|
|
|
extern llvm::cl::opt<bool> Classes;
|
|
|
|
extern llvm::cl::opt<bool> Enums;
|
|
|
|
extern llvm::cl::opt<bool> Typedefs;
|
2015-05-27 18:44:32 +00:00
|
|
|
extern llvm::cl::opt<bool> All;
|
|
|
|
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;
|
2015-12-30 11:46:15 +00:00
|
|
|
extern llvm::cl::list<std::string> IncludeTypes;
|
|
|
|
extern llvm::cl::list<std::string> IncludeSymbols;
|
|
|
|
extern llvm::cl::list<std::string> IncludeCompilands;
|
2017-05-16 19:46:52 +00:00
|
|
|
extern llvm::cl::opt<SymbolSortMode> SymbolOrder;
|
2017-04-16 16:01:22 +00:00
|
|
|
extern llvm::cl::opt<ClassSortMode> ClassOrder;
|
|
|
|
extern llvm::cl::opt<uint32_t> SizeThreshold;
|
|
|
|
extern llvm::cl::opt<uint32_t> PaddingThreshold;
|
2017-04-26 19:45:00 +00:00
|
|
|
extern llvm::cl::opt<uint32_t> ImmediatePaddingThreshold;
|
2017-04-16 16:01:22 +00:00
|
|
|
extern llvm::cl::opt<ClassDefinitionFormat> ClassFormat;
|
2017-04-26 19:45:00 +00:00
|
|
|
extern llvm::cl::opt<uint32_t> ClassRecursionDepth;
|
2015-05-27 18:44:32 +00:00
|
|
|
}
|
|
|
|
|
2017-06-26 20:32:52 +00:00
|
|
|
namespace bytes {
|
|
|
|
struct NumberRange {
|
|
|
|
uint64_t Min;
|
|
|
|
llvm::Optional<uint64_t> Max;
|
2017-01-02 19:17:04 +00:00
|
|
|
};
|
|
|
|
|
2017-06-26 20:32:52 +00:00
|
|
|
extern llvm::Optional<NumberRange> DumpBlockRange;
|
|
|
|
extern llvm::Optional<NumberRange> DumpByteRange;
|
|
|
|
extern llvm::cl::list<std::string> DumpStreamData;
|
|
|
|
extern llvm::cl::opt<bool> NameMap;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<bool> Fpm;
|
2017-06-26 20:32:52 +00:00
|
|
|
|
|
|
|
extern llvm::cl::opt<bool> SectionContributions;
|
|
|
|
extern llvm::cl::opt<bool> SectionMap;
|
|
|
|
extern llvm::cl::opt<bool> ModuleInfos;
|
|
|
|
extern llvm::cl::opt<bool> FileInfo;
|
|
|
|
extern llvm::cl::opt<bool> TypeServerMap;
|
|
|
|
extern llvm::cl::opt<bool> ECData;
|
|
|
|
|
|
|
|
extern llvm::cl::list<uint32_t> TypeIndex;
|
|
|
|
extern llvm::cl::list<uint32_t> IdIndex;
|
|
|
|
|
|
|
|
extern llvm::cl::opt<uint32_t> ModuleIndex;
|
|
|
|
extern llvm::cl::opt<bool> ModuleSyms;
|
|
|
|
extern llvm::cl::opt<bool> ModuleC11;
|
|
|
|
extern llvm::cl::opt<bool> ModuleC13;
|
|
|
|
extern llvm::cl::opt<bool> SplitChunks;
|
|
|
|
} // namespace bytes
|
|
|
|
|
|
|
|
namespace dump {
|
|
|
|
|
2017-06-16 21:03:24 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpSummary;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpFpm;
|
2017-06-16 21:03:24 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpStreams;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpSymbolStats;
|
|
|
|
extern llvm::cl::opt<bool> DumpUdtStats;
|
2017-06-26 20:32:52 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpStreamBlocks;
|
2017-01-02 19:17:04 +00:00
|
|
|
|
2017-06-16 21:03:24 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpLines;
|
|
|
|
extern llvm::cl::opt<bool> DumpInlineeLines;
|
|
|
|
extern llvm::cl::opt<bool> DumpXmi;
|
|
|
|
extern llvm::cl::opt<bool> DumpXme;
|
|
|
|
extern llvm::cl::opt<bool> DumpStringTable;
|
|
|
|
extern llvm::cl::opt<bool> DumpTypes;
|
|
|
|
extern llvm::cl::opt<bool> DumpTypeData;
|
|
|
|
extern llvm::cl::opt<bool> DumpTypeExtras;
|
2017-06-26 20:32:52 +00:00
|
|
|
extern llvm::cl::list<uint32_t> DumpTypeIndex;
|
2017-07-01 13:22:02 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpTypeDependents;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpSectionHeaders;
|
2017-06-26 20:32:52 +00:00
|
|
|
|
2017-06-16 21:03:24 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpIds;
|
|
|
|
extern llvm::cl::opt<bool> DumpIdData;
|
|
|
|
extern llvm::cl::opt<bool> DumpIdExtras;
|
2017-06-26 20:32:52 +00:00
|
|
|
extern llvm::cl::list<uint32_t> DumpIdIndex;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<uint32_t> DumpModi;
|
|
|
|
extern llvm::cl::opt<bool> JustMyCode;
|
2017-06-16 21:03:24 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpSymbols;
|
|
|
|
extern llvm::cl::opt<bool> DumpSymRecordBytes;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpGlobals;
|
|
|
|
extern llvm::cl::opt<bool> DumpGlobalExtras;
|
2016-07-23 20:41:05 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpPublics;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpPublicExtras;
|
2016-07-23 20:41:05 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpSectionContribs;
|
|
|
|
extern llvm::cl::opt<bool> DumpSectionMap;
|
2017-06-16 21:03:24 +00:00
|
|
|
extern llvm::cl::opt<bool> DumpModules;
|
|
|
|
extern llvm::cl::opt<bool> DumpModuleFiles;
|
|
|
|
extern llvm::cl::opt<bool> RawAll;
|
2017-04-16 16:01:22 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
namespace pdb2yaml {
|
2017-05-29 16:25:25 +00:00
|
|
|
extern llvm::cl::opt<bool> All;
|
2016-07-23 20:41:05 +00:00
|
|
|
extern llvm::cl::opt<bool> NoFileHeaders;
|
2017-04-16 16:01:22 +00:00
|
|
|
extern llvm::cl::opt<bool> Minimal;
|
2016-07-23 20:41:05 +00:00
|
|
|
extern llvm::cl::opt<bool> StreamMetadata;
|
|
|
|
extern llvm::cl::opt<bool> StreamDirectory;
|
2017-04-16 16:01:22 +00:00
|
|
|
extern llvm::cl::opt<bool> StringTable;
|
2016-07-23 20:41:05 +00:00
|
|
|
extern llvm::cl::opt<bool> PdbStream;
|
|
|
|
extern llvm::cl::opt<bool> DbiStream;
|
2017-01-02 19:17:04 +00:00
|
|
|
extern llvm::cl::opt<bool> TpiStream;
|
|
|
|
extern llvm::cl::opt<bool> IpiStream;
|
2016-07-23 20:41:05 +00:00
|
|
|
extern llvm::cl::list<std::string> InputFilename;
|
2017-06-10 13:44:06 +00: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 21:03:24 +00:00
|
|
|
} // namespace pdb2yaml
|
2017-07-13 19:25:18 +00:00
|
|
|
|
|
|
|
namespace diff {
|
|
|
|
extern llvm::cl::opt<bool> PrintValueColumns;
|
|
|
|
extern llvm::cl::opt<bool> PrintResultColumn;
|
2017-12-18 20:10:56 +00:00
|
|
|
extern llvm::DenseMap<uint32_t, uint32_t> Equivalences;
|
2017-07-13 19:25:18 +00:00
|
|
|
extern llvm::cl::opt<std::string> LeftRoot;
|
|
|
|
extern llvm::cl::opt<std::string> RightRoot;
|
|
|
|
} // namespace diff
|
2016-07-23 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|