1 | /* $Id: CPUMDbg.cpp 35410 2011-01-05 17:21:11Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * CPUM - CPU Monitor / Manager, Debugger & Debugging APIs.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_DBGF
|
---|
23 | #include <VBox/vmm/dbgf.h>
|
---|
24 | #include "DBGFInternal.h"
|
---|
25 | #include <VBox/vmm/vm.h>
|
---|
26 | #include <VBox/param.h>
|
---|
27 | #include <VBox/err.h>
|
---|
28 | #include <VBox/log.h>
|
---|
29 |
|
---|
30 |
|
---|
31 | static DECLCALLBACK(int) dbgfR3RegSet_seg(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
32 | {
|
---|
33 | return VERR_NOT_IMPLEMENTED;
|
---|
34 | }
|
---|
35 |
|
---|
36 | static DECLCALLBACK(int) dbgfR3RegGet_crX(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
37 | {
|
---|
38 | return VERR_NOT_IMPLEMENTED;
|
---|
39 | }
|
---|
40 |
|
---|
41 | static DECLCALLBACK(int) dbgfR3RegSet_crX(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
42 | {
|
---|
43 | return VERR_NOT_IMPLEMENTED;
|
---|
44 | }
|
---|
45 |
|
---|
46 | static DECLCALLBACK(int) dbgfR3RegGet_drX(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
47 | {
|
---|
48 | return VERR_NOT_IMPLEMENTED;
|
---|
49 | }
|
---|
50 |
|
---|
51 | static DECLCALLBACK(int) dbgfR3RegSet_drX(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
52 | {
|
---|
53 | return VERR_NOT_IMPLEMENTED;
|
---|
54 | }
|
---|
55 |
|
---|
56 | static DECLCALLBACK(int) dbgfR3RegGet_msr(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
57 | {
|
---|
58 | return VERR_NOT_IMPLEMENTED;
|
---|
59 | }
|
---|
60 |
|
---|
61 | static DECLCALLBACK(int) dbgfR3RegSet_msr(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
62 | {
|
---|
63 | return VERR_NOT_IMPLEMENTED;
|
---|
64 | }
|
---|
65 |
|
---|
66 | static DECLCALLBACK(int) dbgfR3RegGet_gdtr(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
67 | {
|
---|
68 | return VERR_NOT_IMPLEMENTED;
|
---|
69 | }
|
---|
70 |
|
---|
71 | static DECLCALLBACK(int) dbgfR3RegSet_gdtr(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
72 | {
|
---|
73 | return VERR_NOT_IMPLEMENTED;
|
---|
74 | }
|
---|
75 |
|
---|
76 | static DECLCALLBACK(int) dbgfR3RegGet_idtr(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
77 | {
|
---|
78 | return VERR_NOT_IMPLEMENTED;
|
---|
79 | }
|
---|
80 |
|
---|
81 | static DECLCALLBACK(int) dbgfR3RegSet_idtr(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
82 | {
|
---|
83 | return VERR_NOT_IMPLEMENTED;
|
---|
84 | }
|
---|
85 |
|
---|
86 | static DECLCALLBACK(int) dbgfR3RegGet_ftw(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
87 | {
|
---|
88 | return VERR_NOT_IMPLEMENTED;
|
---|
89 | }
|
---|
90 |
|
---|
91 | static DECLCALLBACK(int) dbgfR3RegSet_ftw(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
92 | {
|
---|
93 | return VERR_NOT_IMPLEMENTED;
|
---|
94 | }
|
---|
95 |
|
---|
96 | static DECLCALLBACK(int) dbgfR3RegGet_stN(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCCPUMCTX pCtx, PRTUINT128U puValue)
|
---|
97 | {
|
---|
98 | return VERR_NOT_IMPLEMENTED;
|
---|
99 | }
|
---|
100 |
|
---|
101 | static DECLCALLBACK(int) dbgfR3RegSet_stN(PVMCPU pVCpu, struct DBGFREGDESC const *pDesc, PCPUMCTX pCtx, RTUINT128U uValue, RTUINT128U fMask)
|
---|
102 | {
|
---|
103 | return VERR_NOT_IMPLEMENTED;
|
---|
104 | }
|
---|
105 |
|
---|
106 |
|
---|
107 |
|
---|
108 | /*
|
---|
109 | * Set up aliases.
|
---|
110 | */
|
---|
111 | #define DBGFREGALIAS_STD(Name, psz32, psz16, psz8) \
|
---|
112 | static DBGFREGALIAS const g_aDbgfRegAliases_##Name[] = \
|
---|
113 | { \
|
---|
114 | { psz32, DBGFREGVALTYPE_U32 }, \
|
---|
115 | { psz16, DBGFREGVALTYPE_U16 }, \
|
---|
116 | { psz8, DBGFREGVALTYPE_U8 }, \
|
---|
117 | { NULL, DBGFREGVALTYPE_INVALID } \
|
---|
118 | }
|
---|
119 | DBGFREGALIAS_STD(rax, "eax", "ax", "al");
|
---|
120 | DBGFREGALIAS_STD(rcx, "ecx", "cx", "cl");
|
---|
121 | DBGFREGALIAS_STD(rdx, "edx", "dx", "dl");
|
---|
122 | DBGFREGALIAS_STD(rbx, "ebx", "bx", "bl");
|
---|
123 | DBGFREGALIAS_STD(rsp, "esp", "sp", NULL);
|
---|
124 | DBGFREGALIAS_STD(rbp, "ebp", "bp", NULL);
|
---|
125 | DBGFREGALIAS_STD(rsi, "esi", "si", "sil");
|
---|
126 | DBGFREGALIAS_STD(rdi, "edi", "di", "dil");
|
---|
127 | DBGFREGALIAS_STD(r8, "r8d", "r8w", "r8b");
|
---|
128 | DBGFREGALIAS_STD(r9, "r9d", "r9w", "r9b");
|
---|
129 | DBGFREGALIAS_STD(r10, "r10d", "r10w", "r10b");
|
---|
130 | DBGFREGALIAS_STD(r11, "r11d", "r11w", "r11b");
|
---|
131 | DBGFREGALIAS_STD(r12, "r12d", "r12w", "r12b");
|
---|
132 | DBGFREGALIAS_STD(r13, "r13d", "r13w", "r13b");
|
---|
133 | DBGFREGALIAS_STD(r14, "r14d", "r14w", "r14b");
|
---|
134 | DBGFREGALIAS_STD(r15, "r15d", "r15w", "r15b");
|
---|
135 | DBGFREGALIAS_STD(rip, "eip", "ip", NULL);
|
---|
136 | DBGFREGALIAS_STD(rflags, "eflags", "flags", NULL);
|
---|
137 | #undef DBGFREGALIAS_STD
|
---|
138 |
|
---|
139 | static DBGFREGALIAS const g_aDbgfRegAliases_fpuip[] =
|
---|
140 | {
|
---|
141 | { "fpuip", DBGFREGVALTYPE_U16 },
|
---|
142 | { NULL, DBGFREGVALTYPE_INVALID }
|
---|
143 | };
|
---|
144 |
|
---|
145 | static DBGFREGALIAS const g_aDbgfRegAliases_fpudp[] =
|
---|
146 | {
|
---|
147 | { "fpudp", DBGFREGVALTYPE_U16 },
|
---|
148 | { NULL, DBGFREGVALTYPE_INVALID }
|
---|
149 | };
|
---|
150 |
|
---|
151 | static DBGFREGALIAS const g_aDbgfRegAliases_cr0[] =
|
---|
152 | {
|
---|
153 | { "msw", DBGFREGVALTYPE_U16 },
|
---|
154 | { NULL, DBGFREGVALTYPE_INVALID }
|
---|
155 | };
|
---|
156 |
|
---|
157 | /*
|
---|
158 | * Sub fields.
|
---|
159 | */
|
---|
160 | /** Sub-fields for the (hidden) segment attribute register. */
|
---|
161 | static DBGFREGSUBFIELD const g_aDbgfRegFields_seg[] =
|
---|
162 | {
|
---|
163 | { "type", 0, 4, 0 },
|
---|
164 | { "s", 4, 1, 0 },
|
---|
165 | { "dpl", 5, 2, 0 },
|
---|
166 | { "p", 7, 1, 0 },
|
---|
167 | { "avl", 12, 1, 0 },
|
---|
168 | { "l", 13, 1, 0 },
|
---|
169 | { "d", 14, 1, 0 },
|
---|
170 | { "g", 15, 1, 0 },
|
---|
171 | { NULL, 0, 0, 0 }
|
---|
172 | };
|
---|
173 |
|
---|
174 | /** Sub-fields for the flags register. */
|
---|
175 | static DBGFREGSUBFIELD const g_aDbgfRegFields_rflags[] =
|
---|
176 | {
|
---|
177 | { "cf", 0, 1, 0 },
|
---|
178 | { "pf", 2, 1, 0 },
|
---|
179 | { "af", 4, 1, 0 },
|
---|
180 | { "zf", 6, 1, 0 },
|
---|
181 | { "sf", 7, 1, 0 },
|
---|
182 | { "tf", 8, 1, 0 },
|
---|
183 | { "if", 9, 1, 0 },
|
---|
184 | { "df", 10, 1, 0 },
|
---|
185 | { "of", 11, 1, 0 },
|
---|
186 | { "iopl", 12, 2, 0 },
|
---|
187 | { "nt", 14, 1, 0 },
|
---|
188 | { "rf", 16, 1, 0 },
|
---|
189 | { "vm", 17, 1, 0 },
|
---|
190 | { "ac", 18, 1, 0 },
|
---|
191 | { "vif", 19, 1, 0 },
|
---|
192 | { "vip", 20, 1, 0 },
|
---|
193 | { "id", 21, 1, 0 },
|
---|
194 | { NULL, 0, 0, 0 }
|
---|
195 | };
|
---|
196 |
|
---|
197 | /** Sub-fields for the FPU control word register. */
|
---|
198 | static DBGFREGSUBFIELD const g_aDbgfRegFields_fcw[] =
|
---|
199 | {
|
---|
200 | { "im", 1, 1, 0 },
|
---|
201 | { "dm", 2, 1, 0 },
|
---|
202 | { "zm", 3, 1, 0 },
|
---|
203 | { "om", 4, 1, 0 },
|
---|
204 | { "um", 5, 1, 0 },
|
---|
205 | { "pm", 6, 1, 0 },
|
---|
206 | { "pc", 8, 2, 0 },
|
---|
207 | { "rc", 10, 2, 0 },
|
---|
208 | { "x", 12, 1, 0 },
|
---|
209 | { NULL, 0, 0, 0 }
|
---|
210 | };
|
---|
211 |
|
---|
212 | /** Sub-fields for the FPU status word register. */
|
---|
213 | static DBGFREGSUBFIELD const g_aDbgfRegFields_fsw[] =
|
---|
214 | {
|
---|
215 | { "ie", 0, 1, 0 },
|
---|
216 | { "de", 1, 1, 0 },
|
---|
217 | { "ze", 2, 1, 0 },
|
---|
218 | { "oe", 3, 1, 0 },
|
---|
219 | { "ue", 4, 1, 0 },
|
---|
220 | { "pe", 5, 1, 0 },
|
---|
221 | { "se", 6, 1, 0 },
|
---|
222 | { "es", 7, 1, 0 },
|
---|
223 | { "c0", 8, 1, 0 },
|
---|
224 | { "c1", 9, 1, 0 },
|
---|
225 | { "c2", 10, 1, 0 },
|
---|
226 | { "top", 11, 3, 0 },
|
---|
227 | { "c3", 14, 1, 0 },
|
---|
228 | { "b", 15, 1, 0 },
|
---|
229 | { NULL, 0, 0, 0 }
|
---|
230 | };
|
---|
231 |
|
---|
232 | /** Sub-fields for the FPU tag word register. */
|
---|
233 | static DBGFREGSUBFIELD const g_aDbgfRegFields_ftw[] =
|
---|
234 | {
|
---|
235 | { "tag0", 0, 2, 0 },
|
---|
236 | { "tag1", 2, 2, 0 },
|
---|
237 | { "tag2", 4, 2, 0 },
|
---|
238 | { "tag3", 6, 2, 0 },
|
---|
239 | { "tag4", 8, 2, 0 },
|
---|
240 | { "tag5", 10, 2, 0 },
|
---|
241 | { "tag6", 12, 2, 0 },
|
---|
242 | { "tag7", 14, 2, 0 },
|
---|
243 | { NULL, 0, 0, 0 }
|
---|
244 | };
|
---|
245 |
|
---|
246 | /** Sub-fields for the Multimedia Extensions Control and Status Register. */
|
---|
247 | static DBGFREGSUBFIELD const g_aDbgfRegFields_mxcsr[] =
|
---|
248 | {
|
---|
249 | { "ie", 0, 1, 0 },
|
---|
250 | { "de", 1, 1, 0 },
|
---|
251 | { "ze", 2, 1, 0 },
|
---|
252 | { "oe", 3, 1, 0 },
|
---|
253 | { "ue", 4, 1, 0 },
|
---|
254 | { "pe", 5, 1, 0 },
|
---|
255 | { "daz", 6, 1, 0 },
|
---|
256 | { "im", 7, 1, 0 },
|
---|
257 | { "dm", 8, 1, 0 },
|
---|
258 | { "zm", 9, 1, 0 },
|
---|
259 | { "om", 10, 1, 0 },
|
---|
260 | { "um", 11, 1, 0 },
|
---|
261 | { "pm", 12, 1, 0 },
|
---|
262 | { "rc", 13, 2, 0 },
|
---|
263 | { "fz", 14, 1, 0 },
|
---|
264 | { NULL, 0, 0, 0 }
|
---|
265 | };
|
---|
266 |
|
---|
267 | /** Sub-fields for the FPU tag word register. */
|
---|
268 | static DBGFREGSUBFIELD const g_aDbgfRegFields_stN[] =
|
---|
269 | {
|
---|
270 | { "man", 0, 64, 0 },
|
---|
271 | { "exp", 64, 15, 0 },
|
---|
272 | { "sig", 79, 1, 0 },
|
---|
273 | { NULL, 0, 0, 0 }
|
---|
274 | };
|
---|
275 |
|
---|
276 | /** Sub-fields for the MMX registers. */
|
---|
277 | static DBGFREGSUBFIELD const g_aDbgfRegFields_mmN[] =
|
---|
278 | {
|
---|
279 | { "dw0", 0, 32, 0 },
|
---|
280 | { "dw1", 32, 32, 0 },
|
---|
281 | { "w0", 0, 16, 0 },
|
---|
282 | { "w1", 16, 16, 0 },
|
---|
283 | { "w2", 32, 16, 0 },
|
---|
284 | { "w3", 48, 16, 0 },
|
---|
285 | { "b0", 0, 8, 0 },
|
---|
286 | { "b1", 8, 8, 0 },
|
---|
287 | { "b2", 16, 8, 0 },
|
---|
288 | { "b3", 24, 8, 0 },
|
---|
289 | { "b4", 32, 8, 0 },
|
---|
290 | { "b5", 40, 8, 0 },
|
---|
291 | { "b6", 48, 8, 0 },
|
---|
292 | { "b7", 56, 8, 0 },
|
---|
293 | { NULL, 0, 0, 0 }
|
---|
294 | };
|
---|
295 |
|
---|
296 | /** Sub-fields for the XMM registers. */
|
---|
297 | static DBGFREGSUBFIELD const g_aDbgfRegFields_xmmN[] =
|
---|
298 | {
|
---|
299 | { "r0", 0, 32, 0 },
|
---|
300 | { "r0.man", 0+ 0, 23, 0 },
|
---|
301 | { "r0.exp", 0+23, 8, 0 },
|
---|
302 | { "r0.sig", 0+31, 1, 0 },
|
---|
303 | { "r1", 32, 32, 0 },
|
---|
304 | { "r1.man", 32+ 0, 23, 0 },
|
---|
305 | { "r1.exp", 32+23, 8, 0 },
|
---|
306 | { "r1.sig", 32+31, 1, 0 },
|
---|
307 | { "r2", 64, 32, 0 },
|
---|
308 | { "r2.man", 64+ 0, 23, 0 },
|
---|
309 | { "r2.exp", 64+23, 8, 0 },
|
---|
310 | { "r2.sig", 64+31, 1, 0 },
|
---|
311 | { "r3", 96, 32, 0 },
|
---|
312 | { "r3.man", 96+ 0, 23, 0 },
|
---|
313 | { "r3.exp", 96+23, 8, 0 },
|
---|
314 | { "r3.sig", 96+31, 1, 0 },
|
---|
315 | { NULL, 0, 0, 0 }
|
---|
316 | };
|
---|
317 |
|
---|
318 | /** Sub-fields for the CR0 register. */
|
---|
319 | static DBGFREGSUBFIELD const g_aDbgfRegFields_cr0[] =
|
---|
320 | {
|
---|
321 | /** @todo */
|
---|
322 | { NULL, 0, 0, 0 }
|
---|
323 | };
|
---|
324 |
|
---|
325 | /** Sub-fields for the CR3 register. */
|
---|
326 | static DBGFREGSUBFIELD const g_aDbgfRegFields_cr3[] =
|
---|
327 | {
|
---|
328 | /** @todo */
|
---|
329 | { NULL, 0, 0, 0 }
|
---|
330 | };
|
---|
331 |
|
---|
332 | /** Sub-fields for the CR4 register. */
|
---|
333 | static DBGFREGSUBFIELD const g_aDbgfRegFields_cr4[] =
|
---|
334 | {
|
---|
335 | /** @todo */
|
---|
336 | { NULL, 0, 0, 0 }
|
---|
337 | };
|
---|
338 |
|
---|
339 | /** Sub-fields for the DR6 register. */
|
---|
340 | static DBGFREGSUBFIELD const g_aDbgfRegFields_dr6[] =
|
---|
341 | {
|
---|
342 | /** @todo */
|
---|
343 | { NULL, 0, 0, 0 }
|
---|
344 | };
|
---|
345 |
|
---|
346 | /** Sub-fields for the DR7 register. */
|
---|
347 | static DBGFREGSUBFIELD const g_aDbgfRegFields_dr7[] =
|
---|
348 | {
|
---|
349 | /** @todo */
|
---|
350 | { NULL, 0, 0, 0 }
|
---|
351 | };
|
---|
352 |
|
---|
353 | /** Sub-fields for the CR_PAT MSR. */
|
---|
354 | static DBGFREGSUBFIELD const g_aDbgfRegFields_apic_base[] =
|
---|
355 | {
|
---|
356 | { "bsp", 8, 1, 0 },
|
---|
357 | { "ge", 9, 1, 0 },
|
---|
358 | { "base", 12, 20, 12 },
|
---|
359 | { NULL, 0, 0, 0 }
|
---|
360 | };
|
---|
361 |
|
---|
362 | /** Sub-fields for the CR_PAT MSR. */
|
---|
363 | static DBGFREGSUBFIELD const g_aDbgfRegFields_cr_pat[] =
|
---|
364 | {
|
---|
365 | /** @todo */
|
---|
366 | { NULL, 0, 0, 0 }
|
---|
367 | };
|
---|
368 |
|
---|
369 | /** Sub-fields for the PERF_STATUS MSR. */
|
---|
370 | static DBGFREGSUBFIELD const g_aDbgfRegFields_perf_status[] =
|
---|
371 | {
|
---|
372 | /** @todo */
|
---|
373 | { NULL, 0, 0, 0 }
|
---|
374 | };
|
---|
375 |
|
---|
376 | /** Sub-fields for the EFER MSR. */
|
---|
377 | static DBGFREGSUBFIELD const g_aDbgfRegFields_efer[] =
|
---|
378 | {
|
---|
379 | /** @todo */
|
---|
380 | { NULL, 0, 0, 0 }
|
---|
381 | };
|
---|
382 |
|
---|
383 | /** Sub-fields for the STAR MSR. */
|
---|
384 | static DBGFREGSUBFIELD const g_aDbgfRegFields_star[] =
|
---|
385 | {
|
---|
386 | /** @todo */
|
---|
387 | { NULL, 0, 0, 0 }
|
---|
388 | };
|
---|
389 |
|
---|
390 | /** Sub-fields for the CSTAR MSR. */
|
---|
391 | static DBGFREGSUBFIELD const g_aDbgfRegFields_cstar[] =
|
---|
392 | {
|
---|
393 | /** @todo */
|
---|
394 | { NULL, 0, 0, 0 }
|
---|
395 | };
|
---|
396 |
|
---|
397 | /** Sub-fields for the LSTAR MSR. */
|
---|
398 | static DBGFREGSUBFIELD const g_aDbgfRegFields_lstar[] =
|
---|
399 | {
|
---|
400 | /** @todo */
|
---|
401 | { NULL, 0, 0, 0 }
|
---|
402 | };
|
---|
403 |
|
---|
404 | /** Sub-fields for the SF_MASK MSR. */
|
---|
405 | static DBGFREGSUBFIELD const g_aDbgfRegFields_sf_mask[] =
|
---|
406 | {
|
---|
407 | /** @todo */
|
---|
408 | { NULL, 0, 0, 0 }
|
---|
409 | };
|
---|
410 |
|
---|
411 |
|
---|
412 |
|
---|
413 | /**
|
---|
414 | * The register descriptors.
|
---|
415 | */
|
---|
416 | static DBGFREGDESC const g_aDbgfRegDescs[] =
|
---|
417 | {
|
---|
418 | #define DBGFREGDESC_REG(UName, LName) \
|
---|
419 | { #LName, DBGFREG_##UName, DBGFREGVALTYPE_U64, RT_OFFSETOF(CPUMCTX, LName), NULL, NULL, g_aDbgfRegAliases_##LName, NULL }
|
---|
420 | DBGFREGDESC_REG(RAX, rax),
|
---|
421 | DBGFREGDESC_REG(RCX, rcx),
|
---|
422 | DBGFREGDESC_REG(RDX, rdx),
|
---|
423 | DBGFREGDESC_REG(RSP, rsp),
|
---|
424 | DBGFREGDESC_REG(RBP, rbp),
|
---|
425 | DBGFREGDESC_REG(RSI, rsi),
|
---|
426 | DBGFREGDESC_REG(RDI, rdi),
|
---|
427 | DBGFREGDESC_REG(R8, r8),
|
---|
428 | DBGFREGDESC_REG(R9, r9),
|
---|
429 | DBGFREGDESC_REG(R10, r10),
|
---|
430 | DBGFREGDESC_REG(R11, r11),
|
---|
431 | DBGFREGDESC_REG(R12, r12),
|
---|
432 | DBGFREGDESC_REG(R13, r13),
|
---|
433 | DBGFREGDESC_REG(R14, r14),
|
---|
434 | DBGFREGDESC_REG(R15, r15),
|
---|
435 | #define DBGFREGDESC_SEG(UName, LName) \
|
---|
436 | { #LName, DBGFREG_##UName, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, LName), NULL, dbgfR3RegSet_seg, NULL, NULL }, \
|
---|
437 | { #LName "_attr", DBGFREG_##UName##_ATTR, DBGFREGVALTYPE_U32, RT_OFFSETOF(CPUMCTX, LName##Hid.Attr.u), NULL, NULL, NULL, g_aDbgfRegFields_seg }, \
|
---|
438 | { #LName "_base", DBGFREG_##UName##_ATTR, DBGFREGVALTYPE_U64, RT_OFFSETOF(CPUMCTX, LName##Hid.u64Base), NULL, NULL, NULL, NULL }, \
|
---|
439 | { #LName "_lim", DBGFREG_##UName##_ATTR, DBGFREGVALTYPE_U32, RT_OFFSETOF(CPUMCTX, LName##Hid.u32Limit), NULL, NULL, NULL, NULL }
|
---|
440 | DBGFREGDESC_SEG(CS, cs),
|
---|
441 | DBGFREGDESC_SEG(DS, ds),
|
---|
442 | DBGFREGDESC_SEG(ES, es),
|
---|
443 | DBGFREGDESC_SEG(FS, fs),
|
---|
444 | DBGFREGDESC_SEG(GS, gs),
|
---|
445 | DBGFREGDESC_SEG(SS, ss),
|
---|
446 | DBGFREGDESC_REG(RIP, rip),
|
---|
447 | { "rflags", DBGFREG_RFLAGS, DBGFREGVALTYPE_U64, RT_OFFSETOF(CPUMCTX, rflags), NULL, NULL, g_aDbgfRegAliases_rflags, g_aDbgfRegFields_rflags },
|
---|
448 | { "fcw", DBGFREG_FCW, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, fpu.FCW), NULL, NULL, NULL, g_aDbgfRegFields_fcw },
|
---|
449 | { "fsw", DBGFREG_FSW, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, fpu.FSW), NULL, NULL, NULL, g_aDbgfRegFields_fsw },
|
---|
450 | { "ftw", DBGFREG_FTW, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, fpu.FTW), dbgfR3RegGet_ftw, dbgfR3RegSet_ftw, NULL, g_aDbgfRegFields_ftw },
|
---|
451 | { "fop", DBGFREG_FOP, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, fpu.FOP), NULL, NULL, NULL, NULL },
|
---|
452 | { "fpuip", DBGFREG_FPUIP, DBGFREGVALTYPE_U32, RT_OFFSETOF(CPUMCTX, fpu.FPUIP), NULL, NULL, g_aDbgfRegAliases_fpuip, NULL },
|
---|
453 | { "fpucs", DBGFREG_FPUCS, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, fpu.CS), NULL, NULL, NULL, NULL },
|
---|
454 | { "fpudp", DBGFREG_FPUDP, DBGFREGVALTYPE_U32, RT_OFFSETOF(CPUMCTX, fpu.FPUDP), NULL, NULL, g_aDbgfRegAliases_fpudp, NULL },
|
---|
455 | { "fpuds", DBGFREG_FPUDS, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, fpu.DS), NULL, NULL, NULL, NULL },
|
---|
456 | { "mxcsr", DBGFREG_MXCSR, DBGFREGVALTYPE_U32, RT_OFFSETOF(CPUMCTX, fpu.MXCSR), NULL, NULL, NULL, g_aDbgfRegFields_mxcsr },
|
---|
457 | { "mxcsr_mask", DBGFREG_MXCSR_MASK, DBGFREGVALTYPE_U32, RT_OFFSETOF(CPUMCTX, fpu.MXCSR_MASK), NULL, NULL, NULL, g_aDbgfRegFields_mxcsr },
|
---|
458 | #define DBGFREGDESC_ST(n) \
|
---|
459 | { "st" #n, DBGFREG_ST##n, DBGFREGVALTYPE_80, ~(size_t)0, dbgfR3RegGet_stN, dbgfR3RegSet_stN, NULL, g_aDbgfRegFields_stN }
|
---|
460 | DBGFREGDESC_ST(0),
|
---|
461 | DBGFREGDESC_ST(1),
|
---|
462 | DBGFREGDESC_ST(2),
|
---|
463 | DBGFREGDESC_ST(3),
|
---|
464 | DBGFREGDESC_ST(4),
|
---|
465 | DBGFREGDESC_ST(5),
|
---|
466 | DBGFREGDESC_ST(6),
|
---|
467 | DBGFREGDESC_ST(7),
|
---|
468 | #define DBGFREGDESC_MM(n) \
|
---|
469 | { "mm" #n, DBGFREG_MM##n, DBGFREGVALTYPE_U64, RT_OFFSETOF(CPUMCTX, fpu.aRegs[n].mmx), NULL, NULL, NULL, g_aDbgfRegFields_mmN }
|
---|
470 | DBGFREGDESC_MM(0),
|
---|
471 | DBGFREGDESC_MM(1),
|
---|
472 | DBGFREGDESC_MM(2),
|
---|
473 | DBGFREGDESC_MM(3),
|
---|
474 | DBGFREGDESC_MM(4),
|
---|
475 | DBGFREGDESC_MM(5),
|
---|
476 | DBGFREGDESC_MM(6),
|
---|
477 | DBGFREGDESC_MM(7),
|
---|
478 | #define DBGFREGDESC_XMM(n) \
|
---|
479 | { "xmm" #n, DBGFREG_XMM##n, DBGFREGVALTYPE_U128, RT_OFFSETOF(CPUMCTX, fpu.aXMM[n].xmm), NULL, NULL, NULL, g_aDbgfRegFields_xmmN }
|
---|
480 | DBGFREGDESC_XMM(0),
|
---|
481 | DBGFREGDESC_XMM(1),
|
---|
482 | DBGFREGDESC_XMM(2),
|
---|
483 | DBGFREGDESC_XMM(3),
|
---|
484 | DBGFREGDESC_XMM(4),
|
---|
485 | DBGFREGDESC_XMM(5),
|
---|
486 | DBGFREGDESC_XMM(6),
|
---|
487 | DBGFREGDESC_XMM(7),
|
---|
488 | DBGFREGDESC_XMM(8),
|
---|
489 | DBGFREGDESC_XMM(9),
|
---|
490 | DBGFREGDESC_XMM(10),
|
---|
491 | DBGFREGDESC_XMM(11),
|
---|
492 | DBGFREGDESC_XMM(12),
|
---|
493 | DBGFREGDESC_XMM(13),
|
---|
494 | DBGFREGDESC_XMM(14),
|
---|
495 | DBGFREGDESC_XMM(15),
|
---|
496 | { "gdtr_base", DBGFREG_GDTR_BASE, DBGFREGVALTYPE_U64, RT_OFFSETOF(CPUMCTX, gdtr.pGdt), NULL, NULL, NULL, NULL },
|
---|
497 | { "gdtr_limit", DBGFREG_GDTR_LIMIT, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, gdtr.cbGdt), NULL, NULL, NULL, NULL },
|
---|
498 | { "idtr_base", DBGFREG_IDTR_BASE, DBGFREGVALTYPE_U64, RT_OFFSETOF(CPUMCTX, idtr.pIdt), NULL, NULL, NULL, NULL },
|
---|
499 | { "idtr_limit", DBGFREG_IDTR_LIMIT, DBGFREGVALTYPE_U16, RT_OFFSETOF(CPUMCTX, idtr.cbIdt), NULL, NULL, NULL, NULL },
|
---|
500 | DBGFREGDESC_SEG(LDTR, ldtr),
|
---|
501 | DBGFREGDESC_SEG(TR, tr),
|
---|
502 | { "cr0", DBGFREG_CR0, DBGFREGVALTYPE_U32, 0, dbgfR3RegGet_crX, dbgfR3RegSet_crX, g_aDbgfRegAliases_cr0, g_aDbgfRegFields_cr0 },
|
---|
503 | { "cr2", DBGFREG_CR2, DBGFREGVALTYPE_U64, 2, dbgfR3RegGet_crX, dbgfR3RegSet_crX, NULL, NULL },
|
---|
504 | { "cr3", DBGFREG_CR3, DBGFREGVALTYPE_U64, 3, dbgfR3RegGet_crX, dbgfR3RegSet_crX, NULL, g_aDbgfRegFields_cr3 },
|
---|
505 | { "cr4", DBGFREG_CR4, DBGFREGVALTYPE_U32, 4, dbgfR3RegGet_crX, dbgfR3RegSet_crX, NULL, g_aDbgfRegFields_cr4 },
|
---|
506 | { "cr8", DBGFREG_CR8, DBGFREGVALTYPE_U32, 8, dbgfR3RegGet_crX, dbgfR3RegSet_crX, NULL, NULL },
|
---|
507 | { "dr0", DBGFREG_DR0, DBGFREGVALTYPE_U64, 0, dbgfR3RegGet_drX, dbgfR3RegSet_drX, NULL, NULL },
|
---|
508 | { "dr1", DBGFREG_DR1, DBGFREGVALTYPE_U64, 1, dbgfR3RegGet_drX, dbgfR3RegSet_drX, NULL, NULL },
|
---|
509 | { "dr2", DBGFREG_DR2, DBGFREGVALTYPE_U64, 2, dbgfR3RegGet_drX, dbgfR3RegSet_drX, NULL, NULL },
|
---|
510 | { "dr3", DBGFREG_DR3, DBGFREGVALTYPE_U64, 3, dbgfR3RegGet_drX, dbgfR3RegSet_drX, NULL, NULL },
|
---|
511 | { "dr6", DBGFREG_DR6, DBGFREGVALTYPE_U32, 6, dbgfR3RegGet_drX, dbgfR3RegSet_drX, NULL, g_aDbgfRegFields_dr6 },
|
---|
512 | { "dr7", DBGFREG_DR7, DBGFREGVALTYPE_U32, 7, dbgfR3RegGet_drX, dbgfR3RegSet_drX, NULL, g_aDbgfRegFields_dr7 },
|
---|
513 | { "apic_base", DBGFREG_MSR_IA32_APICBASE, DBGFREGVALTYPE_U32, MSR_IA32_APICBASE, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_apic_base },
|
---|
514 | { "pat", DBGFREG_MSR_IA32_CR_PAT, DBGFREGVALTYPE_U64, MSR_IA32_CR_PAT, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_cr_pat },
|
---|
515 | { "perf_status", DBGFREG_MSR_IA32_PERF_STATUS, DBGFREGVALTYPE_U64, MSR_IA32_PERF_STATUS, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_perf_status },
|
---|
516 | { "sysenter_cs", DBGFREG_MSR_IA32_SYSENTER_CS, DBGFREGVALTYPE_U16, MSR_IA32_SYSENTER_CS, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
517 | { "sysenter_eip", DBGFREG_MSR_IA32_SYSENTER_EIP, DBGFREGVALTYPE_U32, MSR_IA32_SYSENTER_EIP, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
518 | { "sysenter_esp", DBGFREG_MSR_IA32_SYSENTER_ESP, DBGFREGVALTYPE_U32, MSR_IA32_SYSENTER_ESP, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
519 | { "tsc", DBGFREG_MSR_IA32_TSC, DBGFREGVALTYPE_U32, MSR_IA32_TSC, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
520 | { "efer", DBGFREG_MSR_K6_EFER, DBGFREGVALTYPE_U32, MSR_K6_EFER, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_efer },
|
---|
521 | { "star", DBGFREG_MSR_K6_STAR, DBGFREGVALTYPE_U64, MSR_K6_STAR, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_star },
|
---|
522 | { "cstar", DBGFREG_MSR_K8_CSTAR, DBGFREGVALTYPE_U64, MSR_K8_CSTAR, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_cstar },
|
---|
523 | { "msr_fs_base", DBGFREG_MSR_K8_FS_BASE, DBGFREGVALTYPE_U64, MSR_K8_FS_BASE, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
524 | { "msr_gs_base", DBGFREG_MSR_K8_GS_BASE, DBGFREGVALTYPE_U64, MSR_K8_GS_BASE, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
525 | { "krnl_gs_base", DBGFREG_MSR_K8_KERNEL_GS_BASE, DBGFREGVALTYPE_U64, MSR_K8_KERNEL_GS_BASE, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
526 | { "lstar", DBGFREG_MSR_K8_LSTAR, DBGFREGVALTYPE_U64, MSR_K8_LSTAR, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, g_aDbgfRegFields_lstar },
|
---|
527 | { "tsc_aux", DBGFREG_MSR_K8_TSC_AUX, DBGFREGVALTYPE_U64, MSR_K8_TSC_AUX, dbgfR3RegGet_msr, dbgfR3RegSet_msr, NULL, NULL },
|
---|
528 | { "ah", DBGFREG_AH, DBGFREGVALTYPE_U8, RT_OFFSETOF(CPUMCTX, rax) + 1, NULL, NULL, NULL, NULL },
|
---|
529 | { "ch", DBGFREG_CH, DBGFREGVALTYPE_U8, RT_OFFSETOF(CPUMCTX, rcx) + 1, NULL, NULL, NULL, NULL },
|
---|
530 | { "dh", DBGFREG_DH, DBGFREGVALTYPE_U8, RT_OFFSETOF(CPUMCTX, rdx) + 1, NULL, NULL, NULL, NULL },
|
---|
531 | { "bh", DBGFREG_BH, DBGFREGVALTYPE_U8, RT_OFFSETOF(CPUMCTX, rbx) + 1, NULL, NULL, NULL, NULL },
|
---|
532 | { "gdtr", DBGFREG_GDTR, DBGFREGVALTYPE_DTR, ~(size_t)0, dbgfR3RegGet_gdtr, dbgfR3RegSet_gdtr, NULL, NULL },
|
---|
533 | { "idtr", DBGFREG_IDTR, DBGFREGVALTYPE_DTR, ~(size_t)0, dbgfR3RegGet_idtr, dbgfR3RegSet_idtr, NULL, NULL },
|
---|
534 | #undef DBGFREGDESC_REG
|
---|
535 | #undef DBGFREGDESC_SEG
|
---|
536 | #undef DBGFREGDESC_ST
|
---|
537 | #undef DBGFREGDESC_MM
|
---|
538 | #undef DBGFREGDESC_XMM
|
---|
539 | };
|
---|
540 |
|
---|