2016-06-06 22:37:05 +02: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-07-06 20:05:57 +02:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBTypes.h"
|
2016-07-16 00:16:56 +02:00
|
|
|
#include "llvm/DebugInfo/PDB/Raw/MsfCommon.h"
|
2016-06-14 22:48:36 +02:00
|
|
|
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
2016-07-06 20:05:57 +02:00
|
|
|
#include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
|
2016-06-06 22:37:05 +02:00
|
|
|
#include "llvm/Support/Endian.h"
|
|
|
|
#include "llvm/Support/YAMLTraits.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace pdb {
|
|
|
|
|
|
|
|
namespace yaml {
|
|
|
|
struct MsfHeaders {
|
2016-07-16 00:16:56 +02:00
|
|
|
msf::SuperBlock SuperBlock;
|
2016-06-06 22:37:05 +02:00
|
|
|
uint32_t NumDirectoryBlocks;
|
2016-07-16 00:16:56 +02:00
|
|
|
std::vector<uint32_t> DirectoryBlocks;
|
2016-06-06 22:37:05 +02:00
|
|
|
uint32_t NumStreams;
|
2016-06-14 22:48:36 +02:00
|
|
|
uint32_t FileSize;
|
2016-06-06 22:37:05 +02:00
|
|
|
};
|
|
|
|
|
2016-06-14 22:48:36 +02:00
|
|
|
struct StreamBlockList {
|
2016-07-16 00:16:56 +02:00
|
|
|
std::vector<uint32_t> Blocks;
|
2016-06-06 22:37:17 +02:00
|
|
|
};
|
|
|
|
|
2016-07-16 00:17:08 +02:00
|
|
|
struct NamedStreamMapping {
|
|
|
|
StringRef StreamName;
|
|
|
|
uint32_t StreamNumber;
|
|
|
|
};
|
|
|
|
|
2016-07-06 20:05:57 +02:00
|
|
|
struct PdbInfoStream {
|
2016-07-11 23:45:26 +02:00
|
|
|
PdbRaw_ImplVer Version;
|
2016-07-06 20:05:57 +02:00
|
|
|
uint32_t Signature;
|
|
|
|
uint32_t Age;
|
|
|
|
PDB_UniqueId Guid;
|
2016-07-16 00:17:08 +02:00
|
|
|
std::vector<NamedStreamMapping> NamedStreams;
|
2016-07-06 20:05:57 +02:00
|
|
|
};
|
|
|
|
|
2016-07-22 17:46:37 +02:00
|
|
|
struct PdbDbiModuleInfo {
|
|
|
|
StringRef Obj;
|
|
|
|
StringRef Mod;
|
|
|
|
std::vector<StringRef> SourceFiles;
|
|
|
|
};
|
|
|
|
|
2016-07-11 23:45:26 +02:00
|
|
|
struct PdbDbiStream {
|
|
|
|
PdbRaw_DbiVer VerHeader;
|
|
|
|
uint32_t Age;
|
|
|
|
uint16_t BuildNumber;
|
|
|
|
uint32_t PdbDllVersion;
|
|
|
|
uint16_t PdbDllRbld;
|
|
|
|
uint16_t Flags;
|
|
|
|
PDB_Machine MachineType;
|
2016-07-22 17:46:37 +02:00
|
|
|
|
|
|
|
std::vector<PdbDbiModuleInfo> ModInfos;
|
2016-07-11 23:45:26 +02:00
|
|
|
};
|
|
|
|
|
2016-06-06 22:37:05 +02:00
|
|
|
struct PdbObject {
|
2016-07-11 23:45:09 +02:00
|
|
|
Optional<MsfHeaders> Headers;
|
2016-07-16 00:16:56 +02:00
|
|
|
Optional<std::vector<uint32_t>> StreamSizes;
|
2016-06-14 22:48:36 +02:00
|
|
|
Optional<std::vector<StreamBlockList>> StreamMap;
|
2016-07-06 20:05:57 +02:00
|
|
|
Optional<PdbInfoStream> PdbStream;
|
2016-07-11 23:45:26 +02:00
|
|
|
Optional<PdbDbiStream> DbiStream;
|
2016-06-06 22:37:05 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2016-06-06 22:37:17 +02:00
|
|
|
}
|
2016-06-06 22:37:05 +02:00
|
|
|
|
2016-06-06 22:37:17 +02:00
|
|
|
namespace llvm {
|
2016-06-06 22:37:05 +02:00
|
|
|
namespace yaml {
|
2016-06-14 22:48:36 +02:00
|
|
|
|
2016-07-11 23:45:26 +02:00
|
|
|
template <> struct MappingTraits<pdb::yaml::PdbObject> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::PdbObject &Obj);
|
2016-06-06 22:37:17 +02:00
|
|
|
};
|
|
|
|
|
2016-06-06 22:37:05 +02:00
|
|
|
template <> struct MappingTraits<pdb::yaml::MsfHeaders> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::MsfHeaders &Obj);
|
|
|
|
};
|
2016-06-14 22:48:36 +02:00
|
|
|
|
2016-07-16 00:16:56 +02:00
|
|
|
template <> struct MappingTraits<pdb::msf::SuperBlock> {
|
|
|
|
static void mapping(IO &IO, pdb::msf::SuperBlock &SB);
|
2016-07-11 23:45:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct MappingTraits<pdb::yaml::StreamBlockList> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::StreamBlockList &SB);
|
2016-06-06 22:37:05 +02:00
|
|
|
};
|
2016-07-06 20:05:57 +02:00
|
|
|
|
|
|
|
template <> struct MappingTraits<pdb::yaml::PdbInfoStream> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::PdbInfoStream &Obj);
|
|
|
|
};
|
2016-07-11 23:45:26 +02:00
|
|
|
|
|
|
|
template <> struct MappingTraits<pdb::yaml::PdbDbiStream> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::PdbDbiStream &Obj);
|
|
|
|
};
|
2016-07-16 00:17:08 +02:00
|
|
|
|
|
|
|
template <> struct MappingTraits<pdb::yaml::NamedStreamMapping> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::NamedStreamMapping &Obj);
|
|
|
|
};
|
2016-07-22 17:46:37 +02:00
|
|
|
|
|
|
|
template <> struct MappingTraits<pdb::yaml::PdbDbiModuleInfo> {
|
|
|
|
static void mapping(IO &IO, pdb::yaml::PdbDbiModuleInfo &Obj);
|
|
|
|
};
|
2016-06-06 22:37:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-20 21:41:47 +02:00
|
|
|
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
|
2016-07-22 17:46:37 +02:00
|
|
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
|
2016-07-16 00:17:08 +02:00
|
|
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::NamedStreamMapping)
|
2016-07-22 17:46:37 +02:00
|
|
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbDbiModuleInfo)
|
2016-06-14 22:48:36 +02:00
|
|
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::StreamBlockList)
|
2016-06-06 22:37:05 +02:00
|
|
|
|
|
|
|
#endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
|