- Timestamp:
- Jul 30, 2019 8:30:13 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CPUMDbg.cpp
r80051 r80060 667 667 } 668 668 669 670 671 /*672 *673 * Hypervisor register access functions.674 *675 */676 677 /**678 * @interface_method_impl{DBGFREGDESC,pfnGet}679 */680 static DECLCALLBACK(int) cpumR3RegHyperGet_drX(void *pvUser, PCDBGFREGDESC pDesc, PDBGFREGVAL pValue)681 {682 PVMCPU pVCpu = (PVMCPU)pvUser;683 VMCPU_ASSERT_EMT(pVCpu);684 685 uint64_t u64Value;686 switch (pDesc->offRegister)687 {688 case 0: u64Value = CPUMGetHyperDR0(pVCpu); break;689 case 1: u64Value = CPUMGetHyperDR1(pVCpu); break;690 case 2: u64Value = CPUMGetHyperDR2(pVCpu); break;691 case 3: u64Value = CPUMGetHyperDR3(pVCpu); break;692 case 6: u64Value = CPUMGetHyperDR6(pVCpu); break;693 case 7: u64Value = CPUMGetHyperDR7(pVCpu); break;694 default:695 AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);696 }697 switch (pDesc->enmType)698 {699 case DBGFREGVALTYPE_U64: pValue->u64 = u64Value; break;700 case DBGFREGVALTYPE_U32: pValue->u32 = (uint32_t)u64Value; break;701 default:702 AssertFailedReturn(VERR_IPE_NOT_REACHED_DEFAULT_CASE);703 }704 return VINF_SUCCESS;705 }706 707 708 /**709 * @interface_method_impl{DBGFREGDESC,pfnGet}710 */711 static DECLCALLBACK(int) cpumR3RegHyperSet_drX(void *pvUser, PCDBGFREGDESC pDesc, PCDBGFREGVAL pValue, PCDBGFREGVAL pfMask)712 {713 /* Not settable, prevents killing your host. */714 NOREF(pvUser); NOREF(pDesc); NOREF(pValue); NOREF(pfMask);715 return VERR_ACCESS_DENIED;716 }717 669 718 670 … … 1289 1241 1290 1242 /** 1291 * The hypervisor (raw-mode) register descriptors.1292 */1293 static DBGFREGDESC const g_aCpumRegHyperDescs[] =1294 {1295 CPU_REG_EX_AS("dr0", DR0, U64, 0, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, NULL ),1296 CPU_REG_EX_AS("dr1", DR1, U64, 1, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, NULL ),1297 CPU_REG_EX_AS("dr2", DR2, U64, 2, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, NULL ),1298 CPU_REG_EX_AS("dr3", DR3, U64, 3, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, NULL ),1299 CPU_REG_EX_AS("dr6", DR6, U32, 6, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, g_aCpumRegFields_dr6 ),1300 CPU_REG_EX_AS("dr7", DR7, U32, 7, cpumR3RegHyperGet_drX, cpumR3RegHyperSet_drX, NULL, g_aCpumRegFields_dr7 ),1301 DBGFREGDESC_TERMINATOR()1302 };1303 1304 1305 /**1306 1243 * Initializes the debugger related sides of the CPUM component. 1307 1244 * … … 1317 1254 int rc = DBGFR3RegRegisterCpu(pVM, &pVM->aCpus[iCpu], g_aCpumRegGstDescs, true /*fGuestRegs*/); 1318 1255 AssertLogRelRCReturn(rc, rc); 1319 rc = DBGFR3RegRegisterCpu(pVM, &pVM->aCpus[iCpu], g_aCpumRegHyperDescs, false /*fGuestRegs*/);1320 AssertLogRelRCReturn(rc, rc);1321 1256 } 1322 1257
Note:
See TracChangeset
for help on using the changeset viewer.