2016-06-06 20:37:05 +00:00
|
|
|
//===- PdbYAML.h ---------------------------------------------- *- C++ --*-===//
|
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2016-06-06 20:37:05 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
|
|
|
|
#define LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
|
|
|
|
|
|
|
|
#include "OutputStyle.h"
|
|
|
|
|
2016-10-08 01:12:01 +00:00
|
|
|
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
|
|
|
|
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
|
2016-07-29 20:56:36 +00:00
|
|
|
#include "llvm/DebugInfo/MSF/MSFCommon.h"
|
2017-01-25 22:38:55 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
|
|
|
|
#include "llvm/DebugInfo/PDB/Native/RawConstants.h"
|
2016-07-06 18:05:57 +00:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBTypes.h"
|
2017-05-31 04:17:13 +00:00
|
|
|
#include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h"
|
|
|
|
#include "llvm/ObjectYAML/CodeViewYAMLSymbols.h"
|
|
|
|
#include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
|
2016-06-06 20:37:05 +00:00
|
|
|
#include "llvm/Support/Endian.h"
|
|
|
|
#include "llvm/Support/YAMLTraits.h"
|
|
|
|
|
2022-12-05 15:19:30 -08:00
|
|
|
#include <optional>
|
2016-06-06 20:37:05 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace pdb {
|
|
|
|
|
|
|
|
namespace yaml {
|
2016-09-09 17:46:17 +00:00
|
|
|
|
2016-07-29 20:56:36 +00:00
|
|
|
struct MSFHeaders {
|
2016-07-15 22:16:56 +00:00
|
|
|
msf::SuperBlock SuperBlock;
|
2017-03-15 22:18:53 +00:00
|
|
|
uint32_t NumDirectoryBlocks = 0;
|
2016-07-15 22:16:56 +00:00
|
|
|
std::vector<uint32_t> DirectoryBlocks;
|
2017-03-15 22:18:53 +00:00
|
|
|
uint32_t NumStreams = 0;
|
2021-12-06 18:11:34 -05:00
|
|
|
uint64_t FileSize = 0;
|
2016-06-06 20:37:05 +00:00
|
|
|
};
|
|
|
|
|
2016-06-14 20:48:36 +00:00
|
|
|
struct StreamBlockList {
|
2016-07-15 22:16:56 +00:00
|
|
|
std::vector<uint32_t> Blocks;
|
2016-06-06 20:37:17 +00:00
|
|
|
};
|
|
|
|
|
2016-07-15 22:17:08 +00:00
|
|
|
struct NamedStreamMapping {
|
|
|
|
StringRef StreamName;
|
|
|
|
uint32_t StreamNumber;
|
|
|
|
};
|
|
|
|
|
2016-07-06 18:05:57 +00:00
|
|
|
struct PdbInfoStream {
|
2017-03-15 22:18:53 +00:00
|
|
|
PdbRaw_ImplVer Version = PdbImplVC70;
|
|
|
|
uint32_t Signature = 0;
|
|
|
|
uint32_t Age = 1;
|
2017-07-17 23:59:44 +00:00
|
|
|
codeview::GUID Guid;
|
2017-03-16 20:19:11 +00:00
|
|
|
std::vector<PdbRaw_FeatureSig> Features;
|
2016-07-15 22:17:08 +00:00
|
|
|
std::vector<NamedStreamMapping> NamedStreams;
|
2016-07-06 18:05:57 +00:00
|
|
|
};
|
|
|
|
|
2016-10-08 01:12:01 +00:00
|
|
|
struct PdbModiStream {
|
|
|
|
uint32_t Signature;
|
2017-05-30 23:50:44 +00:00
|
|
|
std::vector<CodeViewYAML::SymbolRecord> Symbols;
|
2016-10-08 01:12:01 +00:00
|
|
|
};
|
|
|
|
|
2016-07-22 15:46:37 +00:00
|
|
|
struct PdbDbiModuleInfo {
|
|
|
|
StringRef Obj;
|
|
|
|
StringRef Mod;
|
|
|
|
std::vector<StringRef> SourceFiles;
|
2017-06-02 19:49:14 +00:00
|
|
|
std::vector<CodeViewYAML::YAMLDebugSubsection> Subsections;
|
2022-12-05 15:19:30 -08:00
|
|
|
std::optional<PdbModiStream> Modi;
|
2016-07-22 15:46:37 +00:00
|
|
|
};
|
|
|
|
|
2016-07-11 21:45:26 +00:00
|
|
|
struct PdbDbiStream {
|
2017-03-15 22:18:53 +00: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 15:46:37 +00:00
|
|
|
|
|
|
|
std::vector<PdbDbiModuleInfo> ModInfos;
|
2016-07-11 21:45:26 +00:00
|
|
|
};
|
|
|
|
|
2016-08-18 16:49:29 +00:00
|
|
|
struct PdbTpiStream {
|
2017-03-15 22:18:53 +00:00
|
|
|
PdbRaw_TpiVer Version = PdbTpiV80;
|
2017-05-30 21:53:05 +00:00
|
|
|
std::vector<CodeViewYAML::LeafRecord> Records;
|
2016-08-18 16:49:29 +00:00
|
|
|
};
|
|
|
|
|
2018-10-26 00:17:31 +00:00
|
|
|
struct PdbPublicsStream {
|
|
|
|
std::vector<CodeViewYAML::SymbolRecord> PubSyms;
|
|
|
|
};
|
|
|
|
|
2016-06-06 20:37:05 +00:00
|
|
|
struct PdbObject {
|
2016-09-09 17:46:17 +00:00
|
|
|
explicit PdbObject(BumpPtrAllocator &Allocator) : Allocator(Allocator) {}
|
|
|
|
|
2022-12-05 15:19:30 -08:00
|
|
|
std::optional<MSFHeaders> Headers;
|
|
|
|
std::optional<std::vector<uint32_t>> StreamSizes;
|
|
|
|
std::optional<std::vector<StreamBlockList>> StreamMap;
|
|
|
|
std::optional<PdbInfoStream> PdbStream;
|
|
|
|
std::optional<PdbDbiStream> DbiStream;
|
|
|
|
std::optional<PdbTpiStream> TpiStream;
|
|
|
|
std::optional<PdbTpiStream> IpiStream;
|
|
|
|
std::optional<PdbPublicsStream> PublicsStream;
|
2016-09-09 17:46:17 +00:00
|
|
|
|
2022-12-05 15:19:30 -08:00
|
|
|
std::optional<std::vector<StringRef>> StringTable;
|
2017-01-20 22:42:09 +00:00
|
|
|
|
2016-09-09 17:46:17 +00:00
|
|
|
BumpPtrAllocator &Allocator;
|
2016-06-06 20:37:05 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2016-06-06 20:37:17 +00:00
|
|
|
}
|
2016-06-06 20:37:05 +00:00
|
|
|
|
2017-05-30 21:53:05 +00: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)
|
2018-10-26 00:17:31 +00:00
|
|
|
LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbPublicsStream)
|
2017-05-30 21:53:05 +00:00
|
|
|
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-06 20:37:05 +00:00
|
|
|
|
|
|
|
#endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
|