Changeset 86666 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Oct 21, 2020 3:01:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp
r82968 r86666 50 50 { 51 51 RTGCUINTREG uDr7 = X86_DR7_GD | X86_DR7_GE | X86_DR7_LE | X86_DR7_RA1_MASK; 52 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 52 53 PDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[0]; 53 54 unsigned cLeft = RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); … … 68 69 pBp++; 69 70 } 71 #else 72 for (uint32_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); i++) 73 { 74 PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[i]; 75 76 if ( pBp->hBp != NIL_DBGFBP 77 && pBp->fEnabled) 78 { 79 static const uint8_t s_au8Sizes[8] = 80 { 81 X86_DR7_LEN_BYTE, X86_DR7_LEN_BYTE, X86_DR7_LEN_WORD, X86_DR7_LEN_BYTE, 82 X86_DR7_LEN_DWORD,X86_DR7_LEN_BYTE, X86_DR7_LEN_BYTE, X86_DR7_LEN_QWORD 83 }; 84 uDr7 |= X86_DR7_G(i) 85 | X86_DR7_RW(i, pBp->fType) 86 | X86_DR7_LEN(i, s_au8Sizes[pBp->cb]); 87 } 88 pBp++; 89 } 90 #endif 70 91 return uDr7; 71 92 } … … 80 101 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM) 81 102 { 103 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 82 104 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[0]; 83 105 Assert(pBp->u.Reg.iReg == 0); 84 106 return pBp->u.Reg.GCPtr; 107 #else 108 PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[0]; 109 return pBp->GCPtr; 110 #endif 85 111 } 86 112 … … 94 120 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM) 95 121 { 122 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 96 123 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[1]; 97 124 Assert(pBp->u.Reg.iReg == 1); 98 125 return pBp->u.Reg.GCPtr; 126 #else 127 PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[1]; 128 return pBp->GCPtr; 129 #endif 99 130 } 100 131 … … 108 139 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM) 109 140 { 141 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 110 142 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[2]; 111 143 Assert(pBp->u.Reg.iReg == 2); 112 144 return pBp->u.Reg.GCPtr; 145 #else 146 PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[2]; 147 return pBp->GCPtr; 148 #endif 113 149 } 114 150 … … 122 158 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM) 123 159 { 160 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 124 161 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[3]; 125 162 Assert(pBp->u.Reg.iReg == 3); 126 163 return pBp->u.Reg.GCPtr; 164 #else 165 PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[3]; 166 return pBp->GCPtr; 167 #endif 127 168 } 128 169 … … 163 204 VMM_INT_DECL(bool) DBGFBpIsInt3Armed(PVM pVM) 164 205 { 206 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 165 207 return pVM->dbgf.s.cEnabledInt3Breakpoints > 0; 208 #else 209 RT_NOREF(pVM); 210 return false; /** @todo */ 211 #endif 166 212 } 167 213 … … 186 232 uint32_t const uIoPortFirst = uIoPort; 187 233 uint32_t const uIoPortLast = uIoPortFirst + cbValue - 1; 188 189 234 190 235 /* 191 236 * Check hyper breakpoints first as the VMM debugger has priority over … … 196 241 for (unsigned iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); iBp++) 197 242 { 243 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS 198 244 if ( pVM->dbgf.s.aHwBreakpoints[iBp].u.Reg.fType == X86_DR7_RW_IO 199 245 && pVM->dbgf.s.aHwBreakpoints[iBp].fEnabled … … 214 260 } 215 261 } 262 #else 263 PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[iBp]; 264 265 if ( pBp->fType == X86_DR7_RW_IO 266 && pBp->hBp == NIL_DBGFBP 267 && pBp->fEnabled) 268 { 269 uint8_t cbReg = pBp->cb; Assert(RT_IS_POWER_OF_TWO(cbReg)); 270 uint64_t uDrXFirst = pBp->GCPtr & ~(uint64_t)(cbReg - 1); 271 uint64_t uDrXLast = uDrXFirst + cbReg - 1; 272 if (uDrXFirst <= uIoPortLast && uDrXLast >= uIoPortFirst) 273 { 274 /* (See also DBGFRZTrap01Handler.) */ 275 pVCpu->dbgf.s.hBpActive = pBp->hBp; 276 pVCpu->dbgf.s.fSingleSteppingRaw = false; 277 278 LogFlow(("DBGFBpCheckIo: hit hw breakpoint %d at %04x:%RGv (iop %#x)\n", 279 iBp, pCtx->cs.Sel, pCtx->rip, uIoPort)); 280 return VINF_EM_DBG_BREAKPOINT; 281 } 282 } 283 #endif 216 284 } 217 285 } … … 254 322 pCtx->dr[7] &= ~X86_DR7_GD; 255 323 LogFlow(("DBGFBpCheckIo: hit hw breakpoint %d at %04x:%RGv (iop %#x)\n", 256 pVM->dbgf.s.aHwBreakpoints[iBp].iBp, pCtx->cs.Sel, pCtx->rip, uIoPort));324 iBp, pCtx->cs.Sel, pCtx->rip, uIoPort)); 257 325 return VINF_EM_RAW_GUEST_TRAP; 258 326 }
Note:
See TracChangeset
for help on using the changeset viewer.