2016-06-07 04:37:05 +08:00
|
|
|
//===- PdbYAML.h ---------------------------------------------- *- C++ --*-===//
|
|
|
|
//
|
|
|
|
// 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_PDBYAML_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
|
|
|
|
|
|
|
|
#include "OutputStyle.h"
|
|
|
|
|
|
|
|
#include "llvm/ADT/Optional.h"
|
2016-10-08 09:12:01 +08:00
|
|
|
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
|
|
|
|
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
|
2016-07-30 04:56:36 +08:00
|
|
|
#include "llvm/DebugInfo/MSF/MSFCommon.h"
|
2017-01-26 06:38:55 +08:00
|
|
|
#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/Native/RawConstants.h"
|
2016-07-07 02:05:57 +08:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBTypes.h"
|
2017-05-31 12:17:13 +08:00
|
|
|
#include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h"
|
|
|
|
#include "llvm/ObjectYAML/CodeViewYAMLSymbols.h"
|
|
|
|
#include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
|
2016-06-07 04:37:05 +08:00
|
|
|
#include "llvm/Support/Endian.h"
|
|
|
|
#include "llvm/Support/YAMLTraits.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
2017-06-03 03:49:14 +08:00
|
|
|
namespace codeview {
|
|
|
|
class DebugStringTableSubsection;
|
|
|
|
}
|
2016-06-07 04:37:05 +08:00
|
|
|
namespace pdb {
|
|
|
|
|
|
|
|
namespace yaml {
|
2016-09-10 01:46:17 +08:00
|
|
|
struct SerializationContext;
|
|
|
|
|
2016-07-30 04:56:36 +08:00
|
|
|
struct MSFHeaders {
|
2016-07-16 06:16:56 +08:00
|
|
|
msf::SuperBlock SuperBlock;
|
2017-03-16 06:18:53 +08:00
|
|
|
uint32_t NumDirectoryBlocks = 0;
|
2016-07-16 06:16:56 +08:00
|
|
|
std::vector<uint32_t> DirectoryBlocks;
|
2017-03-16 06:18:53 +08:00
|
|
|
uint32_t NumStreams = 0;
|
|
|
|
uint32_t FileSize = 0;
|
2016-06-07 04:37:05 +08:00
|
|
|
};
|
|
|
|
|
2016-06-15 04:48:36 +08:00
|
|
|
struct StreamBlockList {
|
2016-07-16 06:16:56 +08:00
|
|
|
std::vector<uint32_t> Blocks;
|
2016-06-07 04:37:17 +08:00
|
|
|
};
|
|
|
|
|
2016-07-16 06:17:08 +08:00
|
|
|
struct NamedStreamMapping {
|
|
|
|
StringRef StreamName;
|
|
|
|
uint32_t StreamNumber;
|
|
|
|
};
|
|
|
|
|
2016-07-07 02:05:57 +08:00
|
|
|
struct PdbInfoStream {
|
2017-03-16 06:18:53 +08:00
|
|
|
PdbRaw_ImplVer Version = PdbImplVC70;
|
|
|
|
uint32_t Signature = 0;
|
|
|
|
uint32_t Age = 1;
|
2017-07-18 07:59:44 +08:00
|
|
|
codeview::GUID Guid;
|
2017-03-17 04:19:11 +08:00
|
|
|
std::vector<PdbRaw_FeatureSig> Features;
|
2016-07-16 06:17:08 +08:00
|
|
|
std::vector<NamedStreamMapping> NamedStreams;
|
2016-07-07 02:05:57 +08:00
|
|
|
};
|
|
|
|
|
2016-10-08 09:12:01 +08:00
|
|
|
struct PdbModiStream {
|
|
|
|
uint32_t Signature;
|
2017-05-31 07:50:44 +08:00
|
|
|
std::vector<CodeViewYAML::SymbolRecord> Symbols;
|
2016-10-08 09:12:01 +08:00
|
|
|
};
|
|
|
|
|
2016-07-22 23:46:37 +08:00
|
|
|
struct PdbDbiModuleInfo {
|
|
|
|
StringRef Obj;
|
|
|
|
StringRef Mod;
|
|
|
|
std::vector<StringRef> SourceFiles;
|
2017-06-03 03:49:14 +08:00
|
|
|
std::vector<CodeViewYAML::YAMLDebugSubsection> Subsections;
|
2016-10-08 09:12:01 +08:00
|
|
|
Optional<PdbModiStream> Modi;
|
2016-07-22 23:46:37 +08:00
|
|
|
};
|
|
|
|
|
2016-07-12 05:45:26 +08:00
|
|
|
struct PdbDbiStream {
|
2017-03-16 06:18:53 +08:00
|
|
|
PdbRaw_DbiVer VerHeader = PdbDbiV70;
|
|
|
|
uint32_t Age = 1;
|
|
|
|
uint16_t BuildNumber = 0;
|
|
|
|
uint32_t PdbDllVersion = 0;
|
|
|
|
uint16_t PdbDllRbld = 0;
|
|
|
|
uint16_t Flags = 1;
|
|
|
|
PDB_Machine MachineType = PDB_Machine::x86;
|
2016-07-22 23:46:37 +08:00
|
|
|
|
|
|
|
std::vector<PdbDbiModuleInfo> ModInfos;
|
2016-07-12 05:45:26 +08:00
|
|
|
};
|
|
|
|
|
2016-08-19 00:49:29 +08:00
|
|
|
struct PdbTpiStream {
|
2017-03-16 06:18:53 +08:00
|
|
|
PdbRaw_TpiVer Version = PdbTpiV80;
|
2017-05-31 05:53:05 +08:00
|
|
|
std::vector<CodeViewYAML::LeafRecord> Records;
|
2016-08-19 00:49:29 +08:00
|
|
|
};
|
|
|
|
|
2016-06-07 04:37:05 +08:00
|
|
|
struct PdbObject {
|
2016-09-10 01:46:17 +08:00
|
|
|
explicit PdbObject(BumpPtrAllocator &Allocator) : Allocator(Allocator) {}
|
|
|
|
|
2016-07-30 04:56:36 +08:00
|
|
|
Optional<MSFHeaders> Headers;
|
2016-07-16 06:16:56 +08:00
|
|
|
Optional<std::vector<uint32_t>> StreamSizes;
|
2016-06-15 04:48:36 +08:00
|
|
|
Optional<std::vector<StreamBlockList>> StreamMap;
|
2016-07-07 02:05:57 +08:00
|
|
|
Optional<PdbInfoStream> PdbStream;
|
2016-07-12 05:45:26 +08:00
|
|
|
Optional<PdbDbiStream> DbiStream;
|
2016-08-19 00:49:29 +08:00
|
|
|
Optional<PdbTpiStream> TpiStream;
|
2016-09-16 02:22:31 +08:00
|
|
|
Optional<PdbTpiStream> IpiStream;
|
2016-09-10 01:46:17 +08:00
|
|
|
|
2017-01-21 06:42:09 +08:00
|
|
|
Optional<std::vector<StringRef>> StringTable;
|
|
|
|
|
2016-09-10 01:46:17 +08:00
|
|
|
BumpPtrAllocator &Allocator;
|
2016-06-07 04:37:05 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2016-06-07 04:37:17 +08:00
|
|
|
}
|
2016-06-07 04:37:05 +08:00
|
|
|
|
2017-05-31 05:53:05 +08:00
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbObject)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::MSFHeaders)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(msf::SuperBlock)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::StreamBlockList)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbInfoStream)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbDbiStream)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbTpiStream)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::NamedStreamMapping)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbModiStream)
|
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbDbiModuleInfo)
|
2016-06-07 04:37:05 +08:00
|
|
|
|
|
|
|
#endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
|