Changeset 47699 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 13, 2013 3:04:08 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r47598 r47699 4690 4690 if (rcStrict != VINF_SUCCESS) 4691 4691 rcStrict = iemSetPassUpStatus(pIemCpu, rcStrict); 4692 Assert(rcStrict == VINF_SUCCESS); /* assumed below */ 4693 4694 /* 4695 * Check for I/O breakpoints. 4696 */ 4697 uint32_t const uDr7 = pCtx->dr[7]; 4698 if (RT_UNLIKELY( ( (uDr7 & X86_DR7_ENABLED_MASK) 4699 && X86_DR7_ANY_RW_IO(uDr7) 4700 && (pCtx->cr4 & X86_CR4_DE)) 4701 || DBGFBpIsHwIoArmed(IEMCPU_TO_VM(pIemCpu)))) 4702 { 4703 rcStrict = DBGFBpCheckIo(IEMCPU_TO_VM(pIemCpu), IEMCPU_TO_VMCPU(pIemCpu), pCtx, u16Port, cbReg); 4704 if (rcStrict == VINF_EM_RAW_GUEST_TRAP) 4705 rcStrict = iemRaiseDebugException(pIemCpu); 4706 } 4692 4707 } 4693 4708 … … 4745 4760 if (rcStrict != VINF_SUCCESS) 4746 4761 rcStrict = iemSetPassUpStatus(pIemCpu, rcStrict); 4762 Assert(rcStrict == VINF_SUCCESS); /* assumed below */ 4763 4764 /* 4765 * Check for I/O breakpoints. 4766 */ 4767 uint32_t const uDr7 = pCtx->dr[7]; 4768 if (RT_UNLIKELY( ( (uDr7 & X86_DR7_ENABLED_MASK) 4769 && X86_DR7_ANY_RW_IO(uDr7) 4770 && (pCtx->cr4 & X86_CR4_DE)) 4771 || DBGFBpIsHwIoArmed(IEMCPU_TO_VM(pIemCpu)))) 4772 { 4773 rcStrict = DBGFBpCheckIo(IEMCPU_TO_VM(pIemCpu), IEMCPU_TO_VMCPU(pIemCpu), pCtx, u16Port, cbReg); 4774 if (rcStrict == VINF_EM_RAW_GUEST_TRAP) 4775 rcStrict = iemRaiseDebugException(pIemCpu); 4776 } 4747 4777 } 4748 4778 return rcStrict; -
trunk/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
r47671 r47699 323 323 int rc = DBGFRZTrap01Handler(pVM, pVCpu, pRegFrame, uDr6, false /*fAltStepping*/); 324 324 if (rc == VINF_EM_RAW_GUEST_TRAP) 325 CPUMSetGuestDR6(pVCpu, CPUMGetGuestDR6(pVCpu) | uDr6); 325 { 326 CPUMSetGuestDR6(pVCpu, (CPUMGetGuestDR6(pVCpu) & ~X86_DR6_B_MASK) | uDr6); 327 if (CPUMGetGuestDR7(pVCpu) & X86_DR7_GD) 328 CPUMSetGuestDR7(pVCpu, CPUMGetGuestDR7(pVCpu) & ~X86_DR7_GD); 329 } 326 330 else if (rc == VINF_EM_DBG_STEPPED) 327 331 pRegFrame->eflags.Bits.u1TF = 0; … … 1070 1074 VBOXSTRICTRC rcStrict = IOMRCIOPortHandler(pVM, pVCpu, pRegFrame, &Cpu); 1071 1075 if (IOM_SUCCESS(rcStrict)) 1076 { 1072 1077 pRegFrame->rip += cbOp; 1078 1079 /* 1080 * Check for I/O breakpoints. A bit clumsy, but should be short lived (moved to IEM). 1081 */ 1082 uint32_t const uDr7 = CPUMGetGuestDR7(pVCpu); 1083 if (RT_UNLIKELY( ( (uDr7 & X86_DR7_ENABLED_MASK) 1084 && X86_DR7_ANY_RW_IO(uDr7) 1085 && (CPUMGetGuestCR4(pVCpu) & X86_CR4_DE)) 1086 || DBGFBpIsHwIoArmed(pVM))) 1087 { 1088 uint64_t uPort = pRegFrame->dx; 1089 unsigned cbValue; 1090 if ( Cpu.pCurInstr->uOpcode == OP_IN 1091 || Cpu.pCurInstr->uOpcode == OP_INSB 1092 || Cpu.pCurInstr->uOpcode == OP_INSWD) 1093 { 1094 cbValue = DISGetParamSize(&Cpu, &Cpu.Param1); 1095 if (Cpu.Param2.fUse & DISUSE_IMMEDIATE) 1096 uPort = Cpu.Param2.uValue; 1097 } 1098 else 1099 { 1100 cbValue = DISGetParamSize(&Cpu, &Cpu.Param2); 1101 if (Cpu.Param1.fUse & DISUSE_IMMEDIATE) 1102 uPort = Cpu.Param1.uValue; 1103 } 1104 1105 VBOXSTRICTRC rcStrict2 = DBGFBpCheckIo(pVM, pVCpu, CPUMCTX_FROM_CORE(pRegFrame), uPort, cbValue); 1106 if (rcStrict2 == VINF_EM_RAW_GUEST_TRAP) 1107 { 1108 /* Raise #DB. */ 1109 TRPMResetTrap(pVCpu); 1110 TRPMAssertTrap(pVCpu, X86_XCPT_DE, TRPM_TRAP); 1111 if (rcStrict) 1112 LogRel(("trpmGCTrap0dHandler: Overriding %Rrc with #DB on I/O port access.\n", VBOXSTRICTRC_VAL(rcStrict))); 1113 rcStrict = VINF_EM_RAW_GUEST_TRAP; 1114 } 1115 /* rcStrict is VINF_SUCCESS or in [VINF_EM_FIRST..VINF_EM_LAST]. */ 1116 else if ( rcStrict2 != VINF_SUCCESS 1117 && (rcStrict == VINF_SUCCESS || rcStrict2 < rcStrict)) 1118 rcStrict = rcStrict2; 1119 } 1120 } 1073 1121 rc = VBOXSTRICTRC_TODO(rcStrict); 1074 1122 TRPM_EXIT_DBG_HOOK(0xd); -
trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
r47671 r47699 96 96 } 97 97 98 LogFlow(("DBGFRZTrap01Handler: guest debug event % RTreg at %04x:%RGv!\n",uDr6, pRegFrame->cs.Sel, pRegFrame->rip));98 LogFlow(("DBGFRZTrap01Handler: guest debug event %#x at %04x:%RGv!\n", (uint32_t)uDr6, pRegFrame->cs.Sel, pRegFrame->rip)); 99 99 return VINF_EM_RAW_GUEST_TRAP; 100 100 }
Note:
See TracChangeset
for help on using the changeset viewer.