CvInfo.cs 84 KB

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