PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/contrib/llvm/include/llvm/DebugInfo/CodeView/CodeView.h

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