annotate tools/llvm-pdbutil/PdbYaml.h @ 134:3a76565eade5 LLVM5.0.1

update 5.0.1
author mir3636
date Sat, 17 Feb 2018 09:57:20 +0900
parents 803732b1fca8
children c2174574ed3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===- PdbYAML.h ---------------------------------------------- *- C++ --*-===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 #ifndef LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 #define LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 #include "OutputStyle.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 #include "llvm/ADT/Optional.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 #include "llvm/DebugInfo/MSF/MSFCommon.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 #include "llvm/DebugInfo/PDB/PDBTypes.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 #include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 #include "llvm/ObjectYAML/CodeViewYAMLSymbols.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 #include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 #include "llvm/Support/Endian.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 #include "llvm/Support/YAMLTraits.h"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 #include <vector>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 namespace llvm {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 namespace codeview {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 class DebugStringTableSubsection;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 namespace pdb {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 namespace yaml {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 struct SerializationContext;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 struct MSFHeaders {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 msf::SuperBlock SuperBlock;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 uint32_t NumDirectoryBlocks = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 std::vector<uint32_t> DirectoryBlocks;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 uint32_t NumStreams = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 uint32_t FileSize = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 struct StreamBlockList {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 std::vector<uint32_t> Blocks;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 struct NamedStreamMapping {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 StringRef StreamName;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 uint32_t StreamNumber;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 struct PdbInfoStream {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 PdbRaw_ImplVer Version = PdbImplVC70;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 uint32_t Signature = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 uint32_t Age = 1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 codeview::GUID Guid;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 std::vector<PdbRaw_FeatureSig> Features;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 std::vector<NamedStreamMapping> NamedStreams;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 struct PdbModiStream {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 uint32_t Signature;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 std::vector<CodeViewYAML::SymbolRecord> Symbols;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 struct PdbDbiModuleInfo {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 StringRef Obj;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 StringRef Mod;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 std::vector<StringRef> SourceFiles;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 std::vector<CodeViewYAML::YAMLDebugSubsection> Subsections;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 Optional<PdbModiStream> Modi;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 struct PdbDbiStream {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 PdbRaw_DbiVer VerHeader = PdbDbiV70;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 uint32_t Age = 1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 uint16_t BuildNumber = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 uint32_t PdbDllVersion = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 uint16_t PdbDllRbld = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 uint16_t Flags = 1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 PDB_Machine MachineType = PDB_Machine::x86;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 std::vector<PdbDbiModuleInfo> ModInfos;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 struct PdbTpiStream {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 PdbRaw_TpiVer Version = PdbTpiV80;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 std::vector<CodeViewYAML::LeafRecord> Records;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 struct PdbObject {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 explicit PdbObject(BumpPtrAllocator &Allocator) : Allocator(Allocator) {}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 Optional<MSFHeaders> Headers;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 Optional<std::vector<uint32_t>> StreamSizes;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 Optional<std::vector<StreamBlockList>> StreamMap;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 Optional<PdbInfoStream> PdbStream;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 Optional<PdbDbiStream> DbiStream;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 Optional<PdbTpiStream> TpiStream;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 Optional<PdbTpiStream> IpiStream;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106 Optional<std::vector<StringRef>> StringTable;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 BumpPtrAllocator &Allocator;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 };
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbObject)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::MSFHeaders)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 LLVM_YAML_DECLARE_MAPPING_TRAITS(msf::SuperBlock)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::StreamBlockList)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbInfoStream)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbDbiStream)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbTpiStream)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::NamedStreamMapping)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbModiStream)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbDbiModuleInfo)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 #endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H