CvInfo.cs 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435
  1. //-----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft. All rights reserved.
  4. // This code is licensed under the Microsoft Public License.
  5. // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
  6. // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
  7. // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
  8. // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
  9. //
  10. //-----------------------------------------------------------------------------
  11. //
  12. // File: CvInfo.cs
  13. //
  14. // Generic CodeView information definitions
  15. //
  16. // Structures, constants, etc. for accessing and interpreting
  17. // CodeView information.
  18. //
  19. // The master copy of this file resides in the langapi project (in C++).
  20. // All Microsoft projects are required to use the master copy without
  21. // modification. Modification of the master version or a copy
  22. // without consultation with all parties concerned is extremely
  23. // risky.
  24. //
  25. // When this file is modified, the corresponding documentation file
  26. // omfdeb.doc in the langapi project must be updated.
  27. //
  28. // This is a read-only copy of the C++ file converted to C#.
  29. //
  30. using System;
  31. namespace Microsoft.Cci.Pdb {
  32. internal struct FLOAT10 {
  33. internal byte Data_0;
  34. internal byte Data_1;
  35. internal byte Data_2;
  36. internal byte Data_3;
  37. internal byte Data_4;
  38. internal byte Data_5;
  39. internal byte Data_6;
  40. internal byte Data_7;
  41. internal byte Data_8;
  42. internal byte Data_9;
  43. };
  44. internal enum CV_SIGNATURE {
  45. C6=0, // Actual signature is >64K
  46. C7=1, // First explicit signature
  47. C11=2, // C11 (vc5.x) 32-bit types
  48. C13=4, // C13 (vc7.x) zero terminated names
  49. RESERVERD=5, // All signatures from 5 to 64K are reserved
  50. };
  51. // CodeView Symbol and Type OMF type information is broken up into two
  52. // ranges. Type indices less than 0x1000 describe type information
  53. // that is frequently used. Type indices above 0x1000 are used to
  54. // describe more complex features such as functions, arrays and
  55. // structures.
  56. //
  57. // Primitive types have predefined meaning that is encoded in the
  58. // values of the various bit fields in the value.
  59. //
  60. // A CodeView primitive type is defined as:
  61. //
  62. // 1 1
  63. // 1 089 7654 3 210
  64. // r mode type r sub
  65. //
  66. // Where
  67. // mode is the pointer mode
  68. // type is a type indicator
  69. // sub is a subtype enumeration
  70. // r is a reserved field
  71. //
  72. // See Microsoft Symbol and Type OMF (Version 4.0) for more
  73. // information.
  74. //
  75. // pointer mode enumeration values
  76. internal enum CV_prmode {
  77. CV_TM_DIRECT=0, // mode is not a pointer
  78. CV_TM_NPTR32=4, // mode is a 32 bit near pointer
  79. CV_TM_NPTR64=6, // mode is a 64 bit near pointer
  80. CV_TM_NPTR128=7, // mode is a 128 bit near pointer
  81. };
  82. // type enumeration values
  83. internal enum CV_type {
  84. CV_SPECIAL=0x00, // special type size values
  85. CV_SIGNED=0x01, // signed integral size values
  86. CV_UNSIGNED=0x02, // unsigned integral size values
  87. CV_BOOLEAN=0x03, // Boolean size values
  88. CV_REAL=0x04, // real number size values
  89. CV_COMPLEX=0x05, // complex number size values
  90. CV_SPECIAL2=0x06, // second set of special types
  91. CV_INT=0x07, // integral (int) values
  92. CV_CVRESERVED=0x0f,
  93. };
  94. // subtype enumeration values for CV_SPECIAL
  95. internal enum CV_special {
  96. CV_SP_NOTYPE=0x00,
  97. CV_SP_ABS=0x01,
  98. CV_SP_SEGMENT=0x02,
  99. CV_SP_VOID=0x03,
  100. CV_SP_CURRENCY=0x04,
  101. CV_SP_NBASICSTR=0x05,
  102. CV_SP_FBASICSTR=0x06,
  103. CV_SP_NOTTRANS=0x07,
  104. CV_SP_HRESULT=0x08,
  105. };
  106. // subtype enumeration values for CV_SPECIAL2
  107. internal enum CV_special2 {
  108. CV_S2_BIT=0x00,
  109. CV_S2_PASCHAR=0x01, // Pascal CHAR
  110. };
  111. // subtype enumeration values for CV_SIGNED, CV_UNSIGNED and CV_BOOLEAN
  112. internal enum CV_integral {
  113. CV_IN_1BYTE=0x00,
  114. CV_IN_2BYTE=0x01,
  115. CV_IN_4BYTE=0x02,
  116. CV_IN_8BYTE=0x03,
  117. CV_IN_16BYTE=0x04,
  118. };
  119. // subtype enumeration values for CV_REAL and CV_COMPLEX
  120. internal enum CV_real {
  121. CV_RC_REAL32=0x00,
  122. CV_RC_REAL64=0x01,
  123. CV_RC_REAL80=0x02,
  124. CV_RC_REAL128=0x03,
  125. };
  126. // subtype enumeration values for CV_INT (really int)
  127. internal enum CV_int {
  128. CV_RI_CHAR=0x00,
  129. CV_RI_INT1=0x00,
  130. CV_RI_WCHAR=0x01,
  131. CV_RI_UINT1=0x01,
  132. CV_RI_INT2=0x02,
  133. CV_RI_UINT2=0x03,
  134. CV_RI_INT4=0x04,
  135. CV_RI_UINT4=0x05,
  136. CV_RI_INT8=0x06,
  137. CV_RI_UINT8=0x07,
  138. CV_RI_INT16=0x08,
  139. CV_RI_UINT16=0x09,
  140. };
  141. internal struct CV_PRIMITIVE_TYPE {
  142. const uint CV_MMASK = 0x700; // mode mask
  143. const uint CV_TMASK = 0x0f0; // type mask
  144. const uint CV_SMASK = 0x00f; // subtype mask
  145. const int CV_MSHIFT = 8; // primitive mode right shift count
  146. const int CV_TSHIFT = 4; // primitive type right shift count
  147. const int CV_SSHIFT = 0; // primitive subtype right shift count
  148. // function to extract primitive mode, type and size
  149. //internal static CV_prmode CV_MODE(TYPE_ENUM typ) {
  150. // return (CV_prmode)((((uint)typ) & CV_MMASK) >> CV_MSHIFT);
  151. //}
  152. //internal static CV_type CV_TYPE(TYPE_ENUM typ) {
  153. // return (CV_type)((((uint)typ) & CV_TMASK) >> CV_TSHIFT);
  154. //}
  155. //internal static uint CV_SUBT(TYPE_ENUM typ) {
  156. // return ((((uint)typ) & CV_SMASK) >> CV_SSHIFT);
  157. //}
  158. // functions to check the type of a primitive
  159. //internal static bool CV_TYP_IS_DIRECT(TYPE_ENUM typ) {
  160. // return (CV_MODE(typ) == CV_prmode.CV_TM_DIRECT);
  161. //}
  162. //internal static bool CV_TYP_IS_PTR(TYPE_ENUM typ) {
  163. // return (CV_MODE(typ) != CV_prmode.CV_TM_DIRECT);
  164. //}
  165. //internal static bool CV_TYP_IS_SIGNED(TYPE_ENUM typ) {
  166. // return
  167. // (((CV_TYPE(typ) == CV_type.CV_SIGNED) && CV_TYP_IS_DIRECT(typ)) ||
  168. // (typ == TYPE_ENUM.T_INT1) ||
  169. // (typ == TYPE_ENUM.T_INT2) ||
  170. // (typ == TYPE_ENUM.T_INT4) ||
  171. // (typ == TYPE_ENUM.T_INT8) ||
  172. // (typ == TYPE_ENUM.T_INT16) ||
  173. // (typ == TYPE_ENUM.T_RCHAR));
  174. //}
  175. //internal static bool CV_TYP_IS_UNSIGNED(TYPE_ENUM typ) {
  176. // return (((CV_TYPE(typ) == CV_type.CV_UNSIGNED) && CV_TYP_IS_DIRECT(typ)) ||
  177. // (typ == TYPE_ENUM.T_UINT1) ||
  178. // (typ == TYPE_ENUM.T_UINT2) ||
  179. // (typ == TYPE_ENUM.T_UINT4) ||
  180. // (typ == TYPE_ENUM.T_UINT8) ||
  181. // (typ == TYPE_ENUM.T_UINT16));
  182. //}
  183. //internal static bool CV_TYP_IS_REAL(TYPE_ENUM typ) {
  184. // return ((CV_TYPE(typ) == CV_type.CV_REAL) && CV_TYP_IS_DIRECT(typ));
  185. //}
  186. const uint CV_FIRST_NONPRIM = 0x1000;
  187. //internal static bool CV_IS_PRIMITIVE(TYPE_ENUM typ) {
  188. // return ((uint)(typ) < CV_FIRST_NONPRIM);
  189. //}
  190. //internal static bool CV_TYP_IS_COMPLEX(TYPE_ENUM typ) {
  191. // return ((CV_TYPE(typ) == CV_type.CV_COMPLEX) && CV_TYP_IS_DIRECT(typ));
  192. //}
  193. //internal static bool CV_IS_INTERNAL_PTR(TYPE_ENUM typ) {
  194. // return (CV_IS_PRIMITIVE(typ) &&
  195. // CV_TYPE(typ) == CV_type.CV_CVRESERVED &&
  196. // CV_TYP_IS_PTR(typ));
  197. //}
  198. }
  199. // selected values for type_index - for a more complete definition, see
  200. // Microsoft Symbol and Type OMF document
  201. // Special Types
  202. internal enum TYPE_ENUM {
  203. // Special Types
  204. T_NOTYPE=0x0000, // uncharacterized type (no type)
  205. T_ABS=0x0001, // absolute symbol
  206. T_SEGMENT=0x0002, // segment type
  207. T_VOID=0x0003, // void
  208. T_HRESULT=0x0008, // OLE/COM HRESULT
  209. T_32PHRESULT=0x0408, // OLE/COM HRESULT __ptr32//
  210. T_64PHRESULT=0x0608, // OLE/COM HRESULT __ptr64//
  211. T_PVOID=0x0103, // near pointer to void
  212. T_PFVOID=0x0203, // far pointer to void
  213. T_PHVOID=0x0303, // huge pointer to void
  214. T_32PVOID=0x0403, // 32 bit pointer to void
  215. T_64PVOID=0x0603, // 64 bit pointer to void
  216. T_CURRENCY=0x0004, // BASIC 8 byte currency value
  217. T_NOTTRANS=0x0007, // type not translated by cvpack
  218. T_BIT=0x0060, // bit
  219. T_PASCHAR=0x0061, // Pascal CHAR
  220. // Character types
  221. T_CHAR=0x0010, // 8 bit signed
  222. T_32PCHAR=0x0410, // 32 bit pointer to 8 bit signed
  223. T_64PCHAR=0x0610, // 64 bit pointer to 8 bit signed
  224. T_UCHAR=0x0020, // 8 bit unsigned
  225. T_32PUCHAR=0x0420, // 32 bit pointer to 8 bit unsigned
  226. T_64PUCHAR=0x0620, // 64 bit pointer to 8 bit unsigned
  227. // really a character types
  228. T_RCHAR=0x0070, // really a char
  229. T_32PRCHAR=0x0470, // 32 bit pointer to a real char
  230. T_64PRCHAR=0x0670, // 64 bit pointer to a real char
  231. // really a wide character types
  232. T_WCHAR=0x0071, // wide char
  233. T_32PWCHAR=0x0471, // 32 bit pointer to a wide char
  234. T_64PWCHAR=0x0671, // 64 bit pointer to a wide char
  235. // 8 bit int types
  236. T_INT1=0x0068, // 8 bit signed int
  237. T_32PINT1=0x0468, // 32 bit pointer to 8 bit signed int
  238. T_64PINT1=0x0668, // 64 bit pointer to 8 bit signed int
  239. T_UINT1=0x0069, // 8 bit unsigned int
  240. T_32PUINT1=0x0469, // 32 bit pointer to 8 bit unsigned int
  241. T_64PUINT1=0x0669, // 64 bit pointer to 8 bit unsigned int
  242. // 16 bit short types
  243. T_SHORT=0x0011, // 16 bit signed
  244. T_32PSHORT=0x0411, // 32 bit pointer to 16 bit signed
  245. T_64PSHORT=0x0611, // 64 bit pointer to 16 bit signed
  246. T_USHORT=0x0021, // 16 bit unsigned
  247. T_32PUSHORT=0x0421, // 32 bit pointer to 16 bit unsigned
  248. T_64PUSHORT=0x0621, // 64 bit pointer to 16 bit unsigned
  249. // 16 bit int types
  250. T_INT2=0x0072, // 16 bit signed int
  251. T_32PINT2=0x0472, // 32 bit pointer to 16 bit signed int
  252. T_64PINT2=0x0672, // 64 bit pointer to 16 bit signed int
  253. T_UINT2=0x0073, // 16 bit unsigned int
  254. T_32PUINT2=0x0473, // 32 bit pointer to 16 bit unsigned int
  255. T_64PUINT2=0x0673, // 64 bit pointer to 16 bit unsigned int
  256. // 32 bit long types
  257. T_LONG=0x0012, // 32 bit signed
  258. T_ULONG=0x0022, // 32 bit unsigned
  259. T_32PLONG=0x0412, // 32 bit pointer to 32 bit signed
  260. T_32PULONG=0x0422, // 32 bit pointer to 32 bit unsigned
  261. T_64PLONG=0x0612, // 64 bit pointer to 32 bit signed
  262. T_64PULONG=0x0622, // 64 bit pointer to 32 bit unsigned
  263. // 32 bit int types
  264. T_INT4=0x0074, // 32 bit signed int
  265. T_32PINT4=0x0474, // 32 bit pointer to 32 bit signed int
  266. T_64PINT4=0x0674, // 64 bit pointer to 32 bit signed int
  267. T_UINT4=0x0075, // 32 bit unsigned int
  268. T_32PUINT4=0x0475, // 32 bit pointer to 32 bit unsigned int
  269. T_64PUINT4=0x0675, // 64 bit pointer to 32 bit unsigned int
  270. // 64 bit quad types
  271. T_QUAD=0x0013, // 64 bit signed
  272. T_32PQUAD=0x0413, // 32 bit pointer to 64 bit signed
  273. T_64PQUAD=0x0613, // 64 bit pointer to 64 bit signed
  274. T_UQUAD=0x0023, // 64 bit unsigned
  275. T_32PUQUAD=0x0423, // 32 bit pointer to 64 bit unsigned
  276. T_64PUQUAD=0x0623, // 64 bit pointer to 64 bit unsigned
  277. // 64 bit int types
  278. T_INT8=0x0076, // 64 bit signed int
  279. T_32PINT8=0x0476, // 32 bit pointer to 64 bit signed int
  280. T_64PINT8=0x0676, // 64 bit pointer to 64 bit signed int
  281. T_UINT8=0x0077, // 64 bit unsigned int
  282. T_32PUINT8=0x0477, // 32 bit pointer to 64 bit unsigned int
  283. T_64PUINT8=0x0677, // 64 bit pointer to 64 bit unsigned int
  284. // 128 bit octet types
  285. T_OCT=0x0014, // 128 bit signed
  286. T_32POCT=0x0414, // 32 bit pointer to 128 bit signed
  287. T_64POCT=0x0614, // 64 bit pointer to 128 bit signed
  288. T_UOCT=0x0024, // 128 bit unsigned
  289. T_32PUOCT=0x0424, // 32 bit pointer to 128 bit unsigned
  290. T_64PUOCT=0x0624, // 64 bit pointer to 128 bit unsigned
  291. // 128 bit int types
  292. T_INT16=0x0078, // 128 bit signed int
  293. T_32PINT16=0x0478, // 32 bit pointer to 128 bit signed int
  294. T_64PINT16=0x0678, // 64 bit pointer to 128 bit signed int
  295. T_UINT16=0x0079, // 128 bit unsigned int
  296. T_32PUINT16=0x0479, // 32 bit pointer to 128 bit unsigned int
  297. T_64PUINT16=0x0679, // 64 bit pointer to 128 bit unsigned int
  298. // 32 bit real types
  299. T_REAL32=0x0040, // 32 bit real
  300. T_32PREAL32=0x0440, // 32 bit pointer to 32 bit real
  301. T_64PREAL32=0x0640, // 64 bit pointer to 32 bit real
  302. // 64 bit real types
  303. T_REAL64=0x0041, // 64 bit real
  304. T_32PREAL64=0x0441, // 32 bit pointer to 64 bit real
  305. T_64PREAL64=0x0641, // 64 bit pointer to 64 bit real
  306. // 80 bit real types
  307. T_REAL80=0x0042, // 80 bit real
  308. T_32PREAL80=0x0442, // 32 bit pointer to 80 bit real
  309. T_64PREAL80=0x0642, // 64 bit pointer to 80 bit real
  310. // 128 bit real types
  311. T_REAL128=0x0043, // 128 bit real
  312. T_32PREAL128=0x0443, // 32 bit pointer to 128 bit real
  313. T_64PREAL128=0x0643, // 64 bit pointer to 128 bit real
  314. // 32 bit complex types
  315. T_CPLX32=0x0050, // 32 bit complex
  316. T_32PCPLX32=0x0450, // 32 bit pointer to 32 bit complex
  317. T_64PCPLX32=0x0650, // 64 bit pointer to 32 bit complex
  318. // 64 bit complex types
  319. T_CPLX64=0x0051, // 64 bit complex
  320. T_32PCPLX64=0x0451, // 32 bit pointer to 64 bit complex
  321. T_64PCPLX64=0x0651, // 64 bit pointer to 64 bit complex
  322. // 80 bit complex types
  323. T_CPLX80=0x0052, // 80 bit complex
  324. T_32PCPLX80=0x0452, // 32 bit pointer to 80 bit complex
  325. T_64PCPLX80=0x0652, // 64 bit pointer to 80 bit complex
  326. // 128 bit complex types
  327. T_CPLX128=0x0053, // 128 bit complex
  328. T_32PCPLX128=0x0453, // 32 bit pointer to 128 bit complex
  329. T_64PCPLX128=0x0653, // 64 bit pointer to 128 bit complex
  330. // boolean types
  331. T_BOOL08=0x0030, // 8 bit boolean
  332. T_32PBOOL08=0x0430, // 32 bit pointer to 8 bit boolean
  333. T_64PBOOL08=0x0630, // 64 bit pointer to 8 bit boolean
  334. T_BOOL16=0x0031, // 16 bit boolean
  335. T_32PBOOL16=0x0431, // 32 bit pointer to 18 bit boolean
  336. T_64PBOOL16=0x0631, // 64 bit pointer to 18 bit boolean
  337. T_BOOL32=0x0032, // 32 bit boolean
  338. T_32PBOOL32=0x0432, // 32 bit pointer to 32 bit boolean
  339. T_64PBOOL32=0x0632, // 64 bit pointer to 32 bit boolean
  340. T_BOOL64=0x0033, // 64 bit boolean
  341. T_32PBOOL64=0x0433, // 32 bit pointer to 64 bit boolean
  342. T_64PBOOL64=0x0633, // 64 bit pointer to 64 bit boolean
  343. };
  344. // No leaf index can have a value of 0x0000. The leaf indices are
  345. // separated into ranges depending upon the use of the type record.
  346. // The second range is for the type records that are directly referenced
  347. // in symbols. The first range is for type records that are not
  348. // referenced by symbols but instead are referenced by other type
  349. // records. All type records must have a starting leaf index in these
  350. // first two ranges. The third range of leaf indices are used to build
  351. // up complex lists such as the field list of a class type record. No
  352. // type record can begin with one of the leaf indices. The fourth ranges
  353. // of type indices are used to represent numeric data in a symbol or
  354. // type record. These leaf indices are greater than 0x8000. At the
  355. // point that type or symbol processor is expecting a numeric field, the
  356. // next two bytes in the type record are examined. If the value is less
  357. // than 0x8000, then the two bytes contain the numeric value. If the
  358. // value is greater than 0x8000, then the data follows the leaf index in
  359. // a format specified by the leaf index. The final range of leaf indices
  360. // are used to force alignment of subfields within a complex type record..
  361. //
  362. internal enum LEAF {
  363. // leaf indices starting records but referenced from symbol records
  364. LF_VTSHAPE=0x000a,
  365. LF_COBOL1=0x000c,
  366. LF_LABEL=0x000e,
  367. LF_NULL=0x000f,
  368. LF_NOTTRAN=0x0010,
  369. LF_ENDPRECOMP=0x0014, // not referenced from symbol
  370. LF_TYPESERVER_ST=0x0016, // not referenced from symbol
  371. // leaf indices starting records but referenced only from type records
  372. LF_LIST=0x0203,
  373. LF_REFSYM=0x020c,
  374. LF_ENUMERATE_ST=0x0403,
  375. // 32-bit type index versions of leaves, all have the 0x1000 bit set
  376. //
  377. LF_TI16_MAX=0x1000,
  378. LF_MODIFIER=0x1001,
  379. LF_POINTER=0x1002,
  380. LF_ARRAY_ST=0x1003,
  381. LF_CLASS_ST=0x1004,
  382. LF_STRUCTURE_ST=0x1005,
  383. LF_UNION_ST=0x1006,
  384. LF_ENUM_ST=0x1007,
  385. LF_PROCEDURE=0x1008,
  386. LF_MFUNCTION=0x1009,
  387. LF_COBOL0=0x100a,
  388. LF_BARRAY=0x100b,
  389. LF_DIMARRAY_ST=0x100c,
  390. LF_VFTPATH=0x100d,
  391. LF_PRECOMP_ST=0x100e, // not referenced from symbol
  392. LF_OEM=0x100f, // oem definable type string
  393. LF_ALIAS_ST=0x1010, // alias (typedef) type
  394. LF_OEM2=0x1011, // oem definable type string
  395. // leaf indices starting records but referenced only from type records
  396. LF_SKIP=0x1200,
  397. LF_ARGLIST=0x1201,
  398. LF_DEFARG_ST=0x1202,
  399. LF_FIELDLIST=0x1203,
  400. LF_DERIVED=0x1204,
  401. LF_BITFIELD=0x1205,
  402. LF_METHODLIST=0x1206,
  403. LF_DIMCONU=0x1207,
  404. LF_DIMCONLU=0x1208,
  405. LF_DIMVARU=0x1209,
  406. LF_DIMVARLU=0x120a,
  407. LF_BCLASS=0x1400,
  408. LF_VBCLASS=0x1401,
  409. LF_IVBCLASS=0x1402,
  410. LF_FRIENDFCN_ST=0x1403,
  411. LF_INDEX=0x1404,
  412. LF_MEMBER_ST=0x1405,
  413. LF_STMEMBER_ST=0x1406,
  414. LF_METHOD_ST=0x1407,
  415. LF_NESTTYPE_ST=0x1408,
  416. LF_VFUNCTAB=0x1409,
  417. LF_FRIENDCLS=0x140a,
  418. LF_ONEMETHOD_ST=0x140b,
  419. LF_VFUNCOFF=0x140c,
  420. LF_NESTTYPEEX_ST=0x140d,
  421. LF_MEMBERMODIFY_ST=0x140e,
  422. LF_MANAGED_ST=0x140f,
  423. // Types w/ SZ names
  424. LF_ST_MAX=0x1500,
  425. LF_TYPESERVER=0x1501, // not referenced from symbol
  426. LF_ENUMERATE=0x1502,
  427. LF_ARRAY=0x1503,
  428. LF_CLASS=0x1504,
  429. LF_STRUCTURE=0x1505,
  430. LF_UNION=0x1506,
  431. LF_ENUM=0x1507,
  432. LF_DIMARRAY=0x1508,
  433. LF_PRECOMP=0x1509, // not referenced from symbol
  434. LF_ALIAS=0x150a, // alias (typedef) type
  435. LF_DEFARG=0x150b,
  436. LF_FRIENDFCN=0x150c,
  437. LF_MEMBER=0x150d,
  438. LF_STMEMBER=0x150e,
  439. LF_METHOD=0x150f,
  440. LF_NESTTYPE=0x1510,
  441. LF_ONEMETHOD=0x1511,
  442. LF_NESTTYPEEX=0x1512,
  443. LF_MEMBERMODIFY=0x1513,
  444. LF_MANAGED=0x1514,
  445. LF_TYPESERVER2=0x1515,
  446. LF_NUMERIC=0x8000,
  447. LF_CHAR=0x8000,
  448. LF_SHORT=0x8001,
  449. LF_USHORT=0x8002,
  450. LF_LONG=0x8003,
  451. LF_ULONG=0x8004,
  452. LF_REAL32=0x8005,
  453. LF_REAL64=0x8006,
  454. LF_REAL80=0x8007,
  455. LF_REAL128=0x8008,
  456. LF_QUADWORD=0x8009,
  457. LF_UQUADWORD=0x800a,
  458. LF_COMPLEX32=0x800c,
  459. LF_COMPLEX64=0x800d,
  460. LF_COMPLEX80=0x800e,
  461. LF_COMPLEX128=0x800f,
  462. LF_VARSTRING=0x8010,
  463. LF_OCTWORD=0x8017,
  464. LF_UOCTWORD=0x8018,
  465. LF_DECIMAL=0x8019,
  466. LF_DATE=0x801a,
  467. LF_UTF8STRING=0x801b,
  468. LF_PAD0=0xf0,
  469. LF_PAD1=0xf1,
  470. LF_PAD2=0xf2,
  471. LF_PAD3=0xf3,
  472. LF_PAD4=0xf4,
  473. LF_PAD5=0xf5,
  474. LF_PAD6=0xf6,
  475. LF_PAD7=0xf7,
  476. LF_PAD8=0xf8,
  477. LF_PAD9=0xf9,
  478. LF_PAD10=0xfa,
  479. LF_PAD11=0xfb,
  480. LF_PAD12=0xfc,
  481. LF_PAD13=0xfd,
  482. LF_PAD14=0xfe,
  483. LF_PAD15=0xff,
  484. };
  485. // end of leaf indices
  486. // Type enum for pointer records
  487. // Pointers can be one of the following types
  488. internal enum CV_ptrtype {
  489. CV_PTR_BASE_SEG=0x03, // based on segment
  490. CV_PTR_BASE_VAL=0x04, // based on value of base
  491. CV_PTR_BASE_SEGVAL=0x05, // based on segment value of base
  492. CV_PTR_BASE_ADDR=0x06, // based on address of base
  493. CV_PTR_BASE_SEGADDR=0x07, // based on segment address of base
  494. CV_PTR_BASE_TYPE=0x08, // based on type
  495. CV_PTR_BASE_SELF=0x09, // based on self
  496. CV_PTR_NEAR32=0x0a, // 32 bit pointer
  497. CV_PTR_64=0x0c, // 64 bit pointer
  498. CV_PTR_UNUSEDPTR=0x0d // first unused pointer type
  499. };
  500. // Mode enum for pointers
  501. // Pointers can have one of the following modes
  502. internal enum CV_ptrmode {
  503. CV_PTR_MODE_PTR=0x00, // "normal" pointer
  504. CV_PTR_MODE_REF=0x01, // reference
  505. CV_PTR_MODE_PMEM=0x02, // pointer to data member
  506. CV_PTR_MODE_PMFUNC=0x03, // pointer to member function
  507. CV_PTR_MODE_RESERVED=0x04 // first unused pointer mode
  508. };
  509. // enumeration for pointer-to-member types
  510. internal enum CV_pmtype {
  511. CV_PMTYPE_Undef=0x00, // not specified (pre VC8)
  512. CV_PMTYPE_D_Single=0x01, // member data, single inheritance
  513. CV_PMTYPE_D_Multiple=0x02, // member data, multiple inheritance
  514. CV_PMTYPE_D_Virtual=0x03, // member data, virtual inheritance
  515. CV_PMTYPE_D_General=0x04, // member data, most general
  516. CV_PMTYPE_F_Single=0x05, // member function, single inheritance
  517. CV_PMTYPE_F_Multiple=0x06, // member function, multiple inheritance
  518. CV_PMTYPE_F_Virtual=0x07, // member function, virtual inheritance
  519. CV_PMTYPE_F_General=0x08, // member function, most general
  520. };
  521. // enumeration for method properties
  522. internal enum CV_methodprop {
  523. CV_MTvanilla=0x00,
  524. CV_MTvirtual=0x01,
  525. CV_MTstatic=0x02,
  526. CV_MTfriend=0x03,
  527. CV_MTintro=0x04,
  528. CV_MTpurevirt=0x05,
  529. CV_MTpureintro=0x06
  530. };
  531. // enumeration for virtual shape table entries
  532. internal enum CV_VTS_desc {
  533. CV_VTS_near=0x00,
  534. CV_VTS_far=0x01,
  535. CV_VTS_thin=0x02,
  536. CV_VTS_outer=0x03,
  537. CV_VTS_meta=0x04,
  538. CV_VTS_near32=0x05,
  539. CV_VTS_far32=0x06,
  540. CV_VTS_unused=0x07
  541. };
  542. // enumeration for LF_LABEL address modes
  543. internal enum CV_LABEL_TYPE {
  544. CV_LABEL_NEAR=0, // near return
  545. CV_LABEL_FAR=4 // far return
  546. };
  547. // enumeration for LF_MODIFIER values
  548. [Flags]
  549. internal enum CV_modifier : ushort {
  550. MOD_const=0x0001,
  551. MOD_volatile=0x0002,
  552. MOD_unaligned=0x0004,
  553. };
  554. // bit field structure describing class/struct/union/enum properties
  555. [Flags]
  556. internal enum CV_prop : ushort {
  557. packed=0x0001, // true if structure is packed
  558. ctor=0x0002, // true if constructors or destructors present
  559. ovlops=0x0004, // true if overloaded operators present
  560. isnested=0x0008, // true if this is a nested class
  561. cnested=0x0010, // true if this class contains nested types
  562. opassign=0x0020, // true if overloaded assignment (=)
  563. opcast=0x0040, // true if casting methods
  564. fwdref=0x0080, // true if forward reference (incomplete defn)
  565. scoped=0x0100, // scoped definition
  566. }
  567. // class field attribute
  568. [Flags]
  569. internal enum CV_fldattr {
  570. access=0x0003, // access protection CV_access_t
  571. mprop=0x001c, // method properties CV_methodprop_t
  572. pseudo=0x0020, // compiler generated fcn and does not exist
  573. noinherit=0x0040, // true if class cannot be inherited
  574. noconstruct=0x0080, // true if class cannot be constructed
  575. compgenx=0x0100, // compiler generated fcn and does exist
  576. }
  577. // Structures to access to the type records
  578. internal struct TYPTYPE {
  579. internal ushort len;
  580. internal ushort leaf;
  581. // byte data[];
  582. // char *NextType (char * pType) {
  583. // return (pType + ((TYPTYPE *)pType)->len + sizeof(ushort));
  584. // }
  585. }; // general types record
  586. // memory representation of pointer to member. These representations are
  587. // indexed by the enumeration above in the LF_POINTER record
  588. // representation of a 32 bit pointer to data for a class with
  589. // or without virtual functions and no virtual bases
  590. internal struct CV_PDMR32_NVVFCN {
  591. internal int mdisp; // displacement to data (NULL = 0x80000000)
  592. };
  593. // representation of a 32 bit pointer to data for a class
  594. // with virtual bases
  595. internal struct CV_PDMR32_VBASE {
  596. internal int mdisp; // displacement to data
  597. internal int pdisp; // this pointer displacement
  598. internal int vdisp; // vbase table displacement
  599. // NULL = (,,0xffffffff)
  600. };
  601. // representation of a 32 bit pointer to member function for a
  602. // class with no virtual bases and a single address point
  603. internal struct CV_PMFR32_NVSA {
  604. internal uint off; // near address of function (NULL = 0L)
  605. };
  606. // representation of a 32 bit pointer to member function for a
  607. // class with no virtual bases and multiple address points
  608. internal struct CV_PMFR32_NVMA {
  609. internal uint off; // near address of function (NULL = 0L,x)
  610. internal int disp;
  611. };
  612. // representation of a 32 bit pointer to member function for a
  613. // class with virtual bases
  614. internal struct CV_PMFR32_VBASE {
  615. internal uint off; // near address of function (NULL = 0L,x,x,x)
  616. internal int mdisp; // displacement to data
  617. internal int pdisp; // this pointer displacement
  618. internal int vdisp; // vbase table displacement
  619. };
  620. //////////////////////////////////////////////////////////////////////////////
  621. //
  622. // The following type records are basically variant records of the
  623. // above structure. The "ushort leaf" of the above structure and
  624. // the "ushort leaf" of the following type definitions are the same
  625. // symbol.
  626. //
  627. // Notes on alignment
  628. // Alignment of the fields in most of the type records is done on the
  629. // basis of the TYPTYPE record base. That is why in most of the lf*
  630. // records that the type is located on what appears to
  631. // be a offset mod 4 == 2 boundary. The exception to this rule are those
  632. // records that are in a list (lfFieldList, lfMethodList), which are
  633. // aligned to their own bases since they don't have the length field
  634. //
  635. // Type record for LF_MODIFIER
  636. internal struct LeafModifier {
  637. // internal ushort leaf; // LF_MODIFIER [TYPTYPE]
  638. internal uint type; // (type index) modified type
  639. internal CV_modifier attr; // modifier attribute modifier_t
  640. };
  641. // type record for LF_POINTER
  642. [Flags]
  643. internal enum LeafPointerAttr : uint {
  644. ptrtype=0x0000001f, // ordinal specifying pointer type (CV_ptrtype)
  645. ptrmode=0x000000e0, // ordinal specifying pointer mode (CV_ptrmode)
  646. isflat32=0x00000100, // true if 0:32 pointer
  647. isvolatile=0x00000200, // TRUE if volatile pointer
  648. isconst=0x00000400, // TRUE if const pointer
  649. isunaligned=0x00000800, // TRUE if unaligned pointer
  650. isrestrict=0x00001000, // TRUE if restricted pointer (allow agressive opts)
  651. };
  652. internal struct LeafPointer {
  653. internal struct LeafPointerBody {
  654. // internal ushort leaf; // LF_POINTER [TYPTYPE]
  655. internal uint utype; // (type index) type index of the underlying type
  656. internal LeafPointerAttr attr;
  657. };
  658. #if false
  659. union {
  660. internal struct {
  661. uint pmclass; // (type index) index of containing class for pointer to member
  662. ushort pmenum; // enumeration specifying pm format (CV_pmtype)
  663. };
  664. ushort bseg; // base segment if PTR_BASE_SEG
  665. byte[] Sym; // copy of base symbol record (including length)
  666. internal struct {
  667. uint index; // (type index) type index if CV_PTR_BASE_TYPE
  668. string name; // name of base type
  669. } btype;
  670. } pbase;
  671. #endif
  672. }
  673. // type record for LF_ARRAY
  674. internal struct LeafArray {
  675. // internal ushort leaf; // LF_ARRAY [TYPTYPE]
  676. internal uint elemtype; // (type index) type index of element type
  677. internal uint idxtype; // (type index) type index of indexing type
  678. internal byte[] data; // variable length data specifying size in bytes
  679. internal string name;
  680. };
  681. // type record for LF_CLASS, LF_STRUCTURE
  682. internal struct LeafClass {
  683. // internal ushort leaf; // LF_CLASS, LF_STRUCT [TYPTYPE]
  684. internal ushort count; // count of number of elements in class
  685. internal ushort property; // (CV_prop_t) property attribute field (prop_t)
  686. internal uint field; // (type index) type index of LF_FIELD descriptor list
  687. internal uint derived; // (type index) type index of derived from list if not zero
  688. internal uint vshape; // (type index) type index of vshape table for this class
  689. internal byte[] data; // data describing length of structure in bytes
  690. internal string name;
  691. };
  692. // type record for LF_UNION
  693. internal struct LeafUnion {
  694. // internal ushort leaf; // LF_UNION [TYPTYPE]
  695. internal ushort count; // count of number of elements in class
  696. internal ushort property; // (CV_prop_t) property attribute field
  697. internal uint field; // (type index) type index of LF_FIELD descriptor list
  698. internal byte[] data; // variable length data describing length of
  699. internal string name;
  700. };
  701. // type record for LF_ALIAS
  702. internal struct LeafAlias {
  703. // internal ushort leaf; // LF_ALIAS [TYPTYPE]
  704. internal uint utype; // (type index) underlying type
  705. internal string name; // alias name
  706. };
  707. // type record for LF_MANAGED
  708. internal struct LeafManaged {
  709. // internal ushort leaf; // LF_MANAGED [TYPTYPE]
  710. internal string name; // utf8, zero terminated managed type name
  711. };
  712. // type record for LF_ENUM
  713. internal struct LeafEnum {
  714. // internal ushort leaf; // LF_ENUM [TYPTYPE]
  715. internal ushort count; // count of number of elements in class
  716. internal ushort property; // (CV_propt_t) property attribute field
  717. internal uint utype; // (type index) underlying type of the enum
  718. internal uint field; // (type index) type index of LF_FIELD descriptor list
  719. internal string name; // length prefixed name of enum
  720. };
  721. // Type record for LF_PROCEDURE
  722. internal struct LeafProc {
  723. // internal ushort leaf; // LF_PROCEDURE [TYPTYPE]
  724. internal uint rvtype; // (type index) type index of return value
  725. internal byte calltype; // calling convention (CV_call_t)
  726. internal byte reserved; // reserved for future use
  727. internal ushort parmcount; // number of parameters
  728. internal uint arglist; // (type index) type index of argument list
  729. };
  730. // Type record for member function
  731. internal struct LeafMFunc {
  732. // internal ushort leaf; // LF_MFUNCTION [TYPTYPE]
  733. internal uint rvtype; // (type index) type index of return value
  734. internal uint classtype; // (type index) type index of containing class
  735. internal uint thistype; // (type index) type index of this pointer (model specific)
  736. internal byte calltype; // calling convention (call_t)
  737. internal byte reserved; // reserved for future use
  738. internal ushort parmcount; // number of parameters
  739. internal uint arglist; // (type index) type index of argument list
  740. internal int thisadjust; // this adjuster (long because pad required anyway)
  741. };
  742. // type record for virtual function table shape
  743. internal struct LeafVTShape {
  744. // internal ushort leaf; // LF_VTSHAPE [TYPTYPE]
  745. internal ushort count; // number of entries in vfunctable
  746. internal byte[] desc; // 4 bit (CV_VTS_desc) descriptors
  747. };
  748. // type record for cobol0
  749. internal struct LeafCobol0 {
  750. // internal ushort leaf; // LF_COBOL0 [TYPTYPE]
  751. internal uint type; // (type index) parent type record index
  752. internal byte[] data;
  753. };
  754. // type record for cobol1
  755. internal struct LeafCobol1 {
  756. // internal ushort leaf; // LF_COBOL1 [TYPTYPE]
  757. internal byte[] data;
  758. };
  759. // type record for basic array
  760. internal struct LeafBArray {
  761. // internal ushort leaf; // LF_BARRAY [TYPTYPE]
  762. internal uint utype; // (type index) type index of underlying type
  763. };
  764. // type record for assembler labels
  765. internal struct LeafLabel {
  766. // internal ushort leaf; // LF_LABEL [TYPTYPE]
  767. internal ushort mode; // addressing mode of label
  768. };
  769. // type record for dimensioned arrays
  770. internal struct LeafDimArray {
  771. // internal ushort leaf; // LF_DIMARRAY [TYPTYPE]
  772. internal uint utype; // (type index) underlying type of the array
  773. internal uint diminfo; // (type index) dimension information
  774. internal string name; // length prefixed name
  775. };
  776. // type record describing path to virtual function table
  777. internal struct LeafVFTPath {
  778. // internal ushort leaf; // LF_VFTPATH [TYPTYPE]
  779. internal uint count; // count of number of bases in path
  780. internal uint[] bases; // (type index) bases from root to leaf
  781. };
  782. // type record describing inclusion of precompiled types
  783. internal struct LeafPreComp {
  784. // internal ushort leaf; // LF_PRECOMP [TYPTYPE]
  785. internal uint start; // starting type index included
  786. internal uint count; // number of types in inclusion
  787. internal uint signature; // signature
  788. internal string name; // length prefixed name of included type file
  789. };
  790. // type record describing end of precompiled types that can be
  791. // included by another file
  792. internal struct LeafEndPreComp {
  793. // internal ushort leaf; // LF_ENDPRECOMP [TYPTYPE]
  794. internal uint signature; // signature
  795. };
  796. // type record for OEM definable type strings
  797. internal struct LeafOEM {
  798. // internal ushort leaf; // LF_OEM [TYPTYPE]
  799. internal ushort cvOEM; // MS assigned OEM identified
  800. internal ushort recOEM; // OEM assigned type identifier
  801. internal uint count; // count of type indices to follow
  802. internal uint[] index; // (type index) array of type indices followed
  803. // by OEM defined data
  804. };
  805. internal enum OEM_ID {
  806. OEM_MS_FORTRAN90=0xF090,
  807. OEM_ODI=0x0010,
  808. OEM_THOMSON_SOFTWARE=0x5453,
  809. OEM_ODI_REC_BASELIST=0x0000,
  810. };
  811. internal struct LeafOEM2 {
  812. // internal ushort leaf; // LF_OEM2 [TYPTYPE]
  813. internal Guid idOem; // an oem ID (Guid)
  814. internal uint count; // count of type indices to follow
  815. internal uint[] index; // (type index) array of type indices followed
  816. // by OEM defined data
  817. };
  818. // type record describing using of a type server
  819. internal struct LeafTypeServer {
  820. // internal ushort leaf; // LF_TYPESERVER [TYPTYPE]
  821. internal uint signature; // signature
  822. internal uint age; // age of database used by this module
  823. internal string name; // length prefixed name of PDB
  824. };
  825. // type record describing using of a type server with v7 (GUID) signatures
  826. internal struct LeafTypeServer2 {
  827. // internal ushort leaf; // LF_TYPESERVER2 [TYPTYPE]
  828. internal Guid sig70; // guid signature
  829. internal uint age; // age of database used by this module
  830. internal string name; // length prefixed name of PDB
  831. };
  832. // description of type records that can be referenced from
  833. // type records referenced by symbols
  834. // type record for skip record
  835. internal struct LeafSkip {
  836. // internal ushort leaf; // LF_SKIP [TYPTYPE]
  837. internal uint type; // (type index) next valid index
  838. internal byte[] data; // pad data
  839. };
  840. // argument list leaf
  841. internal struct LeafArgList {
  842. // internal ushort leaf; // LF_ARGLIST [TYPTYPE]
  843. internal uint count; // number of arguments
  844. internal uint[] arg; // (type index) number of arguments
  845. };
  846. // derived class list leaf
  847. internal struct LeafDerived {
  848. // internal ushort leaf; // LF_DERIVED [TYPTYPE]
  849. internal uint count; // number of arguments
  850. internal uint[] drvdcls; // (type index) type indices of derived classes
  851. };
  852. // leaf for default arguments
  853. internal struct LeafDefArg {
  854. // internal ushort leaf; // LF_DEFARG [TYPTYPE]
  855. internal uint type; // (type index) type of resulting expression
  856. internal byte[] expr; // length prefixed expression string
  857. };
  858. // list leaf
  859. // This list should no longer be used because the utilities cannot
  860. // verify the contents of the list without knowing what type of list
  861. // it is. New specific leaf indices should be used instead.
  862. internal struct LeafList {
  863. // internal ushort leaf; // LF_LIST [TYPTYPE]
  864. internal byte[] data; // data format specified by indexing type
  865. };
  866. // field list leaf
  867. // This is the header leaf for a complex list of class and structure
  868. // subfields.
  869. internal struct LeafFieldList {
  870. // internal ushort leaf; // LF_FIELDLIST [TYPTYPE]
  871. internal char[] data; // field list sub lists
  872. };
  873. // type record for non-static methods and friends in overloaded method list
  874. internal struct mlMethod {
  875. internal ushort attr; // (CV_fldattr_t) method attribute
  876. internal ushort pad0; // internal padding, must be 0
  877. internal uint index; // (type index) index to type record for procedure
  878. internal uint[] vbaseoff; // offset in vfunctable if intro virtual
  879. };
  880. internal struct LeafMethodList {
  881. // internal ushort leaf; // LF_METHODLIST [TYPTYPE]
  882. internal byte[] mList; // really a mlMethod type
  883. };
  884. // type record for LF_BITFIELD
  885. internal struct LeafBitfield {
  886. // internal ushort leaf; // LF_BITFIELD [TYPTYPE]
  887. internal uint type; // (type index) type of bitfield
  888. internal byte length;
  889. internal byte position;
  890. };
  891. // type record for dimensioned array with constant bounds
  892. internal struct LeafDimCon {
  893. // internal ushort leaf; // LF_DIMCONU or LF_DIMCONLU [TYPTYPE]
  894. internal uint typ; // (type index) type of index
  895. internal ushort rank; // number of dimensions
  896. internal byte[] dim; // array of dimension information with
  897. // either upper bounds or lower/upper bound
  898. };
  899. // type record for dimensioned array with variable bounds
  900. internal struct LeafDimVar {
  901. // internal ushort leaf; // LF_DIMVARU or LF_DIMVARLU [TYPTYPE]
  902. internal uint rank; // number of dimensions
  903. internal uint typ; // (type index) type of index
  904. internal uint[] dim; // (type index) array of type indices for either
  905. // variable upper bound or variable
  906. // lower/upper bound. The count of type
  907. // indices is rank or rank*2 depending on
  908. // whether it is LFDIMVARU or LF_DIMVARLU.
  909. // The referenced types must be
  910. // LF_REFSYM or T_VOID
  911. };
  912. // type record for referenced symbol
  913. internal struct LeafRefSym {
  914. // internal ushort leaf; // LF_REFSYM [TYPTYPE]
  915. internal byte[] Sym; // copy of referenced symbol record
  916. // (including length)
  917. };
  918. // the following are numeric leaves. They are used to indicate the
  919. // size of the following variable length data. When the numeric
  920. // data is a single byte less than 0x8000, then the data is output
  921. // directly. If the data is more the 0x8000 or is a negative value,
  922. // then the data is preceeded by the proper index.
  923. //
  924. // signed character leaf
  925. internal struct LeafChar {
  926. // internal ushort leaf; // LF_CHAR [TYPTYPE]
  927. internal sbyte val; // signed 8-bit value
  928. };
  929. // signed short leaf
  930. internal struct LeafShort {
  931. // internal ushort leaf; // LF_SHORT [TYPTYPE]
  932. internal short val; // signed 16-bit value
  933. };
  934. // ushort leaf
  935. internal struct LeafUShort {
  936. // internal ushort leaf; // LF_ushort [TYPTYPE]
  937. internal ushort val; // unsigned 16-bit value
  938. };
  939. // signed (32-bit) long leaf
  940. internal struct LeafLong {
  941. // internal ushort leaf; // LF_LONG [TYPTYPE]
  942. internal int val; // signed 32-bit value
  943. };
  944. // uint leaf
  945. internal struct LeafULong {
  946. // internal ushort leaf; // LF_ULONG [TYPTYPE]
  947. internal uint val; // unsigned 32-bit value
  948. };
  949. // signed quad leaf
  950. internal struct LeafQuad {
  951. // internal ushort leaf; // LF_QUAD [TYPTYPE]
  952. internal long val; // signed 64-bit value
  953. };
  954. // unsigned quad leaf
  955. internal struct LeafUQuad {
  956. // internal ushort leaf; // LF_UQUAD [TYPTYPE]
  957. internal ulong val; // unsigned 64-bit value
  958. };
  959. // signed int128 leaf
  960. internal struct LeafOct {
  961. // internal ushort leaf; // LF_OCT [TYPTYPE]
  962. internal ulong val0;
  963. internal ulong val1; // signed 128-bit value
  964. };
  965. // unsigned int128 leaf
  966. internal struct LeafUOct {
  967. // internal ushort leaf; // LF_UOCT [TYPTYPE]
  968. internal ulong val0;
  969. internal ulong val1; // unsigned 128-bit value
  970. };
  971. // real 32-bit leaf
  972. internal struct LeafReal32 {
  973. // internal ushort leaf; // LF_REAL32 [TYPTYPE]
  974. internal float val; // 32-bit real value
  975. };
  976. // real 64-bit leaf
  977. internal struct LeafReal64 {
  978. // internal ushort leaf; // LF_REAL64 [TYPTYPE]
  979. internal double val; // 64-bit real value
  980. };
  981. // real 80-bit leaf
  982. internal struct LeafReal80 {
  983. // internal ushort leaf; // LF_REAL80 [TYPTYPE]
  984. internal FLOAT10 val; // real 80-bit value
  985. };
  986. // real 128-bit leaf
  987. internal struct LeafReal128 {
  988. // internal ushort leaf; // LF_REAL128 [TYPTYPE]
  989. internal ulong val0;
  990. internal ulong val1; // real 128-bit value
  991. };
  992. // complex 32-bit leaf
  993. internal struct LeafCmplx32 {
  994. // internal ushort leaf; // LF_COMPLEX32 [TYPTYPE]
  995. internal float val_real; // real component
  996. internal float val_imag; // imaginary component
  997. };
  998. // complex 64-bit leaf
  999. internal struct LeafCmplx64 {
  1000. // internal ushort leaf; // LF_COMPLEX64 [TYPTYPE]
  1001. internal double val_real; // real component
  1002. internal double val_imag; // imaginary component
  1003. };
  1004. // complex 80-bit leaf
  1005. internal struct LeafCmplx80 {
  1006. // internal ushort leaf; // LF_COMPLEX80 [TYPTYPE]
  1007. internal FLOAT10 val_real; // real component
  1008. internal FLOAT10 val_imag; // imaginary component
  1009. };
  1010. // complex 128-bit leaf
  1011. internal struct LeafCmplx128 {
  1012. // internal ushort leaf; // LF_COMPLEX128 [TYPTYPE]
  1013. internal ulong val0_real;
  1014. internal ulong val1_real; // real component
  1015. internal ulong val0_imag;
  1016. internal ulong val1_imag; // imaginary component
  1017. };
  1018. // variable length numeric field
  1019. internal struct LeafVarString {
  1020. // internal ushort leaf; // LF_VARSTRING [TYPTYPE]
  1021. internal ushort len; // length of value in bytes
  1022. internal byte[] value; // value
  1023. };
  1024. // index leaf - contains type index of another leaf
  1025. // a major use of this leaf is to allow the compilers to emit a
  1026. // long complex list (LF_FIELD) in smaller pieces.
  1027. internal struct LeafIndex {
  1028. // internal ushort leaf; // LF_INDEX [TYPTYPE]
  1029. internal ushort pad0; // internal padding, must be 0
  1030. internal uint index; // (type index) type index of referenced leaf
  1031. };
  1032. // subfield record for base class field
  1033. internal struct LeafBClass {
  1034. // internal ushort leaf; // LF_BCLASS [TYPTYPE]
  1035. internal ushort attr; // (CV_fldattr_t) attribute
  1036. internal uint index; // (type index) type index of base class
  1037. internal byte[] offset; // variable length offset of base within class
  1038. };
  1039. // subfield record for direct and indirect virtual base class field
  1040. internal struct LeafVBClass {
  1041. // internal ushort leaf; // LF_VBCLASS | LV_IVBCLASS [TYPTYPE]
  1042. internal ushort attr; // (CV_fldattr_t) attribute
  1043. internal uint index; // (type index) type index of direct virtual base class
  1044. internal uint vbptr; // (type index) type index of virtual base pointer
  1045. internal byte[] vbpoff; // virtual base pointer offset from address point
  1046. // followed by virtual base offset from vbtable
  1047. };
  1048. // subfield record for friend class
  1049. internal struct LeafFriendCls {
  1050. // internal ushort leaf; // LF_FRIENDCLS [TYPTYPE]
  1051. internal ushort pad0; // internal padding, must be 0
  1052. internal uint index; // (type index) index to type record of friend class
  1053. };
  1054. // subfield record for friend function
  1055. internal struct LeafFriendFcn {
  1056. // internal ushort leaf; // LF_FRIENDFCN [TYPTYPE]
  1057. internal ushort pad0; // internal padding, must be 0
  1058. internal uint index; // (type index) index to type record of friend function
  1059. internal string name; // name of friend function
  1060. };
  1061. // subfield record for non-static data members
  1062. internal struct LeafMember {
  1063. // internal ushort leaf; // LF_MEMBER [TYPTYPE]
  1064. internal ushort attr; // (CV_fldattr_t)attribute mask
  1065. internal uint index; // (type index) index of type record for field
  1066. internal byte[] offset; // variable length offset of field
  1067. internal string name; // length prefixed name of field
  1068. };
  1069. // type record for static data members
  1070. internal struct LeafSTMember {
  1071. // internal ushort leaf; // LF_STMEMBER [TYPTYPE]
  1072. internal ushort attr; // (CV_fldattr_t) attribute mask
  1073. internal uint index; // (type index) index of type record for field
  1074. internal string name; // length prefixed name of field
  1075. };
  1076. // subfield record for virtual function table pointer
  1077. internal struct LeafVFuncTab {
  1078. // internal ushort leaf; // LF_VFUNCTAB [TYPTYPE]
  1079. internal ushort pad0; // internal padding, must be 0
  1080. internal uint type; // (type index) type index of pointer
  1081. };
  1082. // subfield record for virtual function table pointer with offset
  1083. internal struct LeafVFuncOff {
  1084. // internal ushort leaf; // LF_VFUNCOFF [TYPTYPE]
  1085. internal ushort pad0; // internal padding, must be 0.
  1086. internal uint type; // (type index) type index of pointer
  1087. internal int offset; // offset of virtual function table pointer
  1088. };
  1089. // subfield record for overloaded method list
  1090. internal struct LeafMethod {
  1091. // internal ushort leaf; // LF_METHOD [TYPTYPE]
  1092. internal ushort count; // number of occurrences of function
  1093. internal uint mList; // (type index) index to LF_METHODLIST record
  1094. internal string name; // length prefixed name of method
  1095. };
  1096. // subfield record for nonoverloaded method
  1097. internal struct LeafOneMethod {
  1098. // internal ushort leaf; // LF_ONEMETHOD [TYPTYPE]
  1099. internal ushort attr; // (CV_fldattr_t) method attribute
  1100. internal uint index; // (type index) index to type record for procedure
  1101. internal uint[] vbaseoff; // offset in vfunctable if intro virtual
  1102. internal string name;
  1103. };
  1104. // subfield record for enumerate
  1105. internal struct LeafEnumerate {
  1106. // internal ushort leaf; // LF_ENUMERATE [TYPTYPE]
  1107. internal ushort attr; // (CV_fldattr_t) access
  1108. internal byte[] value; // variable length value field
  1109. internal string name;
  1110. };
  1111. // type record for nested (scoped) type definition
  1112. internal struct LeafNestType {
  1113. // internal ushort leaf; // LF_NESTTYPE [TYPTYPE]
  1114. internal ushort pad0; // internal padding, must be 0
  1115. internal uint index; // (type index) index of nested type definition
  1116. internal string name; // length prefixed type name
  1117. };
  1118. // type record for nested (scoped) type definition, with attributes
  1119. // new records for vC v5.0, no need to have 16-bit ti versions.
  1120. internal struct LeafNestTypeEx {
  1121. // internal ushort leaf; // LF_NESTTYPEEX [TYPTYPE]
  1122. internal ushort attr; // (CV_fldattr_t) member access
  1123. internal uint index; // (type index) index of nested type definition
  1124. internal string name; // length prefixed type name
  1125. };
  1126. // type record for modifications to members
  1127. internal struct LeafMemberModify {
  1128. // internal ushort leaf; // LF_MEMBERMODIFY [TYPTYPE]
  1129. internal ushort attr; // (CV_fldattr_t) the new attributes
  1130. internal uint index; // (type index) index of base class type definition
  1131. internal string name; // length prefixed member name
  1132. };
  1133. // type record for pad leaf
  1134. internal struct LeafPad {
  1135. internal byte leaf;
  1136. };
  1137. // Symbol definitions
  1138. internal enum SYM {
  1139. S_END=0x0006, // Block, procedure, "with" or thunk end
  1140. S_OEM=0x0404, // OEM defined symbol
  1141. S_REGISTER_ST=0x1001, // Register variable
  1142. S_CONSTANT_ST=0x1002, // constant symbol
  1143. S_UDT_ST=0x1003, // User defined type
  1144. S_COBOLUDT_ST=0x1004, // special UDT for cobol that does not symbol pack
  1145. S_MANYREG_ST=0x1005, // multiple register variable
  1146. S_BPREL32_ST=0x1006, // BP-relative
  1147. S_LDATA32_ST=0x1007, // Module-local symbol
  1148. S_GDATA32_ST=0x1008, // Global data symbol
  1149. S_PUB32_ST=0x1009, // a internal symbol (CV internal reserved)
  1150. S_LPROC32_ST=0x100a, // Local procedure start
  1151. S_GPROC32_ST=0x100b, // Global procedure start
  1152. S_VFTABLE32=0x100c, // address of virtual function table
  1153. S_REGREL32_ST=0x100d, // register relative address
  1154. S_LTHREAD32_ST=0x100e, // local thread storage
  1155. S_GTHREAD32_ST=0x100f, // global thread storage
  1156. S_LPROCMIPS_ST=0x1010, // Local procedure start
  1157. S_GPROCMIPS_ST=0x1011, // Global procedure start
  1158. // new symbol records for edit and continue information
  1159. S_FRAMEPROC=0x1012, // extra frame and proc information
  1160. S_COMPILE2_ST=0x1013, // extended compile flags and info
  1161. // new symbols necessary for 16-bit enumerates of IA64 registers
  1162. // and IA64 specific symbols
  1163. S_MANYREG2_ST=0x1014, // multiple register variable
  1164. S_LPROCIA64_ST=0x1015, // Local procedure start (IA64)
  1165. S_GPROCIA64_ST=0x1016, // Global procedure start (IA64)
  1166. // Local symbols for IL
  1167. S_LOCALSLOT_ST=0x1017, // local IL sym with field for local slot index
  1168. S_PARAMSLOT_ST=0x1018, // local IL sym with field for parameter slot index
  1169. S_ANNOTATION=0x1019, // Annotation string literals
  1170. // symbols to support managed code debugging
  1171. S_GMANPROC_ST=0x101a, // Global proc
  1172. S_LMANPROC_ST=0x101b, // Local proc
  1173. S_RESERVED1=0x101c, // reserved
  1174. S_RESERVED2=0x101d, // reserved
  1175. S_RESERVED3=0x101e, // reserved
  1176. S_RESERVED4=0x101f, // reserved
  1177. S_LMANDATA_ST=0x1020,
  1178. S_GMANDATA_ST=0x1021,
  1179. S_MANFRAMEREL_ST=0x1022,
  1180. S_MANREGISTER_ST=0x1023,
  1181. S_MANSLOT_ST=0x1024,
  1182. S_MANMANYREG_ST=0x1025,
  1183. S_MANREGREL_ST=0x1026,
  1184. S_MANMANYREG2_ST=0x1027,
  1185. S_MANTYPREF=0x1028, // Index for type referenced by name from metadata
  1186. S_UNAMESPACE_ST=0x1029, // Using namespace
  1187. // Symbols w/ SZ name fields. All name fields contain utf8 encoded strings.
  1188. S_ST_MAX=0x1100, // starting point for SZ name symbols
  1189. S_OBJNAME=0x1101, // path to object file name
  1190. S_THUNK32=0x1102, // Thunk Start
  1191. S_BLOCK32=0x1103, // block start
  1192. S_WITH32=0x1104, // with start
  1193. S_LABEL32=0x1105, // code label
  1194. S_REGISTER=0x1106, // Register variable
  1195. S_CONSTANT=0x1107, // constant symbol
  1196. S_UDT=0x1108, // User defined type
  1197. S_COBOLUDT=0x1109, // special UDT for cobol that does not symbol pack
  1198. S_MANYREG=0x110a, // multiple register variable
  1199. S_BPREL32=0x110b, // BP-relative
  1200. S_LDATA32=0x110c, // Module-local symbol
  1201. S_GDATA32=0x110d, // Global data symbol
  1202. S_PUB32=0x110e, // a internal symbol (CV internal reserved)
  1203. S_LPROC32=0x110f, // Local procedure start
  1204. S_GPROC32=0x1110, // Global procedure start
  1205. S_REGREL32=0x1111, // register relative address
  1206. S_LTHREAD32=0x1112, // local thread storage
  1207. S_GTHREAD32=0x1113, // global thread storage
  1208. S_LPROCMIPS=0x1114, // Local procedure start
  1209. S_GPROCMIPS=0x1115, // Global procedure start
  1210. S_COMPILE2=0x1116, // extended compile flags and info
  1211. S_MANYREG2=0x1117, // multiple register variable
  1212. S_LPROCIA64=0x1118, // Local procedure start (IA64)
  1213. S_GPROCIA64=0x1119, // Global procedure start (IA64)
  1214. S_LOCALSLOT=0x111a, // local IL sym with field for local slot index
  1215. S_SLOT=S_LOCALSLOT, // alias for LOCALSLOT
  1216. S_PARAMSLOT=0x111b, // local IL sym with field for parameter slot index
  1217. // symbols to support managed code debugging
  1218. S_LMANDATA=0x111c,
  1219. S_GMANDATA=0x111d,
  1220. S_MANFRAMEREL=0x111e,
  1221. S_MANREGISTER=0x111f,
  1222. S_MANSLOT=0x1120,
  1223. S_MANMANYREG=0x1121,
  1224. S_MANREGREL=0x1122,
  1225. S_MANMANYREG2=0x1123,
  1226. S_UNAMESPACE=0x1124, // Using namespace
  1227. // ref symbols with name fields
  1228. S_PROCREF=0x1125, // Reference to a procedure
  1229. S_DATAREF=0x1126, // Reference to data
  1230. S_LPROCREF=0x1127, // Local Reference to a procedure
  1231. S_ANNOTATIONREF=0x1128, // Reference to an S_ANNOTATION symbol
  1232. S_TOKENREF=0x1129, // Reference to one of the many MANPROCSYM's
  1233. // continuation of managed symbols
  1234. S_GMANPROC=0x112a, // Global proc
  1235. S_LMANPROC=0x112b, // Local proc
  1236. // short, light-weight thunks
  1237. S_TRAMPOLINE=0x112c, // trampoline thunks
  1238. S_MANCONSTANT=0x112d, // constants with metadata type info
  1239. // native attributed local/parms
  1240. S_ATTR_FRAMEREL=0x112e, // relative to virtual frame ptr
  1241. S_ATTR_REGISTER=0x112f, // stored in a register
  1242. S_ATTR_REGREL=0x1130, // relative to register (alternate frame ptr)
  1243. S_ATTR_MANYREG=0x1131, // stored in >1 register
  1244. // Separated code (from the compiler) support
  1245. S_SEPCODE=0x1132,
  1246. S_LOCAL=0x1133, // defines a local symbol in optimized code
  1247. S_DEFRANGE=0x1134, // defines a single range of addresses in which symbol can be evaluated
  1248. S_DEFRANGE2=0x1135, // defines ranges of addresses in which symbol can be evaluated
  1249. S_SECTION=0x1136, // A COFF section in a PE executable
  1250. S_COFFGROUP=0x1137, // A COFF group
  1251. S_EXPORT=0x1138, // A export
  1252. S_CALLSITEINFO=0x1139, // Indirect call site information
  1253. S_FRAMECOOKIE=0x113a, // Security cookie information
  1254. S_DISCARDED=0x113b, // Discarded by LINK /OPT:REF (experimental, see richards)
  1255. S_RECTYPE_MAX, // one greater than last
  1256. S_RECTYPE_LAST=S_RECTYPE_MAX - 1,
  1257. };
  1258. // enum describing compile flag ambient data model
  1259. internal enum CV_CFL_DATA {
  1260. CV_CFL_DNEAR=0x00,
  1261. CV_CFL_DFAR=0x01,
  1262. CV_CFL_DHUGE=0x02
  1263. };
  1264. // enum describing compile flag ambiant code model
  1265. internal enum CV_CFL_CODE {
  1266. CV_CFL_CNEAR=0x00,
  1267. CV_CFL_CFAR=0x01,
  1268. CV_CFL_CHUGE=0x02
  1269. };
  1270. // enum describing compile flag target floating point package
  1271. internal enum CV_CFL_FPKG {
  1272. CV_CFL_NDP=0x00,
  1273. CV_CFL_EMU=0x01,
  1274. CV_CFL_ALT=0x02
  1275. };
  1276. // enum describing function return method
  1277. [Flags]
  1278. internal enum CV_PROCFLAGS : byte {
  1279. CV_PFLAG_NOFPO=0x01, // frame pointer present
  1280. CV_PFLAG_INT=0x02, // interrupt return
  1281. CV_PFLAG_FAR=0x04, // far return
  1282. CV_PFLAG_NEVER=0x08, // function does not return
  1283. CV_PFLAG_NOTREACHED=0x10, // label isn't fallen into
  1284. CV_PFLAG_CUST_CALL=0x20, // custom calling convention
  1285. CV_PFLAG_NOINLINE=0x40, // function marked as noinline
  1286. CV_PFLAG_OPTDBGINFO=0x80, // function has debug information for optimized code
  1287. };
  1288. // Extended proc flags
  1289. //
  1290. internal struct CV_EXPROCFLAGS {
  1291. internal byte flags; // (CV_PROCFLAGS)
  1292. internal byte reserved; // must be zero
  1293. };
  1294. // local variable flags
  1295. [Flags]
  1296. internal enum CV_LVARFLAGS : ushort {
  1297. fIsParam=0x0001, // variable is a parameter
  1298. fAddrTaken=0x0002, // address is taken
  1299. fCompGenx=0x0004, // variable is compiler generated
  1300. fIsAggregate=0x0008, // the symbol is splitted in temporaries,
  1301. // which are treated by compiler as
  1302. // independent entities
  1303. fIsAggregated=0x0010, // Counterpart of fIsAggregate - tells
  1304. // that it is a part of a fIsAggregate symbol
  1305. fIsAliased=0x0020, // variable has multiple simultaneous lifetimes
  1306. fIsAlias=0x0040, // represents one of the multiple simultaneous lifetimes
  1307. };
  1308. // represents an address range, used for optimized code debug info
  1309. internal struct CV_lvar_addr_range { // defines a range of addresses
  1310. internal uint offStart;
  1311. internal ushort isectStart;
  1312. internal uint cbRange;
  1313. };
  1314. // enum describing function data return method
  1315. internal enum CV_GENERIC_STYLE {
  1316. CV_GENERIC_VOID=0x00, // void return type
  1317. CV_GENERIC_REG=0x01, // return data is in registers
  1318. CV_GENERIC_ICAN=0x02, // indirect caller allocated near
  1319. CV_GENERIC_ICAF=0x03, // indirect caller allocated far
  1320. CV_GENERIC_IRAN=0x04, // indirect returnee allocated near
  1321. CV_GENERIC_IRAF=0x05, // indirect returnee allocated far
  1322. CV_GENERIC_UNUSED=0x06 // first unused
  1323. };
  1324. [Flags]
  1325. internal enum CV_GENERIC_FLAG : ushort {
  1326. cstyle=0x0001, // true push varargs right to left
  1327. rsclean=0x0002, // true if returnee stack cleanup
  1328. };
  1329. // flag bitfields for separated code attributes
  1330. [Flags]
  1331. internal enum CV_SEPCODEFLAGS : uint {
  1332. fIsLexicalScope=0x00000001, // S_SEPCODE doubles as lexical scope
  1333. fReturnsToParent=0x00000002, // code frag returns to parent
  1334. };
  1335. // Generic layout for symbol records
  1336. internal struct SYMTYPE {
  1337. internal ushort reclen; // Record length
  1338. internal ushort rectyp; // Record type
  1339. // byte data[CV_ZEROLEN];
  1340. // SYMTYPE *NextSym (SYMTYPE * pSym) {
  1341. // return (SYMTYPE *) ((char *)pSym + pSym->reclen + sizeof(ushort));
  1342. // }
  1343. };
  1344. // non-model specific symbol types
  1345. internal struct RegSym {
  1346. // internal ushort reclen; // Record length [SYMTYPE]
  1347. // internal ushort rectyp; // S_REGISTER
  1348. internal uint typind; // (type index) Type index or Metadata token
  1349. internal ushort reg; // register enumerate
  1350. internal string name; // Length-prefixed name
  1351. };
  1352. internal struct AttrRegSym {
  1353. // internal ushort reclen; // Record length [SYMTYPE]
  1354. // internal ushort rectyp; // S_MANREGISTER | S_ATTR_REGISTER
  1355. internal uint typind; // (type index) Type index or Metadata token
  1356. internal uint offCod; // first code address where var is live
  1357. internal ushort segCod;
  1358. internal ushort flags; // (CV_LVARFLAGS)local var flags
  1359. internal ushort reg; // register enumerate
  1360. internal string name; // Length-prefixed name
  1361. };
  1362. internal struct ManyRegSym {
  1363. // internal ushort reclen; // Record length [SYMTYPE]
  1364. // internal ushort rectyp; // S_MANYREG
  1365. internal uint typind; // (type index) Type index or metadata token
  1366. internal byte count; // count of number of registers
  1367. internal byte[] reg; // count register enumerates, most-sig first
  1368. internal string name; // length-prefixed name.
  1369. };
  1370. internal struct ManyRegSym2 {
  1371. // internal ushort reclen; // Record length [SYMTYPE]
  1372. // internal ushort rectyp; // S_MANYREG2
  1373. internal uint typind; // (type index) Type index or metadata token
  1374. internal ushort count; // count of number of registers,
  1375. internal ushort[] reg; // count register enumerates, most-sig first
  1376. internal string name; // length-prefixed name.
  1377. };
  1378. internal struct AttrManyRegSym {
  1379. // internal ushort reclen; // Record length [SYMTYPE]
  1380. // internal ushort rectyp; // S_MANMANYREG
  1381. internal uint typind; // (type index) Type index or metadata token
  1382. internal uint offCod; // first code address where var is live
  1383. internal ushort segCod;
  1384. internal ushort flags; // (CV_LVARFLAGS)local var flags
  1385. internal byte count; // count of number of registers
  1386. internal byte[] reg; // count register enumerates, most-sig first
  1387. internal string name; // utf-8 encoded zero terminate name
  1388. };
  1389. internal struct AttrManyRegSym2 {
  1390. // internal ushort reclen; // Record length [SYMTYPE]
  1391. // internal ushort rectyp; // S_MANMANYREG2 | S_ATTR_MANYREG
  1392. internal uint typind; // (type index) Type index or metadata token
  1393. internal uint offCod; // first code address where var is live
  1394. internal ushort segCod;
  1395. internal ushort flags; // (CV_LVARFLAGS)local var flags
  1396. internal ushort count; // count of number of registers
  1397. internal ushort[] reg; // count register enumerates, most-sig first
  1398. internal string name; // utf-8 encoded zero terminate name
  1399. };
  1400. internal struct ConstSym {
  1401. // internal ushort reclen; // Record length [SYMTYPE]
  1402. // internal ushort rectyp; // S_CONSTANT or S_MANCONSTANT
  1403. internal uint typind; // (type index) Type index (containing enum if enumerate) or metadata token
  1404. internal ushort value; // numeric leaf containing value
  1405. internal string name; // Length-prefixed name
  1406. };
  1407. internal struct UdtSym {
  1408. // internal ushort reclen; // Record length [SYMTYPE]
  1409. // internal ushort rectyp; // S_UDT | S_COBOLUDT
  1410. internal uint typind; // (type index) Type index
  1411. internal string name; // Length-prefixed name
  1412. };
  1413. internal struct ManyTypRef {
  1414. // internal ushort reclen; // Record length [SYMTYPE]
  1415. // internal ushort rectyp; // S_MANTYPREF
  1416. internal uint typind; // (type index) Type index
  1417. };
  1418. internal struct SearchSym {
  1419. // internal ushort reclen; // Record length [SYMTYPE]
  1420. // internal ushort rectyp; // S_SSEARCH
  1421. internal uint startsym; // offset of the procedure
  1422. internal ushort seg; // segment of symbol
  1423. };
  1424. [Flags]
  1425. internal enum CFLAGSYM_FLAGS : ushort {
  1426. pcode=0x0001, // true if pcode present
  1427. floatprec=0x0006, // floating precision
  1428. floatpkg=0x0018, // float package
  1429. ambdata=0x00e0, // ambient data model
  1430. ambcode=0x0700, // ambient code model
  1431. mode32=0x0800, // true if compiled 32 bit mode
  1432. };
  1433. internal struct CFlagSym {
  1434. // internal ushort reclen; // Record length [SYMTYPE]
  1435. // internal ushort rectyp; // S_COMPILE
  1436. internal byte machine; // target processor
  1437. internal byte language; // language index
  1438. internal ushort flags; // (CFLAGSYM_FLAGS)
  1439. internal string ver; // Length-prefixed compiler version string
  1440. };
  1441. [Flags]
  1442. internal enum COMPILESYM_FLAGS : uint {
  1443. iLanguage=0x000000ff, // language index
  1444. fEC=0x00000100, // compiled for E/C
  1445. fNoDbgInfo=0x00000200, // not compiled with debug info
  1446. fLTCG=0x00000400, // compiled with LTCG
  1447. fNoDataAlign=0x00000800, // compiled with -Bzalign
  1448. fManagedPresent=0x00001000, // managed code/data present
  1449. fSecurityChecks=0x00002000, // compiled with /GS
  1450. fHotPatch=0x00004000, // compiled with /hotpatch
  1451. fCVTCIL=0x00008000, // converted with CVTCIL
  1452. fMSILModule=0x00010000, // MSIL netmodule
  1453. };
  1454. internal struct CompileSym {
  1455. // internal ushort reclen; // Record length [SYMTYPE]
  1456. // internal ushort rectyp; // S_COMPILE2
  1457. internal uint flags; // (COMPILESYM_FLAGS)
  1458. internal ushort machine; // target processor
  1459. internal ushort verFEMajor; // front end major version #
  1460. internal ushort verFEMinor; // front end minor version #
  1461. internal ushort verFEBuild; // front end build version #
  1462. internal ushort verMajor; // back end major version #
  1463. internal ushort verMinor; // back end minor version #
  1464. internal ushort verBuild; // back end build version #
  1465. internal string verSt; // Length-prefixed compiler version string, followed
  1466. internal string[] verArgs; // block of zero terminated strings, ended by double-zero.
  1467. };
  1468. internal struct ObjNameSym {
  1469. // internal ushort reclen; // Record length [SYMTYPE]
  1470. // internal ushort rectyp; // S_OBJNAME
  1471. internal uint signature; // signature
  1472. internal string name; // Length-prefixed name
  1473. };
  1474. internal struct EndArgSym {
  1475. // internal ushort reclen; // Record length [SYMTYPE]
  1476. // internal ushort rectyp; // S_ENDARG
  1477. };
  1478. internal struct ReturnSym {
  1479. // internal ushort reclen; // Record length [SYMTYPE]
  1480. // internal ushort rectyp; // S_RETURN
  1481. internal CV_GENERIC_FLAG flags; // flags
  1482. internal byte style; // CV_GENERIC_STYLE return style
  1483. // followed by return method data
  1484. };
  1485. internal struct EntryThisSym {
  1486. // internal ushort reclen; // Record length [SYMTYPE]
  1487. // internal ushort rectyp; // S_ENTRYTHIS
  1488. internal byte thissym; // symbol describing this pointer on entry
  1489. };
  1490. internal struct BpRelSym32 {
  1491. // internal ushort reclen; // Record length [SYMTYPE]
  1492. // internal ushort rectyp; // S_BPREL32
  1493. internal int off; // BP-relative offset
  1494. internal uint typind; // (type index) Type index or Metadata token
  1495. internal string name; // Length-prefixed name
  1496. };
  1497. internal struct FrameRelSym {
  1498. // internal ushort reclen; // Record length [SYMTYPE]
  1499. // internal ushort rectyp; // S_MANFRAMEREL | S_ATTR_FRAMEREL
  1500. internal int off; // Frame relative offset
  1501. internal uint typind; // (type index) Type index or Metadata token
  1502. internal uint offCod; // first code address where var is live
  1503. internal ushort segCod;
  1504. internal ushort flags; // (CV_LVARFLAGS)local var flags
  1505. internal string name; // Length-prefixed name
  1506. };
  1507. internal struct SlotSym32 {
  1508. // internal ushort reclen; // Record length [SYMTYPE]
  1509. // internal ushort rectyp; // S_LOCALSLOT or S_PARAMSLOT
  1510. internal uint index; // slot index
  1511. internal uint typind; // (type index) Type index or Metadata token
  1512. internal string name; // Length-prefixed name
  1513. };
  1514. internal struct AttrSlotSym {
  1515. // internal ushort reclen; // Record length [SYMTYPE]
  1516. // internal ushort rectyp; // S_MANSLOT
  1517. internal uint index; // slot index
  1518. internal uint typind; // (type index) Type index or Metadata token
  1519. internal uint offCod; // first code address where var is live
  1520. internal ushort segCod;
  1521. internal ushort flags; // (CV_LVARFLAGS)local var flags
  1522. internal string name; // Length-prefixed name
  1523. };
  1524. internal struct AnnotationSym {
  1525. // internal ushort reclen; // Record length [SYMTYPE]
  1526. // internal ushort rectyp; // S_ANNOTATION
  1527. internal uint off;
  1528. internal ushort seg;
  1529. internal ushort csz; // Count of zero terminated annotation strings
  1530. internal string[] rgsz; // Sequence of zero terminated annotation strings
  1531. };
  1532. internal struct DatasSym32 {
  1533. // internal ushort reclen; // Record length [SYMTYPE]
  1534. // internal ushort rectyp; // S_LDATA32, S_GDATA32 or S_PUB32, S_LMANDATA, S_GMANDATA
  1535. internal uint typind; // (type index) Type index, or Metadata token if a managed symbol
  1536. internal uint off;
  1537. internal ushort seg;
  1538. internal string name; // Length-prefixed name
  1539. };
  1540. [Flags]
  1541. internal enum CV_PUBSYMFLAGS : uint {
  1542. fNone=0,
  1543. fCode=0x00000001, // set if internal symbol refers to a code address
  1544. fFunction=0x00000002, // set if internal symbol is a function
  1545. fManaged=0x00000004, // set if managed code (native or IL)
  1546. fMSIL=0x00000008, // set if managed IL code
  1547. };
  1548. internal struct PubSym32 {
  1549. // internal ushort reclen; // Record length [SYMTYPE]
  1550. // internal ushort rectyp; // S_PUB32
  1551. internal uint flags; // (CV_PUBSYMFLAGS)
  1552. internal uint off;
  1553. internal ushort seg;
  1554. internal string name; // Length-prefixed name
  1555. };
  1556. internal struct ProcSym32 {
  1557. // internal ushort reclen; // Record length [SYMTYPE]
  1558. // internal ushort rectyp; // S_GPROC32 or S_LPROC32
  1559. internal uint parent; // pointer to the parent
  1560. internal uint end; // pointer to this blocks end
  1561. internal uint next; // pointer to next symbol
  1562. internal uint len; // Proc length
  1563. internal uint dbgStart; // Debug start offset
  1564. internal uint dbgEnd; // Debug end offset
  1565. internal uint typind; // (type index) Type index
  1566. internal uint off;
  1567. internal ushort seg;
  1568. internal byte flags; // (CV_PROCFLAGS) Proc flags
  1569. internal string name; // Length-prefixed name
  1570. };
  1571. internal struct ManProcSym {
  1572. // internal ushort reclen; // Record length [SYMTYPE]
  1573. // internal ushort rectyp; // S_GMANPROC, S_LMANPROC, S_GMANPROCIA64 or S_LMANPROCIA64
  1574. internal uint parent; // pointer to the parent
  1575. internal uint end; // pointer to this blocks end
  1576. internal uint next; // pointer to next symbol
  1577. internal uint len; // Proc length
  1578. internal uint dbgStart; // Debug start offset
  1579. internal uint dbgEnd; // Debug end offset
  1580. internal uint token; // COM+ metadata token for method
  1581. internal uint off;
  1582. internal ushort seg;
  1583. internal byte flags; // (CV_PROCFLAGS) Proc flags
  1584. internal ushort retReg; // Register return value is in (may not be used for all archs)
  1585. internal string name; // optional name field
  1586. };
  1587. internal struct ManProcSymMips {
  1588. // internal ushort reclen; // Record length [SYMTYPE]
  1589. // internal ushort rectyp; // S_GMANPROCMIPS or S_LMANPROCMIPS
  1590. internal uint parent; // pointer to the parent
  1591. internal uint end; // pointer to this blocks end
  1592. internal uint next; // pointer to next symbol
  1593. internal uint len; // Proc length
  1594. internal uint dbgStart; // Debug start offset
  1595. internal uint dbgEnd; // Debug end offset
  1596. internal uint regSave; // int register save mask
  1597. internal uint fpSave; // fp register save mask
  1598. internal uint intOff; // int register save offset
  1599. internal uint fpOff; // fp register save offset
  1600. internal uint token; // COM+ token type
  1601. internal uint off;
  1602. internal ushort seg;
  1603. internal byte retReg; // Register return value is in
  1604. internal byte frameReg; // Frame pointer register
  1605. internal string name; // optional name field
  1606. };
  1607. internal struct ThunkSym32 {
  1608. // internal ushort reclen; // Record length [SYMTYPE]
  1609. // internal ushort rectyp; // S_THUNK32
  1610. internal uint parent; // pointer to the parent
  1611. internal uint end; // pointer to this blocks end
  1612. internal uint next; // pointer to next symbol
  1613. internal uint off;
  1614. internal ushort seg;
  1615. internal ushort len; // length of thunk
  1616. internal byte ord; // THUNK_ORDINAL specifying type of thunk
  1617. internal string name; // Length-prefixed name
  1618. internal byte[] variant; // variant portion of thunk
  1619. };
  1620. internal enum TRAMP { // Trampoline subtype
  1621. trampIncremental, // incremental thunks
  1622. trampBranchIsland, // Branch island thunks
  1623. };
  1624. internal struct TrampolineSym { // Trampoline thunk symbol
  1625. // internal ushort reclen; // Record length [SYMTYPE]
  1626. // internal ushort rectyp; // S_TRAMPOLINE
  1627. internal ushort trampType; // trampoline sym subtype
  1628. internal ushort cbThunk; // size of the thunk
  1629. internal uint offThunk; // offset of the thunk
  1630. internal uint offTarget; // offset of the target of the thunk
  1631. internal ushort sectThunk; // section index of the thunk
  1632. internal ushort sectTarget; // section index of the target of the thunk
  1633. };
  1634. internal struct LabelSym32 {
  1635. // internal ushort reclen; // Record length [SYMTYPE]
  1636. // internal ushort rectyp; // S_LABEL32
  1637. internal uint off;
  1638. internal ushort seg;
  1639. internal byte flags; // (CV_PROCFLAGS) flags
  1640. internal string name; // Length-prefixed name
  1641. };
  1642. internal struct BlockSym32 {
  1643. // internal ushort reclen; // Record length [SYMTYPE]
  1644. // internal ushort rectyp; // S_BLOCK32
  1645. internal uint parent; // pointer to the parent
  1646. internal uint end; // pointer to this blocks end
  1647. internal uint len; // Block length
  1648. internal uint off; // Offset in code segment
  1649. internal ushort seg; // segment of label
  1650. internal string name; // Length-prefixed name
  1651. };
  1652. internal struct WithSym32 {
  1653. // internal ushort reclen; // Record length [SYMTYPE]
  1654. // internal ushort rectyp; // S_WITH32
  1655. internal uint parent; // pointer to the parent
  1656. internal uint end; // pointer to this blocks end
  1657. internal uint len; // Block length
  1658. internal uint off; // Offset in code segment
  1659. internal ushort seg; // segment of label
  1660. internal string expr; // Length-prefixed expression string
  1661. };
  1662. internal struct VpathSym32 {
  1663. // internal ushort reclen; // record length
  1664. // internal ushort rectyp; // S_VFTABLE32
  1665. internal uint root; // (type index) type index of the root of path
  1666. internal uint path; // (type index) type index of the path record
  1667. internal uint off; // offset of virtual function table
  1668. internal ushort seg; // segment of virtual function table
  1669. };
  1670. internal struct RegRel32 {
  1671. // internal ushort reclen; // Record length [SYMTYPE]
  1672. // internal ushort rectyp; // S_REGREL32
  1673. internal uint off; // offset of symbol
  1674. internal uint typind; // (type index) Type index or metadata token
  1675. internal ushort reg; // register index for symbol
  1676. internal string name; // Length-prefixed name
  1677. };
  1678. internal struct AttrRegRel {
  1679. // internal ushort reclen; // Record length [SYMTYPE]
  1680. // internal ushort rectyp; // S_MANREGREL | S_ATTR_REGREL
  1681. internal uint off; // offset of symbol
  1682. internal uint typind; // (type index) Type index or metadata token
  1683. internal ushort reg; // register index for symbol
  1684. internal uint offCod; // first code address where var is live
  1685. internal ushort segCod;
  1686. internal ushort flags; // (CV_LVARFLAGS)local var flags
  1687. internal string name; // Length-prefixed name
  1688. };
  1689. internal struct ThreadSym32 {
  1690. // internal ushort reclen; // record length
  1691. // internal ushort rectyp; // S_LTHREAD32 | S_GTHREAD32
  1692. internal uint typind; // (type index) type index
  1693. internal uint off; // offset into thread storage
  1694. internal ushort seg; // segment of thread storage
  1695. internal string name; // length prefixed name
  1696. };
  1697. internal struct Slink32 {
  1698. // internal ushort reclen; // record length
  1699. // internal ushort rectyp; // S_SLINK32
  1700. internal uint framesize; // frame size of parent procedure
  1701. internal int off; // signed offset where the static link was saved relative to the value of reg
  1702. internal ushort reg;
  1703. };
  1704. internal struct ProcSymMips {
  1705. // internal ushort reclen; // Record length [SYMTYPE]
  1706. // internal ushort rectyp; // S_GPROCMIPS or S_LPROCMIPS
  1707. internal uint parent; // pointer to the parent
  1708. internal uint end; // pointer to this blocks end
  1709. internal uint next; // pointer to next symbol
  1710. internal uint len; // Proc length
  1711. internal uint dbgStart; // Debug start offset
  1712. internal uint dbgEnd; // Debug end offset
  1713. internal uint regSave; // int register save mask
  1714. internal uint fpSave; // fp register save mask
  1715. internal uint intOff; // int register save offset
  1716. internal uint fpOff; // fp register save offset
  1717. internal uint typind; // (type index) Type index
  1718. internal uint off; // Symbol offset
  1719. internal ushort seg; // Symbol segment
  1720. internal byte retReg; // Register return value is in
  1721. internal byte frameReg; // Frame pointer register
  1722. internal string name; // Length-prefixed name
  1723. };
  1724. internal struct ProcSymIa64 {
  1725. // internal ushort reclen; // Record length [SYMTYPE]
  1726. // internal ushort rectyp; // S_GPROCIA64 or S_LPROCIA64
  1727. internal uint parent; // pointer to the parent
  1728. internal uint end; // pointer to this blocks end
  1729. internal uint next; // pointer to next symbol
  1730. internal uint len; // Proc length
  1731. internal uint dbgStart; // Debug start offset
  1732. internal uint dbgEnd; // Debug end offset
  1733. internal uint typind; // (type index) Type index
  1734. internal uint off; // Symbol offset
  1735. internal ushort seg; // Symbol segment
  1736. internal ushort retReg; // Register return value is in
  1737. internal byte flags; // (CV_PROCFLAGS) Proc flags
  1738. internal string name; // Length-prefixed name
  1739. };
  1740. internal struct RefSym {
  1741. // internal ushort reclen; // Record length [SYMTYPE]
  1742. // internal ushort rectyp; // S_PROCREF_ST, S_DATAREF_ST, or S_LPROCREF_ST
  1743. internal uint sumName; // SUC of the name
  1744. internal uint ibSym; // Offset of actual symbol in $$Symbols
  1745. internal ushort imod; // Module containing the actual symbol
  1746. internal ushort usFill; // align this record
  1747. };
  1748. internal struct RefSym2 {
  1749. // internal ushort reclen; // Record length [SYMTYPE]
  1750. // internal ushort rectyp; // S_PROCREF, S_DATAREF, or S_LPROCREF
  1751. internal uint sumName; // SUC of the name
  1752. internal uint ibSym; // Offset of actual symbol in $$Symbols
  1753. internal ushort imod; // Module containing the actual symbol
  1754. internal string name; // hidden name made a first class member
  1755. };
  1756. internal struct AlignSym {
  1757. // internal ushort reclen; // Record length [SYMTYPE]
  1758. // internal ushort rectyp; // S_ALIGN
  1759. };
  1760. internal struct OemSymbol {
  1761. // internal ushort reclen; // Record length [SYMTYPE]
  1762. // internal ushort rectyp; // S_OEM
  1763. internal Guid idOem; // an oem ID (GUID)
  1764. internal uint typind; // (type index) Type index
  1765. internal byte[] rgl; // user data, force 4-byte alignment
  1766. };
  1767. [Flags]
  1768. internal enum FRAMEPROCSYM_FLAGS : uint {
  1769. fHasAlloca=0x00000001, // function uses _alloca()
  1770. fHasSetJmp=0x00000002, // function uses setjmp()
  1771. fHasLongJmp=0x00000004, // function uses longjmp()
  1772. fHasInlAsm=0x00000008, // function uses inline asm
  1773. fHasEH=0x00000010, // function has EH states
  1774. fInlSpec=0x00000020, // function was speced as inline
  1775. fHasSEH=0x00000040, // function has SEH
  1776. fNaked=0x00000080, // function is __declspec(naked)
  1777. fSecurityChecks=0x00000100, // function has buffer security check introduced by /GS.
  1778. fAsyncEH=0x00000200, // function compiled with /EHa
  1779. fGSNoStackOrdering=0x00000400, // function has /GS buffer checks, but stack ordering couldn't be done
  1780. fWasInlined=0x00000800, // function was inlined within another function
  1781. };
  1782. internal struct FrameProcSym {
  1783. // internal ushort reclen; // Record length [SYMTYPE]
  1784. // internal ushort rectyp; // S_FRAMEPROC
  1785. internal uint cbFrame; // count of bytes of total frame of procedure
  1786. internal uint cbPad; // count of bytes of padding in the frame
  1787. internal uint offPad; // offset (rel to frame) to where padding starts
  1788. internal uint cbSaveRegs; // count of bytes of callee save registers
  1789. internal uint offExHdlr; // offset of exception handler
  1790. internal ushort secExHdlr; // section id of exception handler
  1791. internal uint flags; // (FRAMEPROCSYM_FLAGS)
  1792. }
  1793. internal struct UnamespaceSym {
  1794. // internal ushort reclen; // Record length [SYMTYPE]
  1795. // internal ushort rectyp; // S_UNAMESPACE
  1796. internal string name; // name
  1797. };
  1798. internal struct SepCodSym {
  1799. // internal ushort reclen; // Record length [SYMTYPE]
  1800. // internal ushort rectyp; // S_SEPCODE
  1801. internal uint parent; // pointer to the parent
  1802. internal uint end; // pointer to this block's end
  1803. internal uint length; // count of bytes of this block
  1804. internal uint scf; // (CV_SEPCODEFLAGS) flags
  1805. internal uint off; // sec:off of the separated code
  1806. internal uint offParent; // secParent:offParent of the enclosing scope
  1807. internal ushort sec; // (proc, block, or sepcode)
  1808. internal ushort secParent;
  1809. };
  1810. internal struct LocalSym {
  1811. // internal ushort reclen; // Record length [SYMTYPE]
  1812. // internal ushort rectyp; // S_LOCAL
  1813. internal uint id; // id of the local
  1814. internal uint typind; // (type index) type index
  1815. internal ushort flags; // (CV_LVARFLAGS) local var flags
  1816. internal uint idParent; // This is is parent variable - fIsAggregated or fIsAlias
  1817. internal uint offParent; // Offset in parent variable - fIsAggregated
  1818. internal uint expr; // NI of expression that this temp holds
  1819. internal uint pad0; // pad, must be zero
  1820. internal uint pad1; // pad, must be zero
  1821. internal string name; // Name of this symbol.
  1822. }
  1823. internal struct DefRangeSym {
  1824. // internal ushort reclen; // Record length [SYMTYPE]
  1825. // internal ushort rectyp; // S_DEFRANGE
  1826. internal uint id; // ID of the local symbol for which this formula holds
  1827. internal uint program; // program to evaluate the value of the symbol
  1828. internal CV_lvar_addr_range range; // Range of addresses where this program is valid
  1829. };
  1830. internal struct DefRangeSym2 {
  1831. // internal ushort reclen; // Record length [SYMTYPE]
  1832. // internal ushort rectyp; // S_DEFRANGE2
  1833. internal uint id; // ID of the local symbol for which this formula holds
  1834. internal uint program; // program to evaluate the value of the symbol
  1835. internal ushort count; // count of CV_lvar_addr_range records following
  1836. internal CV_lvar_addr_range[] range;// Range of addresses where this program is valid
  1837. };
  1838. internal struct SectionSym {
  1839. // internal ushort reclen // Record length
  1840. // internal ushort rectyp; // S_SECTION
  1841. internal ushort isec; // Section number
  1842. internal byte align; // Alignment of this section (power of 2)
  1843. internal byte bReserved; // Reserved. Must be zero.
  1844. internal uint rva;
  1845. internal uint cb;
  1846. internal uint characteristics;
  1847. internal string name; // name
  1848. };
  1849. internal struct CoffGroupSym {
  1850. // internal ushort reclen; // Record length [SYMTYPE]
  1851. // internal ushort rectyp; // S_COFFGROUP
  1852. internal uint cb;
  1853. internal uint characteristics;
  1854. internal uint off; // Symbol offset
  1855. internal ushort seg; // Symbol segment
  1856. internal string name; // name
  1857. };
  1858. [Flags]
  1859. internal enum EXPORTSYM_FLAGS : ushort {
  1860. fConstant=0x0001, // CONSTANT
  1861. fData=0x0002, // DATA
  1862. fPrivate=0x0004, // PRIVATE
  1863. fNoName=0x0008, // NONAME
  1864. fOrdinal=0x0010, // Ordinal was explicitly assigned
  1865. fForwarder=0x0020, // This is a forwarder
  1866. }
  1867. internal struct ExportSym {
  1868. // internal ushort reclen; // Record length [SYMTYPE]
  1869. // internal ushort rectyp; // S_EXPORT
  1870. internal ushort ordinal;
  1871. internal ushort flags; // (EXPORTSYM_FLAGS)
  1872. internal string name; // name of
  1873. };
  1874. //
  1875. // Symbol for describing indirect calls when they are using
  1876. // a function pointer cast on some other type or temporary.
  1877. // Typical content will be an LF_POINTER to an LF_PROCEDURE
  1878. // type record that should mimic an actual variable with the
  1879. // function pointer type in question.
  1880. //
  1881. // Since the compiler can sometimes tail-merge a function call
  1882. // through a function pointer, there may be more than one
  1883. // S_CALLSITEINFO record at an address. This is similar to what
  1884. // you could do in your own code by:
  1885. //
  1886. // if (expr)
  1887. // pfn = &function1;
  1888. // else
  1889. // pfn = &function2;
  1890. //
  1891. // (*pfn)(arg list);
  1892. //
  1893. internal struct CallsiteInfo {
  1894. // internal ushort reclen; // Record length [SYMTYPE]
  1895. // internal ushort rectyp; // S_CALLSITEINFO
  1896. internal int off; // offset of call site
  1897. internal ushort ect; // section index of call site
  1898. internal ushort pad0; // alignment padding field, must be zero
  1899. internal uint typind; // (type index) type index describing function signature
  1900. };
  1901. // Frame cookie information
  1902. internal enum CV_cookietype {
  1903. CV_COOKIETYPE_COPY=0,
  1904. CV_COOKIETYPE_XOR_SP,
  1905. CV_COOKIETYPE_XOR_BP,
  1906. CV_COOKIETYPE_XOR_R13,
  1907. };
  1908. // Symbol for describing security cookie's position and type
  1909. // (raw, xor'd with esp, xor'd with ebp).
  1910. internal struct FrameCookie {
  1911. // internal ushort reclen; // Record length [SYMTYPE]
  1912. // internal ushort rectyp; // S_FRAMECOOKIE
  1913. internal int off; // Frame relative offset
  1914. internal ushort reg; // Register index
  1915. internal int cookietype; // (CV_cookietype) Type of the cookie
  1916. internal byte flags; // Flags describing this cookie
  1917. };
  1918. internal enum CV_DISCARDED : uint {
  1919. CV_DISCARDED_UNKNOWN=0,
  1920. CV_DISCARDED_NOT_SELECTED=1,
  1921. CV_DISCARDED_NOT_REFERENCED=2,
  1922. };
  1923. internal struct DiscardedSym {
  1924. // internal ushort reclen; // Record length [SYMTYPE]
  1925. // internal ushort rectyp; // S_DISCARDED
  1926. internal CV_DISCARDED iscarded;
  1927. internal uint fileid; // First FILEID if line number info present
  1928. internal uint linenum; // First line number
  1929. internal byte[] data; // Original record(s) with invalid indices
  1930. };
  1931. //
  1932. // V7 line number data types
  1933. //
  1934. internal enum DEBUG_S_SUBSECTION_TYPE : uint {
  1935. DEBUG_S_IGNORE=0x80000000, // if this bit is set in a subsection type then ignore the subsection contents
  1936. DEBUG_S_SYMBOLS=0xf1,
  1937. DEBUG_S_LINES=0xf2,
  1938. DEBUG_S_STRINGTABLE=0xf3,
  1939. DEBUG_S_FILECHKSMS=0xf4,
  1940. DEBUG_S_FRAMEDATA=0xf5,
  1941. };
  1942. //
  1943. // Line flags (data present)
  1944. //
  1945. internal enum CV_LINE_SUBSECTION_FLAGS : ushort {
  1946. CV_LINES_HAVE_COLUMNS=0x0001,
  1947. }
  1948. internal struct CV_LineSection {
  1949. internal uint off;
  1950. internal ushort sec;
  1951. internal ushort flags;
  1952. internal uint cod;
  1953. }
  1954. internal struct CV_SourceFile {
  1955. internal uint index; // Index to file in checksum section.
  1956. internal uint count; // Number of CV_Line records.
  1957. internal uint linsiz; // Size of CV_Line recods.
  1958. }
  1959. [Flags]
  1960. internal enum CV_Line_Flags : uint {
  1961. linenumStart=0x00ffffff, // line where statement/expression starts
  1962. deltaLineEnd=0x7f000000, // delta to line where statement ends (optional)
  1963. fStatement=0x80000000, // true if a statement linenumber, else an expression line num
  1964. };
  1965. internal struct CV_Line {
  1966. internal uint offset; // Offset to start of code bytes for line number
  1967. internal uint flags; // (CV_Line_Flags)
  1968. };
  1969. internal struct CV_Column {
  1970. internal ushort offColumnStart;
  1971. internal ushort offColumnEnd;
  1972. };
  1973. // File information
  1974. internal enum CV_FILE_CHECKSUM_TYPE : byte {
  1975. None=0,
  1976. MD5=1,
  1977. };
  1978. internal struct CV_FileCheckSum {
  1979. internal uint name; // Index of name in name table.
  1980. internal byte len; // Hash length
  1981. internal byte type; // Hash type
  1982. }
  1983. [Flags]
  1984. internal enum FRAMEDATA_FLAGS : uint {
  1985. fHasSEH=0x00000001,
  1986. fHasEH=0x00000002,
  1987. fIsFunctionStart=0x00000004,
  1988. };
  1989. internal struct FrameData {
  1990. internal uint ulRvaStart;
  1991. internal uint cbBlock;
  1992. internal uint cbLocals;
  1993. internal uint cbParams;
  1994. internal uint cbStkMax;
  1995. internal uint frameFunc;
  1996. internal ushort cbProlog;
  1997. internal ushort cbSavedRegs;
  1998. internal uint flags; // (FRAMEDATA_FLAGS)
  1999. };
  2000. internal struct XFixupData {
  2001. internal ushort wType;
  2002. internal ushort wExtra;
  2003. internal uint rva;
  2004. internal uint rvaTarget;
  2005. };
  2006. internal enum DEBUG_S_SUBSECTION {
  2007. SYMBOLS=0xF1,
  2008. LINES=0xF2,
  2009. STRINGTABLE=0xF3,
  2010. FILECHKSMS=0xF4,
  2011. FRAMEDATA=0xF5,
  2012. }
  2013. }