CodeView.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- CodeView.h -----------------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Defines constants and basic types describing CodeView debug information.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
  18. #define LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
  19. #include <cinttypes>
  20. #include <type_traits>
  21. #include "llvm/Support/Endian.h"
  22. namespace llvm {
  23. namespace codeview {
  24. /// Distinguishes individual records in .debug$T or .debug$P section or PDB type
  25. /// stream. The documentation and headers talk about this as the "leaf" type.
  26. enum class TypeRecordKind : uint16_t {
  27. #define TYPE_RECORD(lf_ename, value, name) name = value,
  28. #include "CodeViewTypes.def"
  29. };
  30. /// Duplicate copy of the above enum, but using the official CV names. Useful
  31. /// for reference purposes and when dealing with unknown record types.
  32. enum TypeLeafKind : uint16_t {
  33. #define CV_TYPE(name, val) name = val,
  34. #include "CodeViewTypes.def"
  35. };
  36. /// Distinguishes individual records in the Symbols subsection of a .debug$S
  37. /// section. Equivalent to SYM_ENUM_e in cvinfo.h.
  38. enum class SymbolRecordKind : uint16_t {
  39. #define SYMBOL_RECORD(lf_ename, value, name) name = value,
  40. #include "CodeViewSymbols.def"
  41. };
  42. /// Duplicate copy of the above enum, but using the official CV names. Useful
  43. /// for reference purposes and when dealing with unknown record types.
  44. enum SymbolKind : uint16_t {
  45. #define CV_SYMBOL(name, val) name = val,
  46. #include "CodeViewSymbols.def"
  47. };
  48. #define CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(Class) \
  49. inline Class operator|(Class a, Class b) { \
  50. return static_cast<Class>( \
  51. static_cast<std::underlying_type<Class>::type>(a) | \
  52. static_cast<std::underlying_type<Class>::type>(b)); \
  53. } \
  54. inline Class operator&(Class a, Class b) { \
  55. return static_cast<Class>( \
  56. static_cast<std::underlying_type<Class>::type>(a) & \
  57. static_cast<std::underlying_type<Class>::type>(b)); \
  58. } \
  59. inline Class operator~(Class a) { \
  60. return static_cast<Class>( \
  61. ~static_cast<std::underlying_type<Class>::type>(a)); \
  62. } \
  63. inline Class &operator|=(Class &a, Class b) { \
  64. a = a | b; \
  65. return a; \
  66. } \
  67. inline Class &operator&=(Class &a, Class b) { \
  68. a = a & b; \
  69. return a; \
  70. }
  71. /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented
  72. /// here: https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
  73. enum class CPUType : uint16_t {
  74. Intel8080 = 0x0,
  75. Intel8086 = 0x1,
  76. Intel80286 = 0x2,
  77. Intel80386 = 0x3,
  78. Intel80486 = 0x4,
  79. Pentium = 0x5,
  80. PentiumPro = 0x6,
  81. Pentium3 = 0x7,
  82. MIPS = 0x10,
  83. MIPS16 = 0x11,
  84. MIPS32 = 0x12,
  85. MIPS64 = 0x13,
  86. MIPSI = 0x14,
  87. MIPSII = 0x15,
  88. MIPSIII = 0x16,
  89. MIPSIV = 0x17,
  90. MIPSV = 0x18,
  91. M68000 = 0x20,
  92. M68010 = 0x21,
  93. M68020 = 0x22,
  94. M68030 = 0x23,
  95. M68040 = 0x24,
  96. Alpha = 0x30,
  97. Alpha21164 = 0x31,
  98. Alpha21164A = 0x32,
  99. Alpha21264 = 0x33,
  100. Alpha21364 = 0x34,
  101. PPC601 = 0x40,
  102. PPC603 = 0x41,
  103. PPC604 = 0x42,
  104. PPC620 = 0x43,
  105. PPCFP = 0x44,
  106. PPCBE = 0x45,
  107. SH3 = 0x50,
  108. SH3E = 0x51,
  109. SH3DSP = 0x52,
  110. SH4 = 0x53,
  111. SHMedia = 0x54,
  112. ARM3 = 0x60,
  113. ARM4 = 0x61,
  114. ARM4T = 0x62,
  115. ARM5 = 0x63,
  116. ARM5T = 0x64,
  117. ARM6 = 0x65,
  118. ARM_XMAC = 0x66,
  119. ARM_WMMX = 0x67,
  120. ARM7 = 0x68,
  121. Omni = 0x70,
  122. Ia64 = 0x80,
  123. Ia64_2 = 0x81,
  124. CEE = 0x90,
  125. AM33 = 0xa0,
  126. M32R = 0xb0,
  127. TriCore = 0xc0,
  128. X64 = 0xd0,
  129. EBC = 0xe0,
  130. Thumb = 0xf0,
  131. ARMNT = 0xf4,
  132. ARM64 = 0xf6,
  133. HybridX86ARM64 = 0xf7,
  134. ARM64EC = 0xf8,
  135. ARM64X = 0xf9,
  136. D3D11_Shader = 0x100,
  137. };
  138. /// These values correspond to the CV_CFL_LANG enumeration, and are documented
  139. /// here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx
  140. enum SourceLanguage : uint8_t {
  141. C = 0x00,
  142. Cpp = 0x01,
  143. Fortran = 0x02,
  144. Masm = 0x03,
  145. Pascal = 0x04,
  146. Basic = 0x05,
  147. Cobol = 0x06,
  148. Link = 0x07,
  149. Cvtres = 0x08,
  150. Cvtpgd = 0x09,
  151. CSharp = 0x0a,
  152. VB = 0x0b,
  153. ILAsm = 0x0c,
  154. Java = 0x0d,
  155. JScript = 0x0e,
  156. MSIL = 0x0f,
  157. HLSL = 0x10,
  158. Rust = 0x15,
  159. /// The DMD & Swift compilers emit 'D' and 'S', respectively, for the CV
  160. /// source language. Microsoft does not have enumerators for them yet.
  161. D = 'D',
  162. Swift = 'S',
  163. };
  164. /// These values correspond to the CV_call_e enumeration, and are documented
  165. /// at the following locations:
  166. /// https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx
  167. /// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx
  168. ///
  169. enum class CallingConvention : uint8_t {
  170. NearC = 0x00, // near right to left push, caller pops stack
  171. FarC = 0x01, // far right to left push, caller pops stack
  172. NearPascal = 0x02, // near left to right push, callee pops stack
  173. FarPascal = 0x03, // far left to right push, callee pops stack
  174. NearFast = 0x04, // near left to right push with regs, callee pops stack
  175. FarFast = 0x05, // far left to right push with regs, callee pops stack
  176. NearStdCall = 0x07, // near standard call
  177. FarStdCall = 0x08, // far standard call
  178. NearSysCall = 0x09, // near sys call
  179. FarSysCall = 0x0a, // far sys call
  180. ThisCall = 0x0b, // this call (this passed in register)
  181. MipsCall = 0x0c, // Mips call
  182. Generic = 0x0d, // Generic call sequence
  183. AlphaCall = 0x0e, // Alpha call
  184. PpcCall = 0x0f, // PPC call
  185. SHCall = 0x10, // Hitachi SuperH call
  186. ArmCall = 0x11, // ARM call
  187. AM33Call = 0x12, // AM33 call
  188. TriCall = 0x13, // TriCore Call
  189. SH5Call = 0x14, // Hitachi SuperH-5 call
  190. M32RCall = 0x15, // M32R Call
  191. ClrCall = 0x16, // clr call
  192. Inline =
  193. 0x17, // Marker for routines always inlined and thus lacking a convention
  194. NearVector = 0x18 // near left to right push with regs, callee pops stack
  195. };
  196. enum class ClassOptions : uint16_t {
  197. None = 0x0000,
  198. Packed = 0x0001,
  199. HasConstructorOrDestructor = 0x0002,
  200. HasOverloadedOperator = 0x0004,
  201. Nested = 0x0008,
  202. ContainsNestedClass = 0x0010,
  203. HasOverloadedAssignmentOperator = 0x0020,
  204. HasConversionOperator = 0x0040,
  205. ForwardReference = 0x0080,
  206. Scoped = 0x0100,
  207. HasUniqueName = 0x0200,
  208. Sealed = 0x0400,
  209. Intrinsic = 0x2000
  210. };
  211. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(ClassOptions)
  212. enum class FrameProcedureOptions : uint32_t {
  213. None = 0x00000000,
  214. HasAlloca = 0x00000001,
  215. HasSetJmp = 0x00000002,
  216. HasLongJmp = 0x00000004,
  217. HasInlineAssembly = 0x00000008,
  218. HasExceptionHandling = 0x00000010,
  219. MarkedInline = 0x00000020,
  220. HasStructuredExceptionHandling = 0x00000040,
  221. Naked = 0x00000080,
  222. SecurityChecks = 0x00000100,
  223. AsynchronousExceptionHandling = 0x00000200,
  224. NoStackOrderingForSecurityChecks = 0x00000400,
  225. Inlined = 0x00000800,
  226. StrictSecurityChecks = 0x00001000,
  227. SafeBuffers = 0x00002000,
  228. EncodedLocalBasePointerMask = 0x0000C000,
  229. EncodedParamBasePointerMask = 0x00030000,
  230. ProfileGuidedOptimization = 0x00040000,
  231. ValidProfileCounts = 0x00080000,
  232. OptimizedForSpeed = 0x00100000,
  233. GuardCfg = 0x00200000,
  234. GuardCfw = 0x00400000
  235. };
  236. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(FrameProcedureOptions)
  237. enum class FunctionOptions : uint8_t {
  238. None = 0x00,
  239. CxxReturnUdt = 0x01,
  240. Constructor = 0x02,
  241. ConstructorWithVirtualBases = 0x04
  242. };
  243. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(FunctionOptions)
  244. enum class HfaKind : uint8_t {
  245. None = 0x00,
  246. Float = 0x01,
  247. Double = 0x02,
  248. Other = 0x03
  249. };
  250. /// Source-level access specifier. (CV_access_e)
  251. enum class MemberAccess : uint8_t {
  252. None = 0,
  253. Private = 1,
  254. Protected = 2,
  255. Public = 3
  256. };
  257. /// Part of member attribute flags. (CV_methodprop_e)
  258. enum class MethodKind : uint8_t {
  259. Vanilla = 0x00,
  260. Virtual = 0x01,
  261. Static = 0x02,
  262. Friend = 0x03,
  263. IntroducingVirtual = 0x04,
  264. PureVirtual = 0x05,
  265. PureIntroducingVirtual = 0x06
  266. };
  267. /// Equivalent to CV_fldattr_t bitfield.
  268. enum class MethodOptions : uint16_t {
  269. None = 0x0000,
  270. AccessMask = 0x0003,
  271. MethodKindMask = 0x001c,
  272. Pseudo = 0x0020,
  273. NoInherit = 0x0040,
  274. NoConstruct = 0x0080,
  275. CompilerGenerated = 0x0100,
  276. Sealed = 0x0200
  277. };
  278. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(MethodOptions)
  279. /// Equivalent to CV_LABEL_TYPE_e.
  280. enum class LabelType : uint16_t {
  281. Near = 0x0,
  282. Far = 0x4,
  283. };
  284. /// Equivalent to CV_modifier_t.
  285. /// TODO: Add flag for _Atomic modifier
  286. enum class ModifierOptions : uint16_t {
  287. None = 0x0000,
  288. Const = 0x0001,
  289. Volatile = 0x0002,
  290. Unaligned = 0x0004
  291. };
  292. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(ModifierOptions)
  293. // If the subsection kind has this bit set, then the linker should ignore it.
  294. enum : uint32_t { SubsectionIgnoreFlag = 0x80000000 };
  295. enum class DebugSubsectionKind : uint32_t {
  296. None = 0,
  297. Symbols = 0xf1,
  298. Lines = 0xf2,
  299. StringTable = 0xf3,
  300. FileChecksums = 0xf4,
  301. FrameData = 0xf5,
  302. InlineeLines = 0xf6,
  303. CrossScopeImports = 0xf7,
  304. CrossScopeExports = 0xf8,
  305. // These appear to relate to .Net assembly info.
  306. ILLines = 0xf9,
  307. FuncMDTokenMap = 0xfa,
  308. TypeMDTokenMap = 0xfb,
  309. MergedAssemblyInput = 0xfc,
  310. CoffSymbolRVA = 0xfd,
  311. };
  312. /// Equivalent to CV_ptrtype_e.
  313. enum class PointerKind : uint8_t {
  314. Near16 = 0x00, // 16 bit pointer
  315. Far16 = 0x01, // 16:16 far pointer
  316. Huge16 = 0x02, // 16:16 huge pointer
  317. BasedOnSegment = 0x03, // based on segment
  318. BasedOnValue = 0x04, // based on value of base
  319. BasedOnSegmentValue = 0x05, // based on segment value of base
  320. BasedOnAddress = 0x06, // based on address of base
  321. BasedOnSegmentAddress = 0x07, // based on segment address of base
  322. BasedOnType = 0x08, // based on type
  323. BasedOnSelf = 0x09, // based on self
  324. Near32 = 0x0a, // 32 bit pointer
  325. Far32 = 0x0b, // 16:32 pointer
  326. Near64 = 0x0c // 64 bit pointer
  327. };
  328. /// Equivalent to CV_ptrmode_e.
  329. enum class PointerMode : uint8_t {
  330. Pointer = 0x00, // "normal" pointer
  331. LValueReference = 0x01, // "old" reference
  332. PointerToDataMember = 0x02, // pointer to data member
  333. PointerToMemberFunction = 0x03, // pointer to member function
  334. RValueReference = 0x04 // r-value reference
  335. };
  336. /// Equivalent to misc lfPointerAttr bitfields.
  337. enum class PointerOptions : uint32_t {
  338. None = 0x00000000,
  339. Flat32 = 0x00000100,
  340. Volatile = 0x00000200,
  341. Const = 0x00000400,
  342. Unaligned = 0x00000800,
  343. Restrict = 0x00001000,
  344. WinRTSmartPointer = 0x00080000,
  345. LValueRefThisPointer = 0x00100000,
  346. RValueRefThisPointer = 0x00200000
  347. };
  348. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(PointerOptions)
  349. /// Equivalent to CV_pmtype_e.
  350. enum class PointerToMemberRepresentation : uint16_t {
  351. Unknown = 0x00, // not specified (pre VC8)
  352. SingleInheritanceData = 0x01, // member data, single inheritance
  353. MultipleInheritanceData = 0x02, // member data, multiple inheritance
  354. VirtualInheritanceData = 0x03, // member data, virtual inheritance
  355. GeneralData = 0x04, // member data, most general
  356. SingleInheritanceFunction = 0x05, // member function, single inheritance
  357. MultipleInheritanceFunction = 0x06, // member function, multiple inheritance
  358. VirtualInheritanceFunction = 0x07, // member function, virtual inheritance
  359. GeneralFunction = 0x08 // member function, most general
  360. };
  361. enum class VFTableSlotKind : uint8_t {
  362. Near16 = 0x00,
  363. Far16 = 0x01,
  364. This = 0x02,
  365. Outer = 0x03,
  366. Meta = 0x04,
  367. Near = 0x05,
  368. Far = 0x06
  369. };
  370. enum class WindowsRTClassKind : uint8_t {
  371. None = 0x00,
  372. RefClass = 0x01,
  373. ValueClass = 0x02,
  374. Interface = 0x03
  375. };
  376. /// Corresponds to CV_LVARFLAGS bitfield.
  377. enum class LocalSymFlags : uint16_t {
  378. None = 0,
  379. IsParameter = 1 << 0,
  380. IsAddressTaken = 1 << 1,
  381. IsCompilerGenerated = 1 << 2,
  382. IsAggregate = 1 << 3,
  383. IsAggregated = 1 << 4,
  384. IsAliased = 1 << 5,
  385. IsAlias = 1 << 6,
  386. IsReturnValue = 1 << 7,
  387. IsOptimizedOut = 1 << 8,
  388. IsEnregisteredGlobal = 1 << 9,
  389. IsEnregisteredStatic = 1 << 10,
  390. };
  391. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(LocalSymFlags)
  392. /// Corresponds to the CV_PUBSYMFLAGS bitfield.
  393. enum class PublicSymFlags : uint32_t {
  394. None = 0,
  395. Code = 1 << 0,
  396. Function = 1 << 1,
  397. Managed = 1 << 2,
  398. MSIL = 1 << 3,
  399. };
  400. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(PublicSymFlags)
  401. /// Corresponds to the CV_PROCFLAGS bitfield.
  402. enum class ProcSymFlags : uint8_t {
  403. None = 0,
  404. HasFP = 1 << 0,
  405. HasIRET = 1 << 1,
  406. HasFRET = 1 << 2,
  407. IsNoReturn = 1 << 3,
  408. IsUnreachable = 1 << 4,
  409. HasCustomCallingConv = 1 << 5,
  410. IsNoInline = 1 << 6,
  411. HasOptimizedDebugInfo = 1 << 7,
  412. };
  413. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(ProcSymFlags)
  414. /// Corresponds to COMPILESYM2::Flags bitfield.
  415. enum class CompileSym2Flags : uint32_t {
  416. None = 0,
  417. SourceLanguageMask = 0xFF,
  418. EC = 1 << 8,
  419. NoDbgInfo = 1 << 9,
  420. LTCG = 1 << 10,
  421. NoDataAlign = 1 << 11,
  422. ManagedPresent = 1 << 12,
  423. SecurityChecks = 1 << 13,
  424. HotPatch = 1 << 14,
  425. CVTCIL = 1 << 15,
  426. MSILModule = 1 << 16,
  427. };
  428. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(CompileSym2Flags)
  429. /// Corresponds to COMPILESYM3::Flags bitfield.
  430. enum class CompileSym3Flags : uint32_t {
  431. None = 0,
  432. SourceLanguageMask = 0xFF,
  433. EC = 1 << 8,
  434. NoDbgInfo = 1 << 9,
  435. LTCG = 1 << 10,
  436. NoDataAlign = 1 << 11,
  437. ManagedPresent = 1 << 12,
  438. SecurityChecks = 1 << 13,
  439. HotPatch = 1 << 14,
  440. CVTCIL = 1 << 15,
  441. MSILModule = 1 << 16,
  442. Sdl = 1 << 17,
  443. PGO = 1 << 18,
  444. Exp = 1 << 19,
  445. };
  446. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(CompileSym3Flags)
  447. enum class ExportFlags : uint16_t {
  448. None = 0,
  449. IsConstant = 1 << 0,
  450. IsData = 1 << 1,
  451. IsPrivate = 1 << 2,
  452. HasNoName = 1 << 3,
  453. HasExplicitOrdinal = 1 << 4,
  454. IsForwarder = 1 << 5
  455. };
  456. CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(ExportFlags)
  457. // Corresponds to BinaryAnnotationOpcode enum.
  458. enum class BinaryAnnotationsOpCode : uint32_t {
  459. Invalid,
  460. CodeOffset,
  461. ChangeCodeOffsetBase,
  462. ChangeCodeOffset,
  463. ChangeCodeLength,
  464. ChangeFile,
  465. ChangeLineOffset,
  466. ChangeLineEndDelta,
  467. ChangeRangeKind,
  468. ChangeColumnStart,
  469. ChangeColumnEndDelta,
  470. ChangeCodeOffsetAndLineOffset,
  471. ChangeCodeLengthAndCodeOffset,
  472. ChangeColumnEnd,
  473. };
  474. // Corresponds to CV_cookietype_e enum.
  475. enum class FrameCookieKind : uint8_t {
  476. Copy,
  477. XorStackPointer,
  478. XorFramePointer,
  479. XorR13,
  480. };
  481. // Corresponds to CV_HREG_e enum.
  482. enum class RegisterId : uint16_t {
  483. #define CV_REGISTERS_ALL
  484. #define CV_REGISTER(name, value) name = value,
  485. #include "CodeViewRegisters.def"
  486. #undef CV_REGISTER
  487. #undef CV_REGISTERS_ALL
  488. };
  489. // Register Ids are shared between architectures in CodeView. CPUType is needed
  490. // to map register Id to name.
  491. struct CPURegister {
  492. CPURegister() = delete;
  493. CPURegister(CPUType Cpu, codeview::RegisterId Reg) {
  494. this->Cpu = Cpu;
  495. this->Reg = Reg;
  496. }
  497. CPUType Cpu;
  498. RegisterId Reg;
  499. };
  500. /// Two-bit value indicating which register is the designated frame pointer
  501. /// register. Appears in the S_FRAMEPROC record flags.
  502. enum class EncodedFramePtrReg : uint8_t {
  503. None = 0,
  504. StackPtr = 1,
  505. FramePtr = 2,
  506. BasePtr = 3,
  507. };
  508. RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
  509. EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
  510. /// These values correspond to the THUNK_ORDINAL enumeration.
  511. enum class ThunkOrdinal : uint8_t {
  512. Standard,
  513. ThisAdjustor,
  514. Vcall,
  515. Pcode,
  516. UnknownLoad,
  517. TrampIncremental,
  518. BranchIsland
  519. };
  520. enum class TrampolineType : uint16_t { TrampIncremental, BranchIsland };
  521. // These values correspond to the CV_SourceChksum_t enumeration.
  522. enum class FileChecksumKind : uint8_t { None, MD5, SHA1, SHA256 };
  523. enum LineFlags : uint16_t {
  524. LF_None = 0,
  525. LF_HaveColumns = 1, // CV_LINES_HAVE_COLUMNS
  526. };
  527. /// Data in the SUBSEC_FRAMEDATA subection.
  528. struct FrameData {
  529. support::ulittle32_t RvaStart;
  530. support::ulittle32_t CodeSize;
  531. support::ulittle32_t LocalSize;
  532. support::ulittle32_t ParamsSize;
  533. support::ulittle32_t MaxStackSize;
  534. support::ulittle32_t FrameFunc;
  535. support::ulittle16_t PrologSize;
  536. support::ulittle16_t SavedRegsSize;
  537. support::ulittle32_t Flags;
  538. enum : uint32_t {
  539. HasSEH = 1 << 0,
  540. HasEH = 1 << 1,
  541. IsFunctionStart = 1 << 2,
  542. };
  543. };
  544. // Corresponds to LocalIdAndGlobalIdPair structure.
  545. // This structure information allows cross-referencing between PDBs. For
  546. // example, when a PDB is being built during compilation it is not yet known
  547. // what other modules may end up in the PDB at link time. So certain types of
  548. // IDs may clash between the various compile time PDBs. For each affected
  549. // module, a subsection would be put into the PDB containing a mapping from its
  550. // local IDs to a single ID namespace for all items in the PDB file.
  551. struct CrossModuleExport {
  552. support::ulittle32_t Local;
  553. support::ulittle32_t Global;
  554. };
  555. struct CrossModuleImport {
  556. support::ulittle32_t ModuleNameOffset;
  557. support::ulittle32_t Count; // Number of elements
  558. // support::ulittle32_t ids[Count]; // id from referenced module
  559. };
  560. enum class CodeViewContainer { ObjectFile, Pdb };
  561. inline uint32_t alignOf(CodeViewContainer Container) {
  562. if (Container == CodeViewContainer::ObjectFile)
  563. return 1;
  564. return 4;
  565. }
  566. }
  567. }
  568. #endif
  569. #ifdef __GNUC__
  570. #pragma GCC diagnostic pop
  571. #endif