Source code of Windows XP (NT5)
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.

927 lines
25 KiB

  1. /*++
  2. Copyright (c) 1992-2000 Microsoft Corporation
  3. Module Name:
  4. findreg.c
  5. Abstract:
  6. Maps CV register values to debugger's values
  7. Environment:
  8. User Mode.
  9. Revision History:
  10. Kshitiz K. Sharma (kksharma) 3/6/2000
  11. --*/
  12. #include "private.h"
  13. #include "cvinfo.h"
  14. #include "..\ntsd64\i386_reg.h"
  15. #include "..\ntsd64\ia64_reg.h"
  16. #include "..\ntsd64\alpha_reg.h"
  17. typedef struct _REGISTER_LOOKUP {
  18. ULONG CVReg;
  19. ULONG DbgReg;
  20. } REGISTER_LOOKUP, *PREGISTER_LOOKUP;
  21. REGISTER_LOOKUP gRegLookupX86[] = {
  22. { CV_REG_AL, X86_AL},
  23. { CV_REG_CL, X86_CL},
  24. { CV_REG_DL, X86_DL},
  25. { CV_REG_BL, X86_BL},
  26. { CV_REG_AH, X86_AH},
  27. { CV_REG_CH, X86_CH},
  28. { CV_REG_DH, X86_DH},
  29. { CV_REG_BH, X86_BH},
  30. { CV_REG_AX, X86_AX},
  31. { CV_REG_CX, X86_CX},
  32. { CV_REG_DX, X86_DX},
  33. { CV_REG_BX, X86_BX},
  34. { CV_REG_SP, X86_SP},
  35. { CV_REG_BP, X86_BP},
  36. { CV_REG_SI, X86_SI},
  37. { CV_REG_DI, X86_DI},
  38. { CV_REG_EAX, X86_EAX},
  39. { CV_REG_ECX, X86_ECX},
  40. { CV_REG_EDX, X86_EDX},
  41. { CV_REG_EBX, X86_EBX},
  42. { CV_REG_ESP, X86_ESP},
  43. { CV_REG_EBP, X86_EBP},
  44. { CV_REG_ESI, X86_ESI},
  45. { CV_REG_EDI, X86_EDI},
  46. { CV_REG_ES, X86_ES},
  47. { CV_REG_CS, X86_CS},
  48. { CV_REG_SS, X86_SS},
  49. { CV_REG_DS, X86_DS},
  50. { CV_REG_FS, X86_FS},
  51. { CV_REG_GS, X86_GS},
  52. { CV_REG_IP, X86_IP},
  53. { CV_REG_FLAGS, X86_FL},
  54. { CV_REG_EIP, X86_EIP},
  55. { CV_REG_EFLAGS, X86_EFL},
  56. // { CV_REG_TEMP, REGTEMP},
  57. // { CV_REG_TEMPH, REGTEMPH},
  58. // { CV_REG_QUOTE, REGQUOTE},
  59. // { CV_REG_PCDR3, REGPCDR3},
  60. // { CV_REG_PCDR4, REGPCDR4},
  61. // { CV_REG_PCDR5, REGPCDR5},
  62. // { CV_REG_PCDR6, REGPCDR6},
  63. // { CV_REG_PCDR7, REGPCDR7},
  64. { CV_REG_CR0, X86_CR0},
  65. // { CV_REG_CR1, REGCR1},
  66. { CV_REG_CR2, X86_CR2},
  67. { CV_REG_CR3, X86_CR3},
  68. { CV_REG_CR4, X86_CR4},
  69. { CV_REG_DR0, X86_DR0},
  70. { CV_REG_DR1, X86_DR1},
  71. { CV_REG_DR2, X86_DR2},
  72. { CV_REG_DR3, X86_DR3},
  73. // { CV_REG_DR4, REGDR4},
  74. // { CV_REG_DR5, REGDR5},
  75. { CV_REG_DR6, X86_DR6},
  76. { CV_REG_DR7, X86_DR7},
  77. { CV_REG_GDTR, X86_GDTR},
  78. { CV_REG_GDTL, X86_GDTL},
  79. { CV_REG_IDTR, X86_IDTR},
  80. { CV_REG_IDTL, X86_IDTL},
  81. { CV_REG_LDTR, X86_LDTR},
  82. { CV_REG_TR, X86_TR},
  83. // { CV_REG_PSEUDO1, REGPSEUDO1},
  84. // { CV_REG_PSEUDO2, REGPSEUDO2},
  85. // { CV_REG_PSEUDO3, REGPSEUDO3},
  86. // { CV_REG_PSEUDO4, REGPSEUDO4},
  87. // { CV_REG_PSEUDO5, REGPSEUDO5},
  88. // { CV_REG_PSEUDO6, REGPSEUDO6},
  89. // { CV_REG_PSEUDO7, REGPSEUDO7},
  90. // { CV_REG_PSEUDO8, REGPSEUDO8},
  91. // { CV_REG_PSEUDO9, REGPSEUDO9},
  92. { CV_REG_ST0, X86_ST0},
  93. { CV_REG_ST1, X86_ST1},
  94. { CV_REG_ST2, X86_ST2},
  95. { CV_REG_ST3, X86_ST3},
  96. { CV_REG_ST4, X86_ST4},
  97. { CV_REG_ST5, X86_ST5},
  98. { CV_REG_ST6, X86_ST6},
  99. { CV_REG_ST7, X86_ST7},
  100. { CV_REG_CTRL, X86_FPCW},
  101. { CV_REG_STAT, X86_FPSW},
  102. { CV_REG_TAG, X86_FPTW},
  103. // { CV_REG_FPIP, REGFPIP},
  104. // { CV_REG_FPCS, REGFPCS},
  105. // { CV_REG_FPDO, REGFPDO},
  106. // { CV_REG_FPDS, REGFPDS},
  107. // { CV_REG_ISEM, REGISEM},
  108. // { CV_REG_FPEIP, REGFPEIP},
  109. // { CV_REG_FPEDO, REGFPEDO},
  110. { CV_REG_MM0, X86_MM0},
  111. { CV_REG_MM1, X86_MM1},
  112. { CV_REG_MM2, X86_MM2},
  113. { CV_REG_MM3, X86_MM3},
  114. { CV_REG_MM4, X86_MM4},
  115. { CV_REG_MM5, X86_MM5},
  116. { CV_REG_MM6, X86_MM6},
  117. { CV_REG_MM7, X86_MM7},
  118. };
  119. REGISTER_LOOKUP gRegLookupIa64[] = {
  120. // Branch Registers
  121. { CV_IA64_Br0, BRRP},
  122. { CV_IA64_Br1, BRS0},
  123. { CV_IA64_Br2, BRS1},
  124. { CV_IA64_Br3, BRS2},
  125. { CV_IA64_Br4, BRS3},
  126. { CV_IA64_Br5, BRS4},
  127. { CV_IA64_Br6, BRT0},
  128. { CV_IA64_Br7, BRT1},
  129. // Predicate Registers
  130. { CV_IA64_Preds, PREDS},
  131. // Banked General Registers
  132. /*
  133. { CV_IA64_IntH0, IntH0},
  134. { CV_IA64_IntH1, IntH1},
  135. { CV_IA64_IntH2, IntH2},
  136. { CV_IA64_IntH3, IntH3},
  137. { CV_IA64_IntH4, IntH4},
  138. { CV_IA64_IntH5, IntH5},
  139. { CV_IA64_IntH6, IntH6},
  140. { CV_IA64_IntH7, IntH7},
  141. { CV_IA64_IntH8, IntH8},
  142. { CV_IA64_IntH9, IntH9},
  143. { CV_IA64_IntH10, IntH10},
  144. { CV_IA64_IntH11, IntH11},
  145. { CV_IA64_IntH12, IntH12},
  146. { CV_IA64_IntH13, IntH13},
  147. { CV_IA64_IntH14, IntH14},
  148. { CV_IA64_IntH15, IntH15},
  149. // Special Registers
  150. { CV_IA64_Ip, Ip},
  151. { CV_IA64_Umask, Umask},
  152. { CV_IA64_Cfm, Cfm},
  153. { CV_IA64_Psr, Psr},
  154. // Banked General Registers
  155. { CV_IA64_Nats, Nats},
  156. { CV_IA64_Nats2, Nats2},
  157. { CV_IA64_Nats3, Nats3},
  158. */
  159. // General-Purpose Registers
  160. // INTEGER REGISTER
  161. // { CV_IA64_IntR0, IntZero},
  162. { CV_IA64_IntR1, INTGP},
  163. { CV_IA64_IntR2, INTT0},
  164. { CV_IA64_IntR3, INTT1},
  165. { CV_IA64_IntR4, INTS0},
  166. { CV_IA64_IntR5, INTS1},
  167. { CV_IA64_IntR6, INTS2},
  168. { CV_IA64_IntR7, INTS3},
  169. { CV_IA64_IntR8, INTV0},
  170. // { CV_IA64_IntR9, INTAP},
  171. { CV_IA64_IntR10, INTT2},
  172. { CV_IA64_IntR11, INTT3},
  173. { CV_IA64_IntR12, INTSP},
  174. { CV_IA64_IntR13, INTT4},
  175. { CV_IA64_IntR14, INTT5},
  176. { CV_IA64_IntR15, INTT6},
  177. { CV_IA64_IntR16, INTT7},
  178. { CV_IA64_IntR17, INTT8},
  179. { CV_IA64_IntR18, INTT9},
  180. { CV_IA64_IntR19, INTT10},
  181. { CV_IA64_IntR20, INTT11},
  182. { CV_IA64_IntR21, INTT12},
  183. { CV_IA64_IntR22, INTT13},
  184. { CV_IA64_IntR23, INTT14},
  185. { CV_IA64_IntR24, INTT15},
  186. { CV_IA64_IntR25, INTT16},
  187. { CV_IA64_IntR26, INTT17},
  188. { CV_IA64_IntR27, INTT18},
  189. { CV_IA64_IntR28, INTT19},
  190. { CV_IA64_IntR29, INTT20},
  191. { CV_IA64_IntR30, INTT21},
  192. { CV_IA64_IntR31, INTT22},
  193. // Register Stack
  194. { CV_IA64_IntR32, INTR32},
  195. { CV_IA64_IntR33, INTR33},
  196. { CV_IA64_IntR34, INTR34},
  197. { CV_IA64_IntR35, INTR35},
  198. { CV_IA64_IntR36, INTR36},
  199. { CV_IA64_IntR37, INTR37},
  200. { CV_IA64_IntR38, INTR38},
  201. { CV_IA64_IntR39, INTR39},
  202. { CV_IA64_IntR40, INTR40},
  203. { CV_IA64_IntR41, INTR41},
  204. { CV_IA64_IntR42, INTR42},
  205. { CV_IA64_IntR43, INTR43},
  206. { CV_IA64_IntR44, INTR44},
  207. { CV_IA64_IntR45, INTR45},
  208. { CV_IA64_IntR46, INTR46},
  209. { CV_IA64_IntR47, INTR47},
  210. { CV_IA64_IntR48, INTR48},
  211. { CV_IA64_IntR49, INTR49},
  212. { CV_IA64_IntR50, INTR50},
  213. { CV_IA64_IntR51, INTR51},
  214. { CV_IA64_IntR52, INTR52},
  215. { CV_IA64_IntR53, INTR53},
  216. { CV_IA64_IntR54, INTR54},
  217. { CV_IA64_IntR55, INTR55},
  218. { CV_IA64_IntR56, INTR56},
  219. { CV_IA64_IntR57, INTR57},
  220. { CV_IA64_IntR58, INTR58},
  221. { CV_IA64_IntR59, INTR59},
  222. { CV_IA64_IntR60, INTR60},
  223. { CV_IA64_IntR61, INTR61},
  224. { CV_IA64_IntR62, INTR62},
  225. { CV_IA64_IntR63, INTR63},
  226. { CV_IA64_IntR64, INTR64},
  227. { CV_IA64_IntR65, INTR65},
  228. { CV_IA64_IntR66, INTR66},
  229. { CV_IA64_IntR67, INTR67},
  230. { CV_IA64_IntR68, INTR68},
  231. { CV_IA64_IntR69, INTR69},
  232. { CV_IA64_IntR70, INTR70},
  233. { CV_IA64_IntR71, INTR71},
  234. { CV_IA64_IntR72, INTR72},
  235. { CV_IA64_IntR73, INTR73},
  236. { CV_IA64_IntR74, INTR74},
  237. { CV_IA64_IntR75, INTR75},
  238. { CV_IA64_IntR76, INTR76},
  239. { CV_IA64_IntR77, INTR77},
  240. { CV_IA64_IntR78, INTR78},
  241. { CV_IA64_IntR79, INTR79},
  242. { CV_IA64_IntR80, INTR80},
  243. { CV_IA64_IntR81, INTR81},
  244. { CV_IA64_IntR82, INTR82},
  245. { CV_IA64_IntR83, INTR83},
  246. { CV_IA64_IntR84, INTR84},
  247. { CV_IA64_IntR85, INTR85},
  248. { CV_IA64_IntR86, INTR86},
  249. { CV_IA64_IntR87, INTR87},
  250. { CV_IA64_IntR88, INTR88},
  251. { CV_IA64_IntR89, INTR89},
  252. { CV_IA64_IntR90, INTR90},
  253. { CV_IA64_IntR91, INTR91},
  254. { CV_IA64_IntR92, INTR92},
  255. { CV_IA64_IntR93, INTR93},
  256. { CV_IA64_IntR94, INTR94},
  257. { CV_IA64_IntR95, INTR95},
  258. { CV_IA64_IntR96, INTR96},
  259. { CV_IA64_IntR97, INTR97},
  260. { CV_IA64_IntR98, INTR98},
  261. { CV_IA64_IntR99, INTR99},
  262. { CV_IA64_IntR100, INTR100},
  263. { CV_IA64_IntR101, INTR101},
  264. { CV_IA64_IntR102, INTR102},
  265. { CV_IA64_IntR103, INTR103},
  266. { CV_IA64_IntR104, INTR104},
  267. { CV_IA64_IntR105, INTR105},
  268. { CV_IA64_IntR106, INTR106},
  269. { CV_IA64_IntR107, INTR107},
  270. { CV_IA64_IntR108, INTR108},
  271. { CV_IA64_IntR109, INTR109},
  272. { CV_IA64_IntR110, INTR110},
  273. { CV_IA64_IntR111, INTR111},
  274. { CV_IA64_IntR112, INTR112},
  275. { CV_IA64_IntR113, INTR113},
  276. { CV_IA64_IntR114, INTR114},
  277. { CV_IA64_IntR115, INTR115},
  278. { CV_IA64_IntR116, INTR116},
  279. { CV_IA64_IntR117, INTR117},
  280. { CV_IA64_IntR118, INTR118},
  281. { CV_IA64_IntR119, INTR119},
  282. { CV_IA64_IntR120, INTR120},
  283. { CV_IA64_IntR121, INTR121},
  284. { CV_IA64_IntR122, INTR122},
  285. { CV_IA64_IntR123, INTR123},
  286. { CV_IA64_IntR124, INTR124},
  287. { CV_IA64_IntR125, INTR125},
  288. { CV_IA64_IntR126, INTR126},
  289. { CV_IA64_IntR127, INTR127},
  290. // Floating-Point Registers
  291. // Low Floating Point Registers
  292. // { CV_IA64_FltF0, FltZero},
  293. // { CV_IA64_FltF1, FltOne},
  294. { CV_IA64_FltF2, FLTS0},
  295. { CV_IA64_FltF3, FLTS1},
  296. { CV_IA64_FltF4, FLTS2},
  297. { CV_IA64_FltF5, FLTS3},
  298. { CV_IA64_FltF6, FLTT0},
  299. { CV_IA64_FltF7, FLTT1},
  300. { CV_IA64_FltF8, FLTT2},
  301. { CV_IA64_FltF9, FLTT3},
  302. { CV_IA64_FltF10, FLTT4},
  303. { CV_IA64_FltF11, FLTT5},
  304. { CV_IA64_FltF12, FLTT6},
  305. { CV_IA64_FltF13, FLTT7},
  306. { CV_IA64_FltF14, FLTT8},
  307. { CV_IA64_FltF15, FLTT9},
  308. { CV_IA64_FltF16, FLTS4},
  309. { CV_IA64_FltF17, FLTS5},
  310. { CV_IA64_FltF18, FLTS6},
  311. { CV_IA64_FltF19, FLTS7},
  312. { CV_IA64_FltF20, FLTS8},
  313. { CV_IA64_FltF21, FLTS9},
  314. { CV_IA64_FltF22, FLTS10},
  315. { CV_IA64_FltF23, FLTS11},
  316. { CV_IA64_FltF24, FLTS12},
  317. { CV_IA64_FltF25, FLTS13},
  318. { CV_IA64_FltF26, FLTS14},
  319. { CV_IA64_FltF27, FLTS15},
  320. { CV_IA64_FltF28, FLTS16},
  321. { CV_IA64_FltF29, FLTS17},
  322. { CV_IA64_FltF30, FLTS18},
  323. { CV_IA64_FltF31, FLTS19},
  324. // High Floating POINT REGISters
  325. { CV_IA64_FltF32, FLTF32},
  326. { CV_IA64_FltF33, FLTF33},
  327. { CV_IA64_FltF34, FLTF34},
  328. { CV_IA64_FltF35, FLTF35},
  329. { CV_IA64_FltF36, FLTF36},
  330. { CV_IA64_FltF37, FLTF37},
  331. { CV_IA64_FltF38, FLTF38},
  332. { CV_IA64_FltF39, FLTF39},
  333. { CV_IA64_FltF40, FLTF40},
  334. { CV_IA64_FltF41, FLTF41},
  335. { CV_IA64_FltF42, FLTF42},
  336. { CV_IA64_FltF43, FLTF43},
  337. { CV_IA64_FltF44, FLTF44},
  338. { CV_IA64_FltF45, FLTF45},
  339. { CV_IA64_FltF46, FLTF46},
  340. { CV_IA64_FltF47, FLTF47},
  341. { CV_IA64_FltF48, FLTF48},
  342. { CV_IA64_FltF49, FLTF49},
  343. { CV_IA64_FltF50, FLTF50},
  344. { CV_IA64_FltF51, FLTF51},
  345. { CV_IA64_FltF52, FLTF52},
  346. { CV_IA64_FltF53, FLTF53},
  347. { CV_IA64_FltF54, FLTF54},
  348. { CV_IA64_FltF55, FLTF55},
  349. { CV_IA64_FltF56, FLTF56},
  350. { CV_IA64_FltF57, FLTF57},
  351. { CV_IA64_FltF58, FLTF58},
  352. { CV_IA64_FltF59, FLTF59},
  353. { CV_IA64_FltF60, FLTF60},
  354. { CV_IA64_FltF61, FLTF61},
  355. { CV_IA64_FltF62, FLTF62},
  356. { CV_IA64_FltF63, FLTF63},
  357. { CV_IA64_FltF64, FLTF64},
  358. { CV_IA64_FltF65, FLTF65},
  359. { CV_IA64_FltF66, FLTF66},
  360. { CV_IA64_FltF67, FLTF67},
  361. { CV_IA64_FltF68, FLTF68},
  362. { CV_IA64_FltF69, FLTF69},
  363. { CV_IA64_FltF70, FLTF70},
  364. { CV_IA64_FltF71, FLTF71},
  365. { CV_IA64_FltF72, FLTF72},
  366. { CV_IA64_FltF73, FLTF73},
  367. { CV_IA64_FltF74, FLTF74},
  368. { CV_IA64_FltF75, FLTF75},
  369. { CV_IA64_FltF76, FLTF76},
  370. { CV_IA64_FltF77, FLTF77},
  371. { CV_IA64_FltF78, FLTF78},
  372. { CV_IA64_FltF79, FLTF79},
  373. { CV_IA64_FltF80, FLTF80},
  374. { CV_IA64_FltF81, FLTF81},
  375. { CV_IA64_FltF82, FLTF82},
  376. { CV_IA64_FltF83, FLTF83},
  377. { CV_IA64_FltF84, FLTF84},
  378. { CV_IA64_FltF85, FLTF85},
  379. { CV_IA64_FltF86, FLTF86},
  380. { CV_IA64_FltF87, FLTF87},
  381. { CV_IA64_FltF88, FLTF88},
  382. { CV_IA64_FltF89, FLTF89},
  383. { CV_IA64_FltF90, FLTF90},
  384. { CV_IA64_FltF91, FLTF91},
  385. { CV_IA64_FltF92, FLTF92},
  386. { CV_IA64_FltF93, FLTF93},
  387. { CV_IA64_FltF94, FLTF94},
  388. { CV_IA64_FltF95, FLTF95},
  389. { CV_IA64_FltF96, FLTF96},
  390. { CV_IA64_FltF97, FLTF97},
  391. { CV_IA64_FltF98, FLTF98},
  392. { CV_IA64_FltF99, FLTF99},
  393. { CV_IA64_FltF100, FLTF100},
  394. { CV_IA64_FltF101, FLTF101},
  395. { CV_IA64_FltF102, FLTF102},
  396. { CV_IA64_FltF103, FLTF103},
  397. { CV_IA64_FltF104, FLTF104},
  398. { CV_IA64_FltF105, FLTF105},
  399. { CV_IA64_FltF106, FLTF106},
  400. { CV_IA64_FltF107, FLTF107},
  401. { CV_IA64_FltF108, FLTF108},
  402. { CV_IA64_FltF109, FLTF109},
  403. { CV_IA64_FltF110, FLTF110},
  404. { CV_IA64_FltF111, FLTF111},
  405. { CV_IA64_FltF112, FLTF112},
  406. { CV_IA64_FltF113, FLTF113},
  407. { CV_IA64_FltF114, FLTF114},
  408. { CV_IA64_FltF115, FLTF115},
  409. { CV_IA64_FltF116, FLTF116},
  410. { CV_IA64_FltF117, FLTF117},
  411. { CV_IA64_FltF118, FLTF118},
  412. { CV_IA64_FltF119, FLTF119},
  413. { CV_IA64_FltF120, FLTF120},
  414. { CV_IA64_FltF121, FLTF121},
  415. { CV_IA64_FltF122, FLTF122},
  416. { CV_IA64_FltF123, FLTF123},
  417. { CV_IA64_FltF124, FLTF124},
  418. { CV_IA64_FltF125, FLTF125},
  419. { CV_IA64_FltF126, FLTF126},
  420. { CV_IA64_FltF127, FLTF127},
  421. // Application Registers
  422. { CV_IA64_ApKR0, APKR0},
  423. { CV_IA64_ApKR1, APKR1},
  424. { CV_IA64_ApKR2, APKR2},
  425. { CV_IA64_ApKR3, APKR3},
  426. { CV_IA64_ApKR4, APKR4},
  427. { CV_IA64_ApKR5, APKR5},
  428. { CV_IA64_ApKR6, APKR6},
  429. { CV_IA64_ApKR7, APKR7},
  430. /* { CV_IA64_AR8, AR8},
  431. { CV_IA64_AR9, AR9},
  432. { CV_IA64_AR10, AR10},
  433. { CV_IA64_AR11, AR11},
  434. { CV_IA64_AR12, AR12},
  435. { CV_IA64_AR13, AR13},
  436. { CV_IA64_AR14, AR14},
  437. { CV_IA64_AR15, AR15},*/
  438. { CV_IA64_RsRSC, RSRSC},
  439. { CV_IA64_RsBSP, RSBSP},
  440. { CV_IA64_RsBSPSTORE, RSBSPSTORE},
  441. { CV_IA64_RsRNAT, RSRNAT},
  442. // { CV_IA64_AR20, AR20},
  443. { CV_IA64_StFCR, StFCR},
  444. // { CV_IA64_AR22, AR22},
  445. // { CV_IA64_AR23, AR23},
  446. { CV_IA64_EFLAG, Eflag},
  447. { CV_IA64_CSD, SegCSD},
  448. { CV_IA64_SSD, SegSSD},
  449. { CV_IA64_CFLG, Cflag},
  450. { CV_IA64_StFSR, STFSR},
  451. { CV_IA64_StFIR, STFIR},
  452. { CV_IA64_StFDR, STFDR},
  453. // { CV_IA64_AR31, AR31},
  454. { CV_IA64_ApCCV, APCCV},
  455. // { CV_IA64_AR33, AR33},
  456. // { CV_IA64_AR34, AR34},
  457. // { CV_IA64_AR35, AR35},
  458. { CV_IA64_ApUNAT, APUNAT},
  459. // { CV_IA64_AR37, AR37},
  460. // { CV_IA64_AR38, AR38},
  461. // { CV_IA64_AR39, AR39},
  462. { CV_IA64_StFPSR, STFPSR},
  463. // { CV_IA64_AR41, AR41},
  464. // { CV_IA64_AR42, AR42},
  465. // { CV_IA64_AR43, AR43},
  466. { CV_IA64_ApITC, APITC},
  467. /* { CV_IA64_AR45, AR45},
  468. { CV_IA64_AR46, AR46},
  469. { CV_IA64_AR47, AR47},
  470. { CV_IA64_AR48, AR48},
  471. { CV_IA64_AR49, AR49},
  472. { CV_IA64_AR50, AR50},
  473. { CV_IA64_AR51, AR51},
  474. { CV_IA64_AR52, AR52},
  475. { CV_IA64_AR53, AR53},
  476. { CV_IA64_AR54, AR54},
  477. { CV_IA64_AR55, AR55},
  478. { CV_IA64_AR56, AR56},
  479. { CV_IA64_AR57, AR57},
  480. { CV_IA64_AR58, AR58},
  481. { CV_IA64_AR59, AR59},
  482. { CV_IA64_AR60, AR60},
  483. { CV_IA64_AR61, AR61},
  484. { CV_IA64_AR62, AR62},
  485. { CV_IA64_AR63, AR63},*/
  486. { CV_IA64_RsPFS, RSPFS},
  487. { CV_IA64_ApLC, APLC},
  488. { CV_IA64_ApEC, APEC},
  489. /* { CV_IA64_AR67, AR67},
  490. { CV_IA64_AR68, AR68},
  491. { CV_IA64_AR69, AR69},
  492. { CV_IA64_AR70, AR70},
  493. { CV_IA64_AR71, AR71},
  494. { CV_IA64_AR72, AR72},
  495. { CV_IA64_AR73, AR73},
  496. { CV_IA64_AR74, AR74},
  497. { CV_IA64_AR75, AR75},
  498. { CV_IA64_AR76, AR76},
  499. { CV_IA64_AR77, AR77},
  500. { CV_IA64_AR78, AR78},
  501. { CV_IA64_AR79, AR79},
  502. { CV_IA64_AR80, AR80},
  503. { CV_IA64_AR81, AR81},
  504. { CV_IA64_AR82, AR82},
  505. { CV_IA64_AR83, AR83},
  506. { CV_IA64_AR84, AR84},
  507. { CV_IA64_AR85, AR85},
  508. { CV_IA64_AR86, AR86},
  509. { CV_IA64_AR87, AR87},
  510. { CV_IA64_AR88, AR88},
  511. { CV_IA64_AR89, AR89},
  512. { CV_IA64_AR90, AR90},
  513. { CV_IA64_AR91, AR91},
  514. { CV_IA64_AR92, AR92},
  515. { CV_IA64_AR93, AR93},
  516. { CV_IA64_AR94, AR94},
  517. { CV_IA64_AR95, AR95},
  518. { CV_IA64_AR96, AR96},
  519. { CV_IA64_AR97, AR97},
  520. { CV_IA64_AR98, AR98},
  521. { CV_IA64_AR99, AR99},
  522. { CV_IA64_AR100, AR100},
  523. { CV_IA64_AR101, AR101},
  524. { CV_IA64_AR102, AR102},
  525. { CV_IA64_AR103, AR103},
  526. { CV_IA64_AR104, AR104},
  527. { CV_IA64_AR105, AR105},
  528. { CV_IA64_AR106, AR106},
  529. { CV_IA64_AR107, AR107},
  530. { CV_IA64_AR108, AR108},
  531. { CV_IA64_AR109, AR109},
  532. { CV_IA64_AR110, AR110},
  533. { CV_IA64_AR111, AR111},
  534. { CV_IA64_AR112, AR112},
  535. { CV_IA64_AR113, AR113},
  536. { CV_IA64_AR114, AR114},
  537. { CV_IA64_AR115, AR115},
  538. { CV_IA64_AR116, AR116},
  539. { CV_IA64_AR117, AR117},
  540. { CV_IA64_AR118, AR118},
  541. { CV_IA64_AR119, AR119},
  542. { CV_IA64_AR120, AR120},
  543. { CV_IA64_AR121, AR121},
  544. { CV_IA64_AR122, AR122},
  545. { CV_IA64_AR123, AR123},
  546. { CV_IA64_AR124, AR124},
  547. { CV_IA64_AR125, AR125},
  548. { CV_IA64_AR126, AR126},
  549. { CV_IA64_AR127, AR127},
  550. */
  551. // Control RegisteRS
  552. { CV_IA64_ApDCR, APDCR},
  553. { CV_IA64_ApITM, APITM},
  554. { CV_IA64_ApIVA, APIVA},
  555. // { CV_IA64_CR3, CR3},
  556. // { CV_IA64_CR4, CR4},
  557. // { CV_IA64_CR5, CR5},
  558. // { CV_IA64_CR6, CR6},
  559. // { CV_IA64_CR7, CR7},
  560. { CV_IA64_ApPTA, APPTA},
  561. // { CV_IA64_CR9, CR9},
  562. // { CV_IA64_CR10, CR10},
  563. // { CV_IA64_CR11, CR11},
  564. // { CV_IA64_CR12, CR12},
  565. // { CV_IA64_CR13, CR13},
  566. // { CV_IA64_CR14, CR14},
  567. // { CV_IA64_CR15, CR15},
  568. { CV_IA64_StIPSR, STIPSR},
  569. { CV_IA64_StISR, STISR},
  570. { CV_IA64_CR18, STIDA},
  571. { CV_IA64_StIIP, STIIP},
  572. // { CV_IA64_StIDTR, STIDTR},
  573. { CV_IA64_StIFA, STIITR},
  574. { CV_IA64_StIIPA, STIIPA},
  575. { CV_IA64_StIFS, STIFS},
  576. { CV_IA64_StIIM, STIIM},
  577. { CV_IA64_StIHA, STIHA},
  578. /* { CV_IA64_CR26, CR26},
  579. { CV_IA64_CR27, CR27},
  580. { CV_IA64_CR28, CR28},
  581. { CV_IA64_CR29, CR29},
  582. { CV_IA64_CR30, CR30},
  583. { CV_IA64_CR31, CR31},
  584. { CV_IA64_CR32, CR32},
  585. { CV_IA64_CR33, CR33},
  586. { CV_IA64_CR34, CR34},
  587. { CV_IA64_CR35, CR35},
  588. { CV_IA64_CR36, CR36},
  589. { CV_IA64_CR37, CR37},
  590. { CV_IA64_CR38, CR38},
  591. { CV_IA64_CR39, CR39},
  592. { CV_IA64_CR40, CR40},
  593. { CV_IA64_CR41, CR41},
  594. { CV_IA64_CR42, CR42},
  595. { CV_IA64_CR43, CR43},
  596. { CV_IA64_CR44, CR44},
  597. { CV_IA64_CR45, CR45},
  598. { CV_IA64_CR46, CR46},
  599. { CV_IA64_CR47, CR47},
  600. { CV_IA64_CR48, CR48},
  601. { CV_IA64_CR49, CR49},
  602. { CV_IA64_CR50, CR50},
  603. { CV_IA64_CR51, CR51},
  604. { CV_IA64_CR52, CR52},
  605. { CV_IA64_CR53, CR53},
  606. { CV_IA64_CR54, CR54},
  607. { CV_IA64_CR55, CR55},
  608. { CV_IA64_CR56, CR56},
  609. { CV_IA64_CR57, CR57},
  610. { CV_IA64_CR58, CR58},
  611. { CV_IA64_CR59, CR59},
  612. { CV_IA64_CR60, CR60},
  613. { CV_IA64_CR61, CR61},
  614. { CV_IA64_CR62, CR62},
  615. { CV_IA64_CR63, CR63},
  616. { CV_IA64_CR64, CR64},
  617. { CV_IA64_CR65, CR65},*/
  618. { CV_IA64_SaLID, SALID},
  619. // { CV_IA64_CR67, CR67},
  620. // { CV_IA64_CR68, CR68},
  621. // { CV_IA64_CR69, CR69},
  622. // { CV_IA64_CR70, CR70},
  623. { CV_IA64_SaIVR, SAIVR},
  624. { CV_IA64_SaTPR, SATPR},
  625. // { CV_IA64_CR73, CR73},
  626. // { CV_IA64_CR74, CR74},
  627. { CV_IA64_SaEOI, SAEOI},
  628. /* { CV_IA64_CR76, CR76},
  629. { CV_IA64_CR77, CR77},
  630. { CV_IA64_CR78, CR78},
  631. { CV_IA64_CR79, CR79},
  632. { CV_IA64_CR80, CR80},
  633. { CV_IA64_CR81, CR81},
  634. { CV_IA64_CR82, CR82},
  635. { CV_IA64_CR83, CR83},
  636. { CV_IA64_CR84, CR84},
  637. { CV_IA64_CR85, CR85},
  638. { CV_IA64_CR86, CR86},
  639. { CV_IA64_CR87, CR87},
  640. { CV_IA64_CR88, CR88},
  641. { CV_IA64_CR89, CR89},
  642. { CV_IA64_CR90, CR90},
  643. { CV_IA64_CR91, CR91},
  644. { CV_IA64_CR92, CR92},
  645. { CV_IA64_CR93, CR93},
  646. { CV_IA64_CR94, CR94},
  647. { CV_IA64_CR95, CR95},*/
  648. { CV_IA64_SaIRR0, SAIRR0},
  649. // { CV_IA64_CR97, CR97},
  650. { CV_IA64_SaIRR1, SAIRR1},
  651. // { CV_IA64_CR99, CR99},
  652. { CV_IA64_SaIRR2, SAIRR2},
  653. // { CV_IA64_CR101, CR101},
  654. { CV_IA64_SaIRR3, SAIRR3},
  655. /* { CV_IA64_CR103, CR103},
  656. { CV_IA64_CR104, CR104},
  657. { CV_IA64_CR105, CR105},
  658. { CV_IA64_CR106, CR106},
  659. { CV_IA64_CR107, CR107},
  660. { CV_IA64_CR108, CR108},
  661. { CV_IA64_CR109, CR109},
  662. { CV_IA64_CR110, CR110},
  663. { CV_IA64_CR111, CR111},
  664. { CV_IA64_CR112, CR112},
  665. { CV_IA64_CR113, CR113},*/
  666. { CV_IA64_SaITV, SAITV},
  667. // { CV_IA64_CR115, CR115},
  668. { CV_IA64_SaPMV, SAPMV},
  669. { CV_IA64_SaLRR0, SALRR0},
  670. { CV_IA64_SaLRR1, SALRR1},
  671. { CV_IA64_SaCMCV, SACMCV},
  672. // { CV_IA64_CR120, CR120},
  673. // { CV_IA64_CR121, CR121},
  674. // { CV_IA64_CR122, CR122},
  675. // { CV_IA64_CR123, CR123},
  676. // { CV_IA64_CR124, CR124},
  677. // { CV_IA64_CR125, CR125},
  678. // { CV_IA64_CR126, CR126},
  679. // { CV_IA64_CR127, CR127},
  680. // Protection Key Registers
  681. { CV_IA64_Pkr0, SRPKR0},
  682. { CV_IA64_Pkr1, SRPKR1},
  683. { CV_IA64_Pkr2, SRPKR2},
  684. { CV_IA64_Pkr3, SRPKR3},
  685. { CV_IA64_Pkr4, SRPKR4},
  686. { CV_IA64_Pkr5, SRPKR5},
  687. { CV_IA64_Pkr6, SRPKR6},
  688. { CV_IA64_Pkr7, SRPKR7},
  689. { CV_IA64_Pkr8, SRPKR8},
  690. { CV_IA64_Pkr9, SRPKR9},
  691. { CV_IA64_Pkr10, SRPKR10},
  692. { CV_IA64_Pkr11, SRPKR11},
  693. { CV_IA64_Pkr12, SRPKR12},
  694. { CV_IA64_Pkr13, SRPKR13},
  695. { CV_IA64_Pkr14, SRPKR14},
  696. { CV_IA64_Pkr15, SRPKR15},
  697. // REGION REGISTERS
  698. { CV_IA64_Rr0, SRRR0},
  699. { CV_IA64_Rr1, SRRR1},
  700. { CV_IA64_Rr2, SRRR2},
  701. { CV_IA64_Rr3, SRRR3},
  702. { CV_IA64_Rr4, SRRR4},
  703. { CV_IA64_Rr5, SRRR5},
  704. { CV_IA64_Rr6, SRRR6},
  705. { CV_IA64_Rr7, SRRR7},
  706. // PERFORMANCE MONITOR DATA REGISTERS
  707. { CV_IA64_PFD0, KRPFD0},
  708. { CV_IA64_PFD1, KRPFD1},
  709. { CV_IA64_PFD2, KRPFD2},
  710. { CV_IA64_PFD3, KRPFD3},
  711. { CV_IA64_PFD4, KRPFD4},
  712. { CV_IA64_PFD5, KRPFD5},
  713. { CV_IA64_PFD6, KRPFD6},
  714. { CV_IA64_PFD7, KRPFD7},
  715. // PERFORMANCE MONITOR CONFIG REGISTERS
  716. { CV_IA64_PFC0, KRPFC0},
  717. { CV_IA64_PFC1, KRPFC1},
  718. { CV_IA64_PFC2, KRPFC2},
  719. { CV_IA64_PFC3, KRPFC3},
  720. { CV_IA64_PFC4, KRPFC4},
  721. { CV_IA64_PFC5, KRPFC5},
  722. { CV_IA64_PFC6, KRPFC6},
  723. { CV_IA64_PFC7, KRPFC7},
  724. // INSTRUCTION TRANSLATION REGISTERS
  725. { CV_IA64_TrI0, SRTRI0},
  726. { CV_IA64_TrI1, SRTRI1},
  727. { CV_IA64_TrI2, SRTRI2},
  728. { CV_IA64_TrI3, SRTRI3},
  729. { CV_IA64_TrI4, SRTRI4},
  730. { CV_IA64_TrI5, SRTRI5},
  731. { CV_IA64_TrI6, SRTRI6},
  732. { CV_IA64_TrI7, SRTRI7},
  733. // DATA TRANSLATION REGISTERS
  734. { CV_IA64_TrD0, SRTRD0},
  735. { CV_IA64_TrD1, SRTRD1},
  736. { CV_IA64_TrD2, SRTRD2},
  737. { CV_IA64_TrD3, SRTRD3},
  738. { CV_IA64_TrD4, SRTRD4},
  739. { CV_IA64_TrD5, SRTRD5},
  740. { CV_IA64_TrD6, SRTRD6},
  741. { CV_IA64_TrD7, SRTRD7},
  742. // INSTRUCTION BREAKPOINT REGISTERS
  743. { CV_IA64_DbI0, KRDBI0},
  744. { CV_IA64_DbI1, KRDBI1},
  745. { CV_IA64_DbI2, KRDBI2},
  746. { CV_IA64_DbI3, KRDBI3},
  747. { CV_IA64_DbI4, KRDBI4},
  748. { CV_IA64_DbI5, KRDBI5},
  749. { CV_IA64_DbI6, KRDBI6},
  750. { CV_IA64_DbI7, KRDBI7},
  751. // DATA BREAKPOINT REGISTERS
  752. { CV_IA64_DbD0, KRDBD0},
  753. { CV_IA64_DbD1, KRDBD1},
  754. { CV_IA64_DbD2, KRDBD2},
  755. { CV_IA64_DbD3, KRDBD3},
  756. { CV_IA64_DbD4, KRDBD4},
  757. { CV_IA64_DbD5, KRDBD5},
  758. { CV_IA64_DbD6, KRDBD6},
  759. { CV_IA64_DbD7, KRDBD7},
  760. };
  761. REGISTER_LOOKUP gRegLookupAlpha[] = {
  762. {CV_ALPHA_FltF0, ALPHA_F0},
  763. {CV_ALPHA_FltF1, ALPHA_F1},
  764. {CV_ALPHA_FltF2, ALPHA_F2},
  765. {CV_ALPHA_FltF3, ALPHA_F3},
  766. {CV_ALPHA_FltF4, ALPHA_F4},
  767. {CV_ALPHA_FltF5, ALPHA_F5},
  768. {CV_ALPHA_FltF6, ALPHA_F6},
  769. {CV_ALPHA_FltF7, ALPHA_F7},
  770. {CV_ALPHA_FltF8, ALPHA_F8},
  771. {CV_ALPHA_FltF9, ALPHA_F9},
  772. {CV_ALPHA_FltF10, ALPHA_F10},
  773. {CV_ALPHA_FltF11, ALPHA_F11},
  774. {CV_ALPHA_FltF12, ALPHA_F12},
  775. {CV_ALPHA_FltF13, ALPHA_F13},
  776. {CV_ALPHA_FltF14, ALPHA_F14},
  777. {CV_ALPHA_FltF15, ALPHA_F15},
  778. {CV_ALPHA_FltF16, ALPHA_F16},
  779. {CV_ALPHA_FltF17, ALPHA_F17},
  780. {CV_ALPHA_FltF18, ALPHA_F18},
  781. {CV_ALPHA_FltF19, ALPHA_F19},
  782. {CV_ALPHA_FltF20, ALPHA_F20},
  783. {CV_ALPHA_FltF21, ALPHA_F21},
  784. {CV_ALPHA_FltF22, ALPHA_F22},
  785. {CV_ALPHA_FltF23, ALPHA_F23},
  786. {CV_ALPHA_FltF24, ALPHA_F24},
  787. {CV_ALPHA_FltF25, ALPHA_F25},
  788. {CV_ALPHA_FltF26, ALPHA_F26},
  789. {CV_ALPHA_FltF27, ALPHA_F27},
  790. {CV_ALPHA_FltF28, ALPHA_F28},
  791. {CV_ALPHA_FltF29, ALPHA_F29},
  792. {CV_ALPHA_FltF30, ALPHA_F30},
  793. {CV_ALPHA_FltF31, ALPHA_F31},
  794. {CV_ALPHA_IntV0, ALPHA_V0},
  795. {CV_ALPHA_IntT0, ALPHA_T0},
  796. {CV_ALPHA_IntT1, ALPHA_T1},
  797. {CV_ALPHA_IntT2, ALPHA_T2},
  798. {CV_ALPHA_IntT3, ALPHA_T3},
  799. {CV_ALPHA_IntT4, ALPHA_T4},
  800. {CV_ALPHA_IntT5, ALPHA_T5},
  801. {CV_ALPHA_IntT6, ALPHA_T6},
  802. {CV_ALPHA_IntT7, ALPHA_T7},
  803. {CV_ALPHA_IntS0, ALPHA_S0},
  804. {CV_ALPHA_IntS1, ALPHA_S1},
  805. {CV_ALPHA_IntS2, ALPHA_S2},
  806. {CV_ALPHA_IntS3, ALPHA_S3},
  807. {CV_ALPHA_IntS4, ALPHA_S4},
  808. {CV_ALPHA_IntS5, ALPHA_S5},
  809. {CV_ALPHA_IntFP, ALPHA_FP},
  810. {CV_ALPHA_IntA0, ALPHA_A0},
  811. {CV_ALPHA_IntA1, ALPHA_A1},
  812. {CV_ALPHA_IntA2, ALPHA_A2},
  813. {CV_ALPHA_IntA3, ALPHA_A3},
  814. {CV_ALPHA_IntA4, ALPHA_A4},
  815. {CV_ALPHA_IntA5, ALPHA_A5},
  816. {CV_ALPHA_IntT8, ALPHA_T8},
  817. {CV_ALPHA_IntT9, ALPHA_T9},
  818. {CV_ALPHA_IntT10, ALPHA_T10},
  819. {CV_ALPHA_IntT11, ALPHA_T11},
  820. {CV_ALPHA_IntRA, ALPHA_RA},
  821. {CV_ALPHA_IntT12, ALPHA_T12},
  822. {CV_ALPHA_IntAT, ALPHA_AT},
  823. {CV_ALPHA_IntGP, ALPHA_GP},
  824. {CV_ALPHA_IntSP, ALPHA_SP},
  825. {CV_ALPHA_IntZERO, ALPHA_ZERO},
  826. {CV_ALPHA_Fpcr, ALPHA_FPCR},
  827. {CV_ALPHA_Fir, ALPHA_FIR},
  828. {CV_ALPHA_Psr, ALPHA_PSR},
  829. // {CV_ALPHA_FltFsr, REGFSR},
  830. {CV_ALPHA_SoftFpcr, ALPHA_SFTFPCR},
  831. };
  832. BOOL
  833. LookupRegID (
  834. IN ULONG CVReg,
  835. IN ULONG MachineType,
  836. OUT PULONG pDbgReg)
  837. {
  838. ULONG low, high, mid, Max;
  839. BOOL Found=FALSE;
  840. PREGISTER_LOOKUP ToLookup=&gRegLookupX86[0];
  841. if (MachineType == IMAGE_FILE_MACHINE_I386) {
  842. Max = sizeof (gRegLookupX86) / sizeof(REGISTER_LOOKUP);
  843. ToLookup = &gRegLookupX86[0];
  844. } else if (MachineType == IMAGE_FILE_MACHINE_IA64) {
  845. Max = sizeof (gRegLookupIa64) / sizeof(REGISTER_LOOKUP);
  846. ToLookup = &gRegLookupIa64[0];
  847. } else if (MachineType == IMAGE_FILE_MACHINE_AXP64 ||
  848. MachineType == IMAGE_FILE_MACHINE_ALPHA) {
  849. Max = sizeof (gRegLookupAlpha) / sizeof(REGISTER_LOOKUP);
  850. ToLookup = &gRegLookupAlpha[0];
  851. } else {
  852. return FALSE;
  853. }
  854. low = 0; high=Max;
  855. while (low <= high && !Found) {
  856. mid = (low + high)/2;
  857. if (ToLookup[mid].CVReg == CVReg) {
  858. *pDbgReg = ToLookup[mid].DbgReg;
  859. Found = TRUE;
  860. } else if (ToLookup[mid].CVReg < CVReg) {
  861. low = mid+1;
  862. } else {
  863. high = mid-1;
  864. }
  865. }
  866. return Found;
  867. }