Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
8.6 KiB

  1. /* SCCSID = @(#)newdeb.h 4.1 86/03/11 */
  2. /*
  3. * Copyright Microsoft Corporation 1985
  4. *
  5. * This Module contains Proprietary Information of Microsoft
  6. * Corporation and should be treated as Confidential.
  7. *
  8. * newdeb.h: File format for symbolic debug information.
  9. */
  10. #if CVVERSION == 0
  11. typedef struct /* Section Table */
  12. {
  13. long d_lfaMod; /* File offset of MODULES */
  14. long d_lfaPub; /* File offset of PUBLICS */
  15. long d_lfaTyp; /* File offset of TYPES */
  16. long d_lfaSym; /* File offset of SMBOLS */
  17. long d_lfaSrc; /* File offset of SRCLINES */
  18. char d_ver; /* Version number */
  19. char d_flags; /* Flags */
  20. } SECTABTYPE;
  21. #define CBDEBHDRTYPE 22
  22. typedef struct /* Module Entry */
  23. {
  24. struct
  25. {
  26. short sa; /* Code seg base */
  27. short ra; /* Offset in code seg */
  28. short cb;
  29. } dm_code;
  30. long dm_raPub; /* offset in PUBLICS */
  31. long dm_raTyp; /* offset in TYPES */
  32. long dm_raSym; /* offset in SYMBOLS */
  33. long dm_raSrc; /* offset in SRCLINES */
  34. short dm_cbPub; /* length in PUBLICS */
  35. short dm_cbTyp; /* length in TYPES */
  36. short dm_cbSym; /* length in SYMBOLS */
  37. short dm_cbSrc; /* length in SCRLINES */
  38. } DEBMODTYPE;
  39. #define CBDEBMODTYPE 30
  40. typedef struct debPub /* PUBLICS entry */
  41. {
  42. short dp_ra; /* Segment offset */
  43. short dp_sa; /* Segment address */
  44. short dp_type; /* Type index */
  45. } DEBPUBTYPE;
  46. #define CBDEBPUBTYPE 6
  47. #endif
  48. #if CVVERSION > 0
  49. // New CV EXE format structures and definitions
  50. // Valid for CV 2.0 and 3.0
  51. struct sstModules
  52. {
  53. unsigned short segCode;
  54. unsigned short raCode;
  55. unsigned short cbCode;
  56. unsigned short iov;
  57. unsigned short ilib;
  58. unsigned short flags;
  59. };
  60. #define CBSSTMODULES (sizeof(sstModules))
  61. // CV 4.0 sstModule format - object file description
  62. #pragma pack(1)
  63. typedef struct sstmod4
  64. {
  65. unsigned short ovlNo; // Overlay number this module was allocated in
  66. unsigned short iLib; // Index to sstLibraries if this module was linked from library
  67. unsigned short cSeg; // Number of physical code segments this module contributes to
  68. char style[2]; // Debugging style for this module
  69. }
  70. SSTMOD4;
  71. typedef struct codeinfo
  72. {
  73. unsigned short seg; // Logical segment of the contribution
  74. unsigned short pad; // Padding to maintain aligment
  75. unsigned long off; // Offset in the logical segment where the this contribution starts
  76. unsigned long cbOnt; // Size of the contribution in bytes
  77. }
  78. CODEINFO;
  79. // Subsection types
  80. #define SSTMODULES 0x101
  81. #define SSTPUBLICS 0x102
  82. #define SSTTYPES 0x103
  83. #define SSTSYMBOLS 0x104
  84. #define SSTSRCLINES 0x105
  85. #define SSTNSRCLINES 0x109 // New format - first implemented in link 5.05
  86. #define SSTLIBRARIES 0x106
  87. #define SSTIMPORTS 0x107
  88. // New subsection types introduced in CV 4.0
  89. #define SSTMODULES4 0x120
  90. #define SSTTYPES4 0x121
  91. #define SSTPUBLICS4 0x122
  92. #define SSTPUBLICSYM 0x123
  93. #define SSTSYMBOLS4 0x124
  94. #define SSTALIGNSYM 0x125
  95. #define SSTSRCLNSEG 0x126
  96. #define SSTSRCMODULE 0x127
  97. #define SSTLIBRARIES4 0x128
  98. #define SSTGLOBALSYM 0x129
  99. #define SSTGLOBALPUB 0x12a
  100. #define SSTGLOBALTYPES 0x12b
  101. #define SSTMPC 0x12c
  102. #define SSTSEGMAP 0x12d
  103. #define SSTSEGNAME 0x12e
  104. #define SSTPRETYPES 0x12f
  105. // Subsection directory header - intorduced in CV 4.0
  106. typedef struct dnthdr
  107. {
  108. unsigned short cbDirHeader;// Size of the header
  109. unsigned short cbDirEntry; // Size of directory entry
  110. unsigned long cDir; // Number of directory entries
  111. long lfoDirNext; // Offset from lfoBase of the next directory
  112. unsigned long flags; // Flags describing directory and subsection tables
  113. }
  114. DNTHDR;
  115. typedef struct dnt // SubDirectory entry type
  116. {
  117. short sst; // Subsection type
  118. short iMod; // Module index number
  119. long lfo; // LFO of start of section
  120. long cb; // Size of section in bytes (for CV 3.0
  121. // this was short)
  122. }
  123. DNT;
  124. typedef struct pubinfo16
  125. {
  126. unsigned short len; // Length of record, excluding the length field
  127. unsigned short idx; // Type of symbol
  128. unsigned short off; // Symbol offset
  129. unsigned short seg; // Symbol segment
  130. unsigned short type; // CodeView type index
  131. }
  132. PUB16;
  133. typedef struct pubinfo32
  134. {
  135. unsigned short len; // Length of record, excluding the length field
  136. unsigned short idx; // Type of symbol
  137. unsigned long off; // Symbol offset
  138. unsigned short seg; // Symbol segment
  139. unsigned short type; // CodeView type index
  140. }
  141. PUB32;
  142. #define S_PUB16 0x103
  143. #define S_PUB32 0x203
  144. #define T_ABS 0x001
  145. typedef struct
  146. {
  147. union
  148. {
  149. struct
  150. {
  151. unsigned short fRead :1;
  152. unsigned short fWrite :1;
  153. unsigned short fExecute:1;
  154. unsigned short f32Bit :1;
  155. unsigned short res1 :4;
  156. unsigned short fSel :1;
  157. unsigned short fAbs :1;
  158. unsigned short res2 :2;
  159. unsigned short fGroup :1;
  160. unsigned short res3 :3;
  161. };
  162. struct
  163. {
  164. unsigned short segAttr :8;
  165. unsigned short saAttr :4;
  166. unsigned short misc :4;
  167. };
  168. };
  169. }
  170. SEGFLG;
  171. typedef struct seginfo
  172. {
  173. SEGFLG flags; // Segment attributes
  174. unsigned short ovlNbr; // Overlay number
  175. unsigned short ggr; // Group index
  176. unsigned short sa; // Physical segment index
  177. unsigned short isegName; // Index to segment name
  178. unsigned short iclassName; // Index to segment class name
  179. unsigned long phyOff; // Starting offset inside physical segment
  180. unsigned long cbSeg; // Logical segment size
  181. }
  182. SEGINFO;
  183. #define CVLINEMAX 64
  184. typedef struct _CVSRC
  185. {
  186. struct _CVSRC FAR *next; // Next source file descriptor
  187. BYTE FAR *fname; // Source file name
  188. WORD cLines; // Number of source lines from this file
  189. WORD cSegs; // Number of code segemtns this source file contributes to
  190. struct _CVGSN FAR *pGsnFirst; // Code segment list
  191. struct _CVGSN FAR *pGsnLast; // Tail of the code segment list
  192. }
  193. CVSRC;
  194. typedef struct _CVGSN
  195. {
  196. struct _CVGSN FAR *next; // Next segment
  197. struct _CVGSN FAR *prev; // Previous segment
  198. WORD seg; // Logical segment index
  199. WORD cLines; // Number of source lines in this code segment
  200. WORD flags; // Flags
  201. DWORD raStart; // Starting logical offset of the contribution
  202. DWORD raEnd; // Ending logical offset of the contribution
  203. struct _CVLINE FAR *pLineFirst;// List of offset/line pairs
  204. struct _CVLINE FAR *pLineLast; // Tail of the offset/line pairs list
  205. }
  206. CVGSN;
  207. /*
  208. * Format flags
  209. *
  210. * 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - bit no
  211. * |
  212. * +--- Fake segment for explicitly allocated COMDATs
  213. */
  214. #define SPLIT_GSN 0x1
  215. typedef struct _CVLINE
  216. {
  217. struct _CVLINE FAR *next; // Next bucket
  218. WORD cPair; // Number of offset/line pairs in this bucket
  219. DWORD rgOff[CVLINEMAX];
  220. WORD rgLn[CVLINEMAX];
  221. }
  222. CVLINE;
  223. #pragma pack()
  224. #endif