VirtualBox

Changeset 86755 in vbox for trunk/src/VBox/Debugger


Ignore:
Timestamp:
Oct 29, 2020 8:30:25 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141149
Message:

VMM/DBGF,Debugger: Implement changes for the new breakpoint manager, bugref:9837

Location:
trunk/src/VBox/Debugger
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp

    r86178 r86755  
    945945
    946946
     947#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    947948/**
    948949 * Breakpoint enumeration callback function.
     
    954955 */
    955956static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, PCDBGFBP pBp)
     957#else
     958/**
     959 * Breakpoint enumeration callback function.
     960 *
     961 * @returns VBox status code. Any failure will stop the enumeration.
     962 * @param   pUVM        The user mode VM handle.
     963 * @param   pvUser      The user argument.
     964 * @param   hBp         The DBGF breakpoint handle.
     965 * @param   pBp         Pointer to the breakpoint information. (readonly)
     966 */
     967static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, DBGFBP hBp, PCDBGFBPPUB pBp)
     968#endif
    956969{
    957970    PDBGC   pDbgc   = (PDBGC)pvUser;
     971#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    958972    PDBGCBP pDbgcBp = dbgcBpGet(pDbgc, pBp->iBp);
     973#else
     974    PDBGCBP pDbgcBp = dbgcBpGet(pDbgc, hBp);
     975#endif
    959976
    960977    /*
    961978     * BP type and size.
    962979     */
     980#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    963981    DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%#4x %c ", pBp->iBp, pBp->fEnabled ? 'e' : 'd');
     982#else
     983    DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%#4x %c ", hBp, DBGF_BP_PUB_IS_ENABLED(pBp->fFlagsAndType) ? 'e' : 'd');
     984#endif
    964985    bool fHasAddress = false;
     986#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    965987    switch (pBp->enmType)
     988#else
     989    switch (DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType))
     990#endif
    966991    {
    967992        case DBGFBPTYPE_INT3:
     
    9861011        }
    9871012
     1013#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    9881014        case DBGFBPTYPE_REM:
    9891015            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " r %RGv", pBp->u.Rem.GCPtr);
    9901016            fHasAddress = true;
    9911017            break;
     1018#endif
    9921019
    9931020/** @todo realign the list when I/O and MMIO breakpoint command have been added and it's possible to test this code. */
     
    9951022        case DBGFBPTYPE_MMIO:
    9961023        {
     1024#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    9971025            uint32_t fAccess = pBp->enmType == DBGFBPTYPE_PORT_IO ? pBp->u.PortIo.fAccess : pBp->u.Mmio.fAccess;
    9981026            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, pBp->enmType == DBGFBPTYPE_PORT_IO ?  " i" : " m");
     1027#else
     1028            uint32_t fAccess = DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType) == DBGFBPTYPE_PORT_IO ? pBp->u.PortIo.fAccess : pBp->u.Mmio.fAccess;
     1029            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType) == DBGFBPTYPE_PORT_IO ?  " i" : " m");
     1030#endif
    9991031            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " %c%c%c%c%c%c",
    10001032                             fAccess & DBGFBPIOACCESS_READ_MASK   ? 'r' : '-',
     
    10111043                             fAccess & DBGFBPIOACCESS_WRITE_QWORD ? '8' : '-',
    10121044                             fAccess & DBGFBPIOACCESS_WRITE_OTHER ? '+' : '-');
     1045#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    10131046            if (pBp->enmType == DBGFBPTYPE_PORT_IO)
     1047#else
     1048            if (DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType) == DBGFBPTYPE_PORT_IO)
     1049#endif
    10141050                DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " %04x-%04x",
    10151051                                 pBp->u.PortIo.uPort, pBp->u.PortIo.uPort + pBp->u.PortIo.cPorts - 1);
     
    10201056
    10211057        default:
     1058#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    10221059            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " unknown type %d!!", pBp->enmType);
     1060#else
     1061            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " unknown type %d!!", DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType));
     1062#endif
    10231063            AssertFailed();
    10241064            break;
  • trunk/src/VBox/Debugger/DBGCGdbRemoteStub.cpp

    r86327 r86755  
    23822382        case DBGFEVENT_BREAKPOINT_HYPER:
    23832383        {
    2384             rc = dbgcBpExec(pDbgc, pEvent->u.Bp.iBp);
     2384            rc = dbgcBpExec(pDbgc, pEvent->u.Bp.hBp);
    23852385            switch (rc)
    23862386            {
    23872387                case VERR_DBGC_BP_NOT_FOUND:
    23882388                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Unknown breakpoint %u! (%s)\n",
    2389                                                  pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     2389                                                 pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    23902390                    break;
    23912391
    23922392                case VINF_DBGC_BP_NO_COMMAND:
    23932393                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Breakpoint %u! (%s)\n",
    2394                                                  pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     2394                                                 pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    23952395                    break;
    23962396
    23972397                case VINF_BUFFER_OVERFLOW:
    23982398                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Breakpoint %u! Command too long to execute! (%s)\n",
    2399                                                  pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     2399                                                 pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    24002400                    break;
    24012401
  • trunk/src/VBox/Debugger/DBGCRemoteKd.cpp

    r86327 r86755  
    11601160typedef struct KDCTXHWBP
    11611161{
     1162#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    11621163    /** The DBGF breakpoint handle if active, UINT32_MAX if not active. */
    1163     uint32_t                    iDbgfBp;
     1164    uint32_t                    hDbgfBp;
     1165#else
     1166    /** The DBGF breakpoint handle if active, NIL_DBGFBP if not active. */
     1167    DBGFBP                      hDbgfBp;
     1168#endif
    11641169    /** The linear address of the breakpoint if active. */
    11651170    RTGCPTR                     GCPtrBp;
     
    12391244/** Returns the value of a possibly sign extended guest context pointer received for 32bit targets. */
    12401245#define KD_PTR_GET(a_pThis, a_GCPtr) ((a_pThis)->f32Bit ? (a_GCPtr) & ~UINT64_C(0xffffffff00000000) : (a_GCPtr))
     1246
     1247#ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
     1248# define NIL_DBGFBP              ((uint32_t)UINT32_MAX)
     1249#endif
    12411250
    12421251
     
    15191528        PKDCTXHWBP pBp = &pThis->aHwBp[i];
    15201529
    1521         if (pBp->iDbgfBp != UINT32_MAX)
    1522         {
    1523             int rc = DBGFR3BpClear(pThis->Dbgc.pUVM, pBp->iDbgfBp);
     1530        if (pBp->hDbgfBp != NIL_DBGFBP)
     1531        {
     1532            int rc = DBGFR3BpClear(pThis->Dbgc.pUVM, pBp->hDbgfBp);
    15241533            AssertRC(rc);
    15251534        }
    15261535
    1527         pBp->iDbgfBp    = UINT32_MAX;
     1536        pBp->hDbgfBp    = NIL_DBGFBP;
    15281537        pBp->GCPtrBp    = 0;
    15291538        pBp->fAcc       = 0;
     
    15611570    {
    15621571        /* Clear the old breakpoint. */
    1563         if (pBp->iDbgfBp != UINT32_MAX)
    1564         {
    1565             rc = DBGFR3BpClear(pThis->Dbgc.pUVM, pBp->iDbgfBp);
     1572        if (pBp->hDbgfBp != NIL_DBGFBP)
     1573        {
     1574            rc = DBGFR3BpClear(pThis->Dbgc.pUVM, pBp->hDbgfBp);
    15661575            AssertRC(rc);
    1567             pBp->iDbgfBp = UINT32_MAX;
     1576            pBp->hDbgfBp = NIL_DBGFBP;
    15681577        }
    15691578
     
    15991608
    16001609            rc = DBGFR3BpSetReg(pThis->Dbgc.pUVM, &AddrBp, 0 /*iHitTrigger*/, UINT64_MAX /*iHitDisable*/,
    1601                                 pBp->fAcc, cb, &pBp->iDbgfBp);
     1610                                pBp->fAcc, cb, &pBp->hDbgfBp);
    16021611        }
    16031612    }
     
    39173926        case DBGFEVENT_BREAKPOINT_HYPER:
    39183927        {
    3919             rc = dbgcBpExec(pDbgc, pEvent->u.Bp.iBp);
     3928            rc = dbgcBpExec(pDbgc, pEvent->u.Bp.hBp);
    39203929            switch (rc)
    39213930            {
    39223931                case VERR_DBGC_BP_NOT_FOUND:
    39233932                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Unknown breakpoint %u! (%s)\n",
    3924                                                  pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     3933                                                 pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    39253934                    break;
    39263935
    39273936                case VINF_DBGC_BP_NO_COMMAND:
    39283937                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Breakpoint %u! (%s)\n",
    3929                                                  pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     3938                                                 pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    39303939                    break;
    39313940
    39323941                case VINF_BUFFER_OVERFLOW:
    39333942                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Breakpoint %u! Command too long to execute! (%s)\n",
    3934                                                  pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     3943                                                 pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    39353944                    break;
    39363945
     
    39513960            for (uint32_t i = 0; i < RT_ELEMENTS(pThis->aHwBp); i++)
    39523961            {
    3953                 if (pThis->aHwBp[i].iDbgfBp == pEvent->u.Bp.iBp)
     3962                if (pThis->aHwBp[i].hDbgfBp == pEvent->u.Bp.hBp)
    39543963                {
    39553964                    pThis->aHwBp[i].fTriggered = true;
     
    42934302    {
    42944303        PKDCTXHWBP pBp = &pThis->aHwBp[i];
    4295         pBp->iDbgfBp = UINT32_MAX;
     4304        pBp->hDbgfBp = NIL_DBGFBP;
    42964305    }
    42974306
  • trunk/src/VBox/Debugger/DBGConsole.cpp

    r86327 r86755  
    685685        {
    686686            pDbgc->idCpu = pEvent->idCpu;
    687             rc = dbgcBpExec(pDbgc, pEvent->u.Bp.iBp);
     687            rc = dbgcBpExec(pDbgc, pEvent->u.Bp.hBp);
    688688            switch (rc)
    689689            {
    690690                case VERR_DBGC_BP_NOT_FOUND:
    691691                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event/%u: Unknown breakpoint %u! (%s)\n",
    692                                                  pEvent->idCpu, pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     692                                                 pEvent->idCpu, pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    693693                    break;
    694694
    695695                case VINF_DBGC_BP_NO_COMMAND:
    696696                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event/%u: Breakpoint %u! (%s)\n",
    697                                                  pEvent->idCpu, pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     697                                                 pEvent->idCpu, pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    698698                    break;
    699699
    700700                case VINF_BUFFER_OVERFLOW:
    701701                    rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event/%u: Breakpoint %u! Command too long to execute! (%s)\n",
    702                                                  pEvent->idCpu, pEvent->u.Bp.iBp, dbgcGetEventCtx(pEvent->enmCtx));
     702                                                 pEvent->idCpu, pEvent->u.Bp.hBp, dbgcGetEventCtx(pEvent->enmCtx));
    703703                    break;
    704704
  • trunk/src/VBox/Debugger/Makefile.kmk

    r86327 r86755  
    3535Debugger_TEMPLATE  = VBOXR3
    3636Debugger_DEFS      = IN_VMM_R3 IN_DBG_R3 IN_DIS
     37ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
     38Debugger_DEFS     += VBOX_WITH_LOTS_OF_DBGF_BPS
     39endif
    3740ifneq ($(KBUILD_TYPE),release)
    3841 Debugger_DEFS    += VBOX_WITH_DEBUGGER_TCP_BY_DEFAULT
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette