DBGFBp.cpp revision f8bc6e0cfdb98674b2943201b81c135e29f12369
4cc260724e1b5a0b499d7b76bbd510551fcb1af0vboxsync * DBGF - Debugger Facility, Breakpoint Management.
4cc260724e1b5a0b499d7b76bbd510551fcb1af0vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
* available from http://www.virtualbox.org. This file is free software;
* Clara, CA 95054 USA or visit http://www.sun.com if you need
#include "DBGFInternal.h"
static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINT piBp);
static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINT piBp);
return VINF_SUCCESS;
unsigned cBps;
switch (enmType)
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
return NULL;
++*pcBpsCur;
return NULL;
return NULL;
case DBGFBPTYPE_FREE:
return NULL;
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
return NULL;
return pBp;
unsigned cBps;
switch (enmType)
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
return NULL;
return NULL;
case DBGFBPTYPE_FREE:
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpSetInt3, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
return rc;
static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINT piBp)
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
if (piBp)
*piBp = ~0;
if (pBp)
if (piBp)
return rc;
if (!pBp)
return VERR_DBGF_NO_MORE_BP_SLOTS;
if (piBp)
return rc;
return rc;
return rc;
VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpSetReg, 7, pVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp);
return rc;
static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
if (piBp)
*piBp = ~0;
switch (fType)
case X86_DR7_RW_EO:
return VERR_INVALID_PARAMETER;
case X86_DR7_RW_IO:
case X86_DR7_RW_RW:
case X86_DR7_RW_WO:
return VERR_INVALID_PARAMETER;
switch (cb)
return VERR_INVALID_PARAMETER;
if ( pBp
if (piBp)
return rc;
if (!pBp)
return VERR_DBGF_NO_MORE_BP_SLOTS;
if (piBp)
return rc;
VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpSetREM, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
return rc;
static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINT piBp)
return VERR_INVALID_PARAMETER;
return VERR_INVALID_PARAMETER;
if (piBp)
*piBp = ~0;
if (pBp)
if (piBp)
return rc;
if (!pBp)
return VERR_DBGF_NO_MORE_BP_SLOTS;
if (piBp)
return rc;
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpClear, 2, pVM, iBp);
return rc;
if (!pBp)
return VERR_DBGF_BP_NOT_FOUND;
int rc;
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
return VERR_INTERNAL_ERROR;
return VINF_SUCCESS;
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpEnable, 2, pVM, iBp);
return rc;
if (!pBp)
return VERR_DBGF_BP_NOT_FOUND;
return VINF_DBGF_BP_ALREADY_ENABLED;
int rc;
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
return VERR_INTERNAL_ERROR;
return rc;
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpDisable, 2, pVM, iBp);
return rc;
if (!pBp)
return VERR_DBGF_BP_NOT_FOUND;
return VINF_DBGF_BP_ALREADY_DISABLED;
int rc;
case DBGFBPTYPE_REG:
case DBGFBPTYPE_INT3:
case DBGFBPTYPE_REM:
return VERR_INTERNAL_ERROR;
return rc;
int rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, (PFNRT)dbgfR3BpEnum, 3, pVM, pfnCallback, pvUser);
return rc;
return rc;
return rc;
return VINF_SUCCESS;