File indexing completed on 2026-05-10 08:43:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_RAWTYPES_H
0010 #define LLVM_DEBUGINFO_PDB_NATIVE_RAWTYPES_H
0011
0012 #include "llvm/DebugInfo/CodeView/GUID.h"
0013 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
0014 #include "llvm/Support/Endian.h"
0015
0016 namespace llvm {
0017 namespace pdb {
0018
0019 struct SectionOffset {
0020 support::ulittle32_t Off;
0021 support::ulittle16_t Isect;
0022 char Padding[2];
0023 };
0024
0025
0026
0027
0028 struct GSIHashHeader {
0029 enum : unsigned {
0030 HdrSignature = ~0U,
0031 HdrVersion = 0xeffe0000 + 19990810,
0032 };
0033 support::ulittle32_t VerSignature;
0034 support::ulittle32_t VerHdr;
0035 support::ulittle32_t HrSize;
0036 support::ulittle32_t NumBuckets;
0037 };
0038
0039
0040 struct PSHashRecord {
0041 support::ulittle32_t Off;
0042 support::ulittle32_t CRef;
0043 };
0044
0045
0046 struct SectionContrib {
0047 support::ulittle16_t ISect;
0048 char Padding[2];
0049 support::little32_t Off;
0050 support::little32_t Size;
0051 support::ulittle32_t Characteristics;
0052 support::ulittle16_t Imod;
0053 char Padding2[2];
0054 support::ulittle32_t DataCrc;
0055 support::ulittle32_t RelocCrc;
0056 };
0057
0058
0059 struct SectionContrib2 {
0060
0061 SectionContrib Base;
0062 support::ulittle32_t ISectCoff;
0063 };
0064
0065
0066 struct SecMapHeader {
0067 support::ulittle16_t SecCount;
0068 support::ulittle16_t SecCountLog;
0069 };
0070
0071
0072
0073
0074 struct SecMapEntry {
0075 support::ulittle16_t Flags;
0076 support::ulittle16_t Ovl;
0077 support::ulittle16_t Group;
0078 support::ulittle16_t Frame;
0079 support::ulittle16_t SecName;
0080
0081 support::ulittle16_t ClassName;
0082
0083 support::ulittle32_t Offset;
0084
0085
0086
0087 support::ulittle32_t SecByteLength;
0088 };
0089
0090
0091
0092
0093
0094 struct DbiFlags {
0095
0096
0097
0098
0099
0100 static const uint16_t FlagIncrementalMask = 0x0001;
0101 static const uint16_t FlagStrippedMask = 0x0002;
0102 static const uint16_t FlagHasCTypesMask = 0x0004;
0103 };
0104
0105 struct DbiBuildNo {
0106
0107
0108
0109 static const uint16_t BuildMinorMask = 0x00FF;
0110 static const uint16_t BuildMinorShift = 0;
0111
0112 static const uint16_t BuildMajorMask = 0x7F00;
0113 static const uint16_t BuildMajorShift = 8;
0114
0115 static const uint16_t NewVersionFormatMask = 0x8000;
0116 };
0117
0118
0119 struct DbiStreamHeader {
0120 support::little32_t VersionSignature;
0121 support::ulittle32_t VersionHeader;
0122
0123
0124 support::ulittle32_t Age;
0125
0126
0127 support::ulittle16_t GlobalSymbolStreamIndex;
0128
0129
0130 support::ulittle16_t BuildNumber;
0131
0132
0133 support::ulittle16_t PublicSymbolStreamIndex;
0134
0135
0136 support::ulittle16_t PdbDllVersion;
0137
0138
0139 support::ulittle16_t SymRecordStreamIndex;
0140
0141
0142 support::ulittle16_t PdbDllRbld;
0143
0144
0145 support::little32_t ModiSubstreamSize;
0146
0147
0148 support::little32_t SecContrSubstreamSize;
0149
0150
0151 support::little32_t SectionMapSize;
0152
0153
0154 support::little32_t FileInfoSize;
0155
0156
0157 support::little32_t TypeServerSize;
0158
0159
0160 support::ulittle32_t MFCTypeServerIndex;
0161
0162
0163 support::little32_t OptionalDbgHdrSize;
0164
0165
0166 support::little32_t ECSubstreamSize;
0167
0168
0169 support::ulittle16_t Flags;
0170
0171
0172 support::ulittle16_t MachineType;
0173
0174
0175 support::ulittle32_t Reserved;
0176 };
0177 static_assert(sizeof(DbiStreamHeader) == 64, "Invalid DbiStreamHeader size!");
0178
0179
0180 struct FileInfoSubstreamHeader {
0181
0182
0183 support::ulittle16_t NumModules;
0184
0185
0186
0187
0188 support::ulittle16_t NumSourceFiles;
0189
0190
0191
0192
0193
0194
0195
0196
0197 };
0198
0199 struct ModInfoFlags {
0200
0201
0202
0203
0204 static const uint16_t HasECFlagMask = 0x2;
0205
0206 static const uint16_t TypeServerIndexMask = 0xFF00;
0207 static const uint16_t TypeServerIndexShift = 8;
0208 };
0209
0210
0211
0212 struct ModuleInfoHeader {
0213
0214
0215
0216
0217 support::ulittle32_t Mod;
0218
0219
0220 SectionContrib SC;
0221
0222
0223 support::ulittle16_t Flags;
0224
0225
0226 support::ulittle16_t ModDiStream;
0227
0228
0229 support::ulittle32_t SymBytes;
0230
0231
0232 support::ulittle32_t C11Bytes;
0233
0234
0235 support::ulittle32_t C13Bytes;
0236
0237
0238 support::ulittle16_t NumFiles;
0239
0240
0241 char Padding1[2];
0242
0243
0244
0245
0246
0247
0248
0249 support::ulittle32_t FileNameOffs;
0250
0251
0252 support::ulittle32_t SrcFileNameNI;
0253
0254
0255 support::ulittle32_t PdbFilePathNI;
0256
0257
0258
0259
0260 };
0261
0262
0263
0264 struct PublicsStreamHeader {
0265 support::ulittle32_t SymHash;
0266 support::ulittle32_t AddrMap;
0267 support::ulittle32_t NumThunks;
0268 support::ulittle32_t SizeOfThunk;
0269 support::ulittle16_t ISectThunkTable;
0270 char Padding[2];
0271 support::ulittle32_t OffThunkTable;
0272 support::ulittle32_t NumSections;
0273 };
0274
0275
0276
0277 struct TpiStreamHeader {
0278 struct EmbeddedBuf {
0279 support::little32_t Off;
0280 support::ulittle32_t Length;
0281 };
0282
0283 support::ulittle32_t Version;
0284 support::ulittle32_t HeaderSize;
0285 support::ulittle32_t TypeIndexBegin;
0286 support::ulittle32_t TypeIndexEnd;
0287 support::ulittle32_t TypeRecordBytes;
0288
0289
0290 support::ulittle16_t HashStreamIndex;
0291 support::ulittle16_t HashAuxStreamIndex;
0292 support::ulittle32_t HashKeySize;
0293 support::ulittle32_t NumHashBuckets;
0294
0295 EmbeddedBuf HashValueBuffer;
0296 EmbeddedBuf IndexOffsetBuffer;
0297 EmbeddedBuf HashAdjBuffer;
0298 };
0299
0300 const uint32_t MinTpiHashBuckets = 0x1000;
0301 const uint32_t MaxTpiHashBuckets = 0x40000;
0302
0303
0304 struct InfoStreamHeader {
0305 support::ulittle32_t Version;
0306 support::ulittle32_t Signature;
0307 support::ulittle32_t Age;
0308 codeview::GUID Guid;
0309 };
0310
0311
0312 struct PDBStringTableHeader {
0313 support::ulittle32_t Signature;
0314 support::ulittle32_t HashVersion;
0315 support::ulittle32_t ByteSize;
0316 };
0317
0318 const uint32_t PDBStringTableSignature = 0xEFFEEFFE;
0319
0320
0321 struct SrcHeaderBlockHeader {
0322 support::ulittle32_t Version;
0323 support::ulittle32_t Size;
0324 uint64_t FileTime;
0325 support::ulittle32_t Age;
0326 uint8_t Padding[44];
0327 };
0328 static_assert(sizeof(SrcHeaderBlockHeader) == 64, "Incorrect struct size!");
0329
0330
0331 struct SrcHeaderBlockEntry {
0332 support::ulittle32_t Size;
0333 support::ulittle32_t Version;
0334 support::ulittle32_t CRC;
0335 support::ulittle32_t FileSize;
0336 support::ulittle32_t FileNI;
0337 support::ulittle32_t ObjNI;
0338 support::ulittle32_t VFileNI;
0339 uint8_t Compression;
0340 uint8_t IsVirtual;
0341 short Padding;
0342 char Reserved[8];
0343 };
0344 static_assert(sizeof(SrcHeaderBlockEntry) == 40, "Incorrect struct size!");
0345
0346 }
0347 }
0348
0349 #endif