1 //===- PdbYAML.h ---------------------------------------------- *- C++ --*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
12 #include "OutputStyle.h"
14 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
15 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
16 #include "llvm/DebugInfo/MSF/MSFCommon.h"
17 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
18 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
19 #include "llvm/DebugInfo/PDB/PDBTypes.h"
20 #include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h"
21 #include "llvm/ObjectYAML/CodeViewYAMLSymbols.h"
22 #include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
23 #include "llvm/Support/Endian.h"
24 #include "llvm/Support/YAMLTraits.h"
35 msf::SuperBlock SuperBlock
;
36 uint32_t NumDirectoryBlocks
= 0;
37 std::vector
<uint32_t> DirectoryBlocks
;
38 uint32_t NumStreams
= 0;
39 uint64_t FileSize
= 0;
42 struct StreamBlockList
{
43 std::vector
<uint32_t> Blocks
;
46 struct NamedStreamMapping
{
48 uint32_t StreamNumber
;
51 struct PdbInfoStream
{
52 PdbRaw_ImplVer Version
= PdbImplVC70
;
53 uint32_t Signature
= 0;
56 std::vector
<PdbRaw_FeatureSig
> Features
;
57 std::vector
<NamedStreamMapping
> NamedStreams
;
60 struct PdbModiStream
{
62 std::vector
<CodeViewYAML::SymbolRecord
> Symbols
;
65 struct PdbDbiModuleInfo
{
68 std::vector
<StringRef
> SourceFiles
;
69 std::vector
<CodeViewYAML::YAMLDebugSubsection
> Subsections
;
70 std::optional
<PdbModiStream
> Modi
;
74 PdbRaw_DbiVer VerHeader
= PdbDbiV70
;
76 uint16_t BuildNumber
= 0;
77 uint32_t PdbDllVersion
= 0;
78 uint16_t PdbDllRbld
= 0;
80 PDB_Machine MachineType
= PDB_Machine::x86
;
82 std::vector
<PdbDbiModuleInfo
> ModInfos
;
86 PdbRaw_TpiVer Version
= PdbTpiV80
;
87 std::vector
<CodeViewYAML::LeafRecord
> Records
;
90 struct PdbPublicsStream
{
91 std::vector
<CodeViewYAML::SymbolRecord
> PubSyms
;
95 explicit PdbObject(BumpPtrAllocator
&Allocator
) : Allocator(Allocator
) {}
97 std::optional
<MSFHeaders
> Headers
;
98 std::optional
<std::vector
<uint32_t>> StreamSizes
;
99 std::optional
<std::vector
<StreamBlockList
>> StreamMap
;
100 std::optional
<PdbInfoStream
> PdbStream
;
101 std::optional
<PdbDbiStream
> DbiStream
;
102 std::optional
<PdbTpiStream
> TpiStream
;
103 std::optional
<PdbTpiStream
> IpiStream
;
104 std::optional
<PdbPublicsStream
> PublicsStream
;
106 std::optional
<std::vector
<StringRef
>> StringTable
;
108 BumpPtrAllocator
&Allocator
;
114 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbObject
)
115 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::MSFHeaders
)
116 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(msf::SuperBlock
)
117 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::StreamBlockList
)
118 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbInfoStream
)
119 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbDbiStream
)
120 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbTpiStream
)
121 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbPublicsStream
)
122 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::NamedStreamMapping
)
123 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbModiStream
)
124 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbDbiModuleInfo
)
126 #endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H