LLVM  3.7.0
PDBTypes.h
Go to the documentation of this file.
1 //===- PDBTypes.h - Defines enums for various fields contained in PDB ---*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_PDBTYPES_H
11 #define LLVM_DEBUGINFO_PDB_PDBTYPES_H
12 
13 #include "llvm/Config/llvm-config.h"
14 #include <functional>
15 #include <stdint.h>
16 
17 namespace llvm {
18 
19 class PDBSymDumper;
20 class PDBSymbol;
21 
22 class IPDBDataStream;
23 template <class T> class IPDBEnumChildren;
24 class IPDBLineNumber;
25 class IPDBRawSymbol;
26 class IPDBSession;
28 
33 
34 class PDBSymbolExe;
35 class PDBSymbolCompiland;
38 class PDBSymbolFunc;
39 class PDBSymbolBlock;
40 class PDBSymbolData;
42 class PDBSymbolLabel;
44 class PDBSymbolTypeUDT;
45 class PDBSymbolTypeEnum;
48 class PDBSymbolTypeArray;
59 class PDBSymbolCustom;
60 class PDBSymbolThunk;
64 class PDBSymbolUnknown;
65 
66 /// Specifies which PDB reader implementation is to be used. Only a value
67 /// of PDB_ReaderType::DIA is supported.
68 enum class PDB_ReaderType {
69  DIA = 0,
70 };
71 
72 /// Defines a 128-bit unique identifier. This maps to a GUID on Windows, but
73 /// is abstracted here for the purposes of non-Windows platforms that don't have
74 /// the GUID structure defined.
75 struct PDB_UniqueId {
76  uint64_t HighPart;
77  uint64_t LowPart;
78 };
79 
80 /// An enumeration indicating the type of data contained in this table.
81 enum class PDB_TableType {
82  Symbols,
86  Segments,
88  FrameData
89 };
90 
91 /// Defines flags used for enumerating child symbols. This corresponds to the
92 /// NameSearchOptions enumeration which is documented here:
93 /// https://msdn.microsoft.com/en-us/library/yat28ads.aspx
95  NS_Default = 0x0,
99  NS_Regex = 0x8,
101 };
102 
103 /// Specifies the hash algorithm that a source file from a PDB was hashed with.
104 /// This corresponds to the CV_SourceChksum_t enumeration and are documented
105 /// here: https://msdn.microsoft.com/en-us/library/e96az21x.aspx
106 enum class PDB_Checksum { None = 0, MD5 = 1, SHA1 = 2 };
107 
108 /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented
109 /// here: https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
110 enum class PDB_Cpu {
111  Intel8080 = 0x0,
112  Intel8086 = 0x1,
113  Intel80286 = 0x2,
114  Intel80386 = 0x3,
115  Intel80486 = 0x4,
116  Pentium = 0x5,
117  PentiumPro = 0x6,
118  Pentium3 = 0x7,
119  MIPS = 0x10,
120  MIPS16 = 0x11,
121  MIPS32 = 0x12,
122  MIPS64 = 0x13,
123  MIPSI = 0x14,
124  MIPSII = 0x15,
125  MIPSIII = 0x16,
126  MIPSIV = 0x17,
127  MIPSV = 0x18,
128  M68000 = 0x20,
129  M68010 = 0x21,
130  M68020 = 0x22,
131  M68030 = 0x23,
132  M68040 = 0x24,
133  Alpha = 0x30,
134  Alpha21164 = 0x31,
135  Alpha21164A = 0x32,
136  Alpha21264 = 0x33,
137  Alpha21364 = 0x34,
138  PPC601 = 0x40,
139  PPC603 = 0x41,
140  PPC604 = 0x42,
141  PPC620 = 0x43,
142  PPCFP = 0x44,
143  PPCBE = 0x45,
144  SH3 = 0x50,
145  SH3E = 0x51,
146  SH3DSP = 0x52,
147  SH4 = 0x53,
148  SHMedia = 0x54,
149  ARM3 = 0x60,
150  ARM4 = 0x61,
151  ARM4T = 0x62,
152  ARM5 = 0x63,
153  ARM5T = 0x64,
154  ARM6 = 0x65,
155  ARM_XMAC = 0x66,
156  ARM_WMMX = 0x67,
157  ARM7 = 0x68,
158  Omni = 0x70,
159  Ia64 = 0x80,
160  Ia64_2 = 0x81,
161  CEE = 0x90,
162  AM33 = 0xa0,
163  M32R = 0xb0,
164  TriCore = 0xc0,
165  X64 = 0xd0,
166  EBC = 0xe0,
167  Thumb = 0xf0,
168  ARMNT = 0xf4,
169  D3D11_Shader = 0x100,
170 };
171 
172 enum class PDB_Machine {
173  Invalid = 0xffff,
174  Unknown = 0x0,
175  Am33 = 0x13,
176  Amd64 = 0x8664,
177  Arm = 0x1C0,
178  ArmNT = 0x1C4,
179  Ebc = 0xEBC,
180  x86 = 0x14C,
181  Ia64 = 0x200,
182  M32R = 0x9041,
183  Mips16 = 0x266,
184  MipsFpu = 0x366,
185  MipsFpu16 = 0x466,
186  PowerPC = 0x1F0,
187  PowerPCFP = 0x1F1,
188  R4000 = 0x166,
189  SH3 = 0x1A2,
190  SH3DSP = 0x1A3,
191  SH4 = 0x1A6,
192  SH5 = 0x1A8,
193  Thumb = 0x1C2,
194  WceMipsV2 = 0x169
195 };
196 
197 /// These values correspond to the CV_call_e enumeration, and are documented
198 /// at the following locations:
199 /// https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
200 /// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx
201 ///
202 enum class PDB_CallingConv {
203  NearCdecl = 0x00,
204  FarCdecl = 0x01,
205  NearPascal = 0x02,
206  FarPascal = 0x03,
207  NearFastcall = 0x04,
208  FarFastcall = 0x05,
209  Skipped = 0x06,
210  NearStdcall = 0x07,
211  FarStdcall = 0x08,
212  NearSyscall = 0x09,
213  FarSyscall = 0x0a,
214  Thiscall = 0x0b,
215  MipsCall = 0x0c,
216  Generic = 0x0d,
217  Alphacall = 0x0e,
218  Ppccall = 0x0f,
219  SuperHCall = 0x10,
220  Armcall = 0x11,
221  AM33call = 0x12,
222  Tricall = 0x13,
223  Sh5call = 0x14,
224  M32R = 0x15,
225  Clrcall = 0x16,
226  Inline = 0x17,
227  NearVectorcall = 0x18,
228  Reserved = 0x19,
229 };
230 
231 /// These values correspond to the CV_CFL_LANG enumeration, and are documented
232 /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx
233 enum class PDB_Lang {
234  C = 0x00,
235  Cpp = 0x01,
236  Fortran = 0x02,
237  Masm = 0x03,
238  Pascal = 0x04,
239  Basic = 0x05,
240  Cobol = 0x06,
241  Link = 0x07,
242  Cvtres = 0x08,
243  Cvtpgd = 0x09,
244  CSharp = 0x0a,
245  VB = 0x0b,
246  ILAsm = 0x0c,
247  Java = 0x0d,
248  JScript = 0x0e,
249  MSIL = 0x0f,
250  HLSL = 0x10
251 };
252 
253 /// These values correspond to the DataKind enumeration, and are documented
254 /// here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx
255 enum class PDB_DataKind {
256  Unknown,
257  Local,
258  StaticLocal,
259  Param,
260  ObjectPtr,
261  FileStatic,
262  Global,
263  Member,
264  StaticMember,
265  Constant
266 };
267 
268 /// These values correspond to the SymTagEnum enumeration, and are documented
269 /// here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx
270 enum class PDB_SymType {
271  None,
272  Exe,
273  Compiland,
275  CompilandEnv,
276  Function,
277  Block,
278  Data,
279  Annotation,
280  Label,
281  PublicSymbol,
282  UDT,
283  Enum,
284  FunctionSig,
285  PointerType,
286  ArrayType,
287  BuiltinType,
288  Typedef,
289  BaseClass,
290  Friend,
291  FunctionArg,
293  FuncDebugEnd,
295  VTableShape,
296  VTable,
297  Custom,
298  Thunk,
299  CustomType,
300  ManagedType,
301  Dimension,
302  Max
303 };
304 
305 /// These values correspond to the LocationType enumeration, and are documented
306 /// here: https://msdn.microsoft.com/en-us/library/f57kaez3.aspx
307 enum class PDB_LocType {
308  Null,
309  Static,
310  TLS,
311  RegRel,
312  ThisRel,
313  Enregistered,
314  BitField,
315  Slot,
316  IlRel,
317  MetaData,
318  Constant,
319  Max
320 };
321 
322 /// These values correspond to the THUNK_ORDINAL enumeration, and are documented
323 /// here: https://msdn.microsoft.com/en-us/library/dh0k8hft.aspx
324 enum class PDB_ThunkOrdinal {
325  Standard,
326  ThisAdjustor,
327  Vcall,
328  Pcode,
329  UnknownLoad,
332 };
333 
334 /// These values correspond to the UdtKind enumeration, and are documented
335 /// here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx
337 
338 /// These values correspond to the StackFrameTypeEnum enumeration, and are
339 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
341 
342 /// These values correspond to the StackFrameTypeEnum enumeration, and are
343 /// documented here: https://msdn.microsoft.com/en-us/library/bc5207xw.aspx.
345 
346 /// These values correspond to the Basictype enumeration, and are documented
347 /// here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx
348 enum class PDB_BuiltinType {
349  None = 0,
350  Void = 1,
351  Char = 2,
352  WCharT = 3,
353  Int = 6,
354  UInt = 7,
355  Float = 8,
356  BCD = 9,
357  Bool = 10,
358  Long = 13,
359  ULong = 14,
360  Currency = 25,
361  Date = 26,
362  Variant = 27,
363  Complex = 28,
364  Bitfield = 29,
365  BSTR = 30,
366  HResult = 31
367 };
368 
369 enum class PDB_RegisterId {
370  Unknown = 0,
371  VFrame = 30006,
372  AL = 1,
373  CL = 2,
374  DL = 3,
375  BL = 4,
376  AH = 5,
377  CH = 6,
378  DH = 7,
379  BH = 8,
380  AX = 9,
381  CX = 10,
382  DX = 11,
383  BX = 12,
384  SP = 13,
385  BP = 14,
386  SI = 15,
387  DI = 16,
388  EAX = 17,
389  ECX = 18,
390  EDX = 19,
391  EBX = 20,
392  ESP = 21,
393  EBP = 22,
394  ESI = 23,
395  EDI = 24,
396  ES = 25,
397  CS = 26,
398  SS = 27,
399  DS = 28,
400  FS = 29,
401  GS = 30,
402  IP = 31,
403  RAX = 328,
404  RBX = 329,
405  RCX = 330,
406  RDX = 331,
407  RSI = 332,
408  RDI = 333,
409  RBP = 334,
410  RSP = 335,
411  R8 = 336,
412  R9 = 337,
413  R10 = 338,
414  R11 = 339,
415  R12 = 340,
416  R13 = 341,
417  R14 = 342,
418  R15 = 343,
419 };
420 
421 enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
422 
423 enum class PDB_ErrorCode {
424  Success,
425  NoPdbImpl,
426  InvalidPath,
430  UnknownError,
431  NoMemory,
433 };
434 
435 struct VersionInfo {
436  uint32_t Major;
437  uint32_t Minor;
438  uint32_t Build;
439  uint32_t QFE;
440 };
441 
444  Unknown,
456 };
457 
458 struct Variant {
461  }
462 
464  union {
465  bool Bool;
466  int8_t Int8;
467  int16_t Int16;
468  int32_t Int32;
469  int64_t Int64;
470  float Single;
471  double Double;
472  uint8_t UInt8;
473  uint16_t UInt16;
474  uint32_t UInt32;
475  uint64_t UInt64;
476  };
477 #define VARIANT_EQUAL_CASE(Enum) \
478  case PDB_VariantType::Enum: \
479  return Enum == Other.Enum;
480  bool operator==(const Variant &Other) const {
481  if (Type != Other.Type)
482  return false;
483  switch (Type) {
495  default:
496  return true;
497  }
498  }
499 #undef VARIANT_EQUAL_CASE
500  bool operator!=(const Variant &Other) const { return !(*this == Other); }
501 };
502 
503 } // namespace llvm
504 
505 namespace std {
506 template <> struct hash<llvm::PDB_SymType> {
508  typedef std::size_t result_type;
509 
511  return std::hash<int>()(static_cast<int>(Arg));
512  }
513 };
514 }
515 
516 #endif
bool operator==(const Variant &Other) const
Definition: PDBTypes.h:480
uint64_t HighPart
Definition: PDBTypes.h:76
uint32_t Build
Definition: PDBTypes.h:438
PDB_ReaderType
Specifies which PDB reader implementation is to be used.
Definition: PDBTypes.h:68
int32_t Int32
Definition: PDBTypes.h:468
PDB_Machine
Definition: PDBTypes.h:172
Defines a 128-bit unique identifier.
Definition: PDBTypes.h:75
PDB_BuiltinType
These values correspond to the Basictype enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/4szdtzc3.aspx.
Definition: PDBTypes.h:348
uint64_t LowPart
Definition: PDBTypes.h:77
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:591
PDB_DataKind
These values correspond to the DataKind enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/b2x2t313.aspx.
Definition: PDBTypes.h:255
uint8_t UInt8
Definition: PDBTypes.h:472
PDB_StackFrameType
These values correspond to the StackFrameTypeEnum enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:340
PDB_UdtType
These values correspond to the UdtKind enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/wcstk66t.aspx.
Definition: PDBTypes.h:336
PDB_MemoryType
These values correspond to the StackFrameTypeEnum enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:344
result_type operator()(const argument_type &Arg) const
Definition: PDBTypes.h:510
PDB_TableType
An enumeration indicating the type of data contained in this table.
Definition: PDBTypes.h:81
uint16_t UInt16
Definition: PDBTypes.h:473
PDB_LocType
These values correspond to the LocationType enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:307
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
Definition: PDBTypes.h:94
PDB_ErrorCode
Definition: PDBTypes.h:423
PDBSymbolCustom represents symbols that are compiler-specific and do not fit anywhere else in the lex...
uint32_t Major
Definition: PDBTypes.h:436
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
This is an important base class in LLVM.
Definition: Constant.h:41
PDB_RegisterId
Definition: PDBTypes.h:369
double Double
Definition: PDBTypes.h:471
#define VARIANT_EQUAL_CASE(Enum)
Definition: PDBTypes.h:477
PDB_CallingConv
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
Definition: PDBTypes.h:202
PDB_VariantType Type
Definition: PDBTypes.h:463
int8_t Int8
Definition: PDBTypes.h:466
uint64_t UInt64
Definition: PDBTypes.h:475
PDB_Cpu
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:110
int64_t Int64
Definition: PDBTypes.h:469
llvm::PDB_SymType argument_type
Definition: PDBTypes.h:507
PDB_Checksum
Specifies the hash algorithm that a source file from a PDB was hashed with.
Definition: PDBTypes.h:106
IPDBEnumChildren< IPDBSourceFile > IPDBEnumSourceFiles
Definition: PDBTypes.h:30
float Single
Definition: PDBTypes.h:470
uint32_t UInt32
Definition: PDBTypes.h:474
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
Definition: PDBTypes.h:270
PDB_ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration, and are documented here: https://msdn...
Definition: PDBTypes.h:324
IPDBEnumChildren< IPDBDataStream > IPDBEnumDataStreams
Definition: PDBTypes.h:31
PDB_Lang
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
Definition: PDBTypes.h:233
Definition: MD5.h:37
bool operator!=(const Variant &Other) const
Definition: PDBTypes.h:500
uint32_t Minor
Definition: PDBTypes.h:437
uint32_t QFE
Definition: PDBTypes.h:439
int16_t Int16
Definition: PDBTypes.h:467
PDB_MemberAccess
Definition: PDBTypes.h:421
IPDBEnumChildren< PDBSymbol > IPDBEnumSymbols
Definition: PDBTypes.h:27
PDB_VariantType
Definition: PDBTypes.h:442
IPDBSourceFile defines an interface used to represent source files whose information are stored in th...
IPDBEnumChildren< IPDBLineNumber > IPDBEnumLineNumbers
Definition: PDBTypes.h:32