Changeset 87832 in vbox
- Timestamp:
- Feb 22, 2021 9:59:15 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp
r87776 r87832 2202 2202 break; 2203 2203 } 2204 case DBGFBPTYPE_INT3: 2205 { 2206 int rc = dbgfR3BpInt3Remove(pUVM, hBp, pBp); 2207 AssertRC(rc); 2208 break; 2209 } 2204 2210 default: 2205 2211 break; … … 2350 2356 2351 2357 /* Resolve owner (can be NIL_DBGFBPOWNER) and invoke callback if there is one. */ 2352 PCDBGFBPOWNERINT pBpOwner = dbgfR3BpOwnerGetByHnd(pVM->pUVM, pBp->Pub.hOwner); 2353 if (pBpOwner) 2354 { 2355 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 2356 2357 if (DBGF_BP_PUB_IS_EXEC_BEFORE(&pBp->Pub)) 2358 rcStrict = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_BEFORE); 2359 if (rcStrict == VINF_SUCCESS) 2358 if (pBp->Pub.hOwner != NIL_DBGFBPOWNER) 2359 { 2360 PCDBGFBPOWNERINT pBpOwner = dbgfR3BpOwnerGetByHnd(pVM->pUVM, pBp->Pub.hOwner); 2361 if (pBpOwner) 2360 2362 { 2361 uint8_t abInstr[DBGF_BP_INSN_MAX];2362 RTGCPTR const GCPtrInstr = pVCpu->cpum.GstCtx.rip + pVCpu->cpum.GstCtx.cs.u64Base; 2363 i nt rc = PGMPhysSimpleReadGCPtr(pVCpu, &abInstr[0], GCPtrInstr, sizeof(abInstr));2364 AssertRC(rc);2365 if ( RT_SUCCESS(rc))2363 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 2364 2365 if (DBGF_BP_PUB_IS_EXEC_BEFORE(&pBp->Pub)) 2366 rcStrict = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_BEFORE); 2367 if (rcStrict == VINF_SUCCESS) 2366 2368 { 2367 /* Replace the int3 with the original instruction byte. */2368 abInstr[0] = pBp->Pub.u.Int3.bOrg;2369 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr, &abInstr[0], sizeof(abInstr));2370 if ( rcStrict == VINF_SUCCESS2371 && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub))2369 uint8_t abInstr[DBGF_BP_INSN_MAX]; 2370 RTGCPTR const GCPtrInstr = pVCpu->cpum.GstCtx.rip + pVCpu->cpum.GstCtx.cs.u64Base; 2371 int rc = PGMPhysSimpleReadGCPtr(pVCpu, &abInstr[0], GCPtrInstr, sizeof(abInstr)); 2372 AssertRC(rc); 2373 if (RT_SUCCESS(rc)) 2372 2374 { 2373 VBOXSTRICTRC rcStrict2 = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_AFTER); 2374 if (rcStrict2 == VINF_SUCCESS) 2375 /* Replace the int3 with the original instruction byte. */ 2376 abInstr[0] = pBp->Pub.u.Int3.bOrg; 2377 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr, &abInstr[0], sizeof(abInstr)); 2378 if ( rcStrict == VINF_SUCCESS 2379 && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub)) 2380 { 2381 VBOXSTRICTRC rcStrict2 = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_AFTER); 2382 if (rcStrict2 == VINF_SUCCESS) 2383 return VBOXSTRICTRC_VAL(rcStrict); 2384 else if (rcStrict2 != VINF_DBGF_BP_HALT) 2385 return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS; 2386 } 2387 else 2375 2388 return VBOXSTRICTRC_VAL(rcStrict); 2376 else if (rcStrict2 != VINF_DBGF_BP_HALT)2377 return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS;2378 2389 } 2379 else2380 return VBOXSTRICTRC_VAL(rcStrict);2381 2390 } 2391 else if (rcStrict != VINF_DBGF_BP_HALT) /* Guru meditation. */ 2392 return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS; 2393 /* else: Halt in the debugger. */ 2382 2394 } 2383 else if (rcStrict != VINF_DBGF_BP_HALT) /* Guru meditation. */2384 return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS;2385 /* else: Halt in the debugger. */2386 2395 } 2387 2396 }
Note:
See TracChangeset
for help on using the changeset viewer.