VirtualBox

Changeset 87594 in vbox


Ignore:
Timestamp:
Feb 3, 2021 8:23:46 PM (4 years ago)
Author:
vboxsync
Message:

VMM/DBGF,Debugger: Removed the !defined(VBOX_WITH_LOTS_OF_DBGF_BPS) code. bugref:9837

Location:
trunk
Files:
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r87260 r87594  
    447447 VBOX_WITH_RAM_IN_KERNEL := 1
    448448endif
    449 # Enables the new breakpoint handling code, see @bugref{9837}
    450 VBOX_WITH_LOTS_OF_DBGF_BPS = 1
    451449# Enables the new breakpoint handling code, see @bugref{8650}
    452450VBOX_WITH_DBGF_FLOW_TRACING = 1
  • trunk/include/VBox/types.h

    r87141 r87594  
    522522typedef RCPTRTYPE(struct DBGFTRACERINSRC *) PDBGFTRACERINSRC;
    523523
    524 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    525524/** A cross context DBGF breakpoint owner handle. */
    526525typedef uint32_t                DBGFBPOWNER;
    527526/** Pointer to a cross context DBGF breakpoint owner handle. */
    528 typedef DBGFBPOWNER             *PDBGFBPOWNER;
     527typedef DBGFBPOWNER            *PDBGFBPOWNER;
    529528/** A NIL DBGF breakpoint owner handle. */
    530529#define NIL_DBGFBPOWNER         ((uint32_t)UINT32_MAX)
     
    533532typedef uint32_t                DBGFBP;
    534533/** Pointer to a cross context DBGF breakpoint handle. */
    535 typedef DBGFBP                  *PDBGFBP;
     534typedef DBGFBP                 *PDBGFBP;
    536535/** A NIL DBGF breakpoint handle. */
    537536#define NIL_DBGFBP              ((uint32_t)UINT32_MAX)
    538 #endif
    539537/** @} */
    540538
  • trunk/include/VBox/vmm/dbgf.h

    r87137 r87594  
    7777VMMR0_INT_DECL(int) DBGFR0TracerCreateReqHandler(PGVM pGVM, PDBGFTRACERCREATEREQ pReq);
    7878
    79 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    8079/**
    8180 * Request buffer for DBGFR0BpInitReqHandler / VMMR0_DO_DBGF_BP_INIT.
     
    147146
    148147VMMR0_INT_DECL(int) DBGFR0BpL2TblChunkAllocReqHandler(PGVM pGVM, PDBGFBPL2TBLCHUNKALLOCREQ pReq);
    149 #endif
    150148/** @} */
    151149
     
    594592        struct DBGFEVENTBP
    595593        {
    596 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    597             /** The identifier of the breakpoint which was hit. */
    598             RTUINT                  hBp;
    599 #else
    600594            /** The handle of the breakpoint which was hit. */
    601595            DBGFBP                  hBp;
    602 #endif
    603596        } Bp;
    604597
     
    814807typedef enum DBGFBPTYPE
    815808{
    816 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    817     /** Free breakpoint entry. */
    818     DBGFBPTYPE_FREE = 0,
    819 #else
    820809    /** Invalid breakpoint type. */
    821810    DBGFBPTYPE_INVALID = 0,
    822 #endif
    823811    /** Debug register. */
    824812    DBGFBPTYPE_REG,
    825813    /** INT 3 instruction. */
    826814    DBGFBPTYPE_INT3,
    827 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    828     /** Recompiler. */
    829     DBGFBPTYPE_REM,
    830 #endif
    831815    /** Port I/O breakpoint. */
    832816    DBGFBPTYPE_PORT_IO,
     
    875859/** @} */
    876860
    877 #if defined(VBOX_WITH_LOTS_OF_DBGF_BPS) || defined(DOXYGEN_RUNNING)
    878861/**
    879862 * The visible breakpoint state (read-only).
     
    960943typedef const DBGFBPPUB *PCDBGFBPPUB;
    961944
    962 /** Sets the DBGFPUB::fFlagsAndType member. */
     945/** Sets the DBGFPUB::fFlagsAndType member.
     946 * @todo r=bird: Rename to DBGF_BP_PUB_MAKE_FLAGS_AND_TYPE, as this macro
     947 *       isn't setting anything. */
    963948#define DBGF_BP_PUB_SET_FLAGS_AND_TYPE(a_enmType, a_fFlags) ((uint32_t)(a_enmType) | (a_fFlags))
    964949/** Returns the type of the DBGFPUB::fFlagsAndType member. */
    965 #define DBGF_BP_PUB_GET_TYPE(a_fFlagsAndType) ((DBGFBPTYPE)((a_fFlagsAndType) & (UINT32_C(0x7fffffff))))
     950#define DBGF_BP_PUB_GET_TYPE(a_fFlagsAndType)               ((DBGFBPTYPE)((a_fFlagsAndType) & (UINT32_C(0x7fffffff))))
    966951/** Returns the enabled status of DBGFPUB::fFlagsAndType member. */
    967 #define DBGF_BP_PUB_IS_ENABLED(a_fFlagsAndType) RT_BOOL((DBGFBPTYPE)((a_fFlagsAndType) & DBGF_BP_F_ENABLED))
     952#define DBGF_BP_PUB_IS_ENABLED(a_fFlagsAndType)             RT_BOOL((a_fFlagsAndType) & DBGF_BP_F_ENABLED)
    968953
    969954/** @name Possible DBGFBPPUB::fFlagsAndType flags.
     
    10651050/** @} */
    10661051#endif /* IN_RING0 || DOXYGEN_RUNNING */
    1067 
    1068 #else /* !VBOX_WITH_LOTS_OF_DBGF_BPS */
    1069 /**
    1070  * A Breakpoint.
    1071  */
    1072 typedef struct DBGFBP
    1073 {
    1074     /** The number of breakpoint hits. */
    1075     uint64_t        cHits;
    1076     /** The hit number which starts to trigger the breakpoint. */
    1077     uint64_t        iHitTrigger;
    1078     /** The hit number which stops triggering the breakpoint (disables it).
    1079      * Use ~(uint64_t)0 if it should never stop. */
    1080     uint64_t        iHitDisable;
    1081     /** The breakpoint id. */
    1082     uint16_t        iBp;
    1083     /** The breakpoint status - enabled or disabled. */
    1084     bool            fEnabled;
    1085     /** The breakpoint type. */
    1086     DBGFBPTYPE      enmType;
    1087 
    1088     /** Union of type specific data. */
    1089     union
    1090     {
    1091         /** The flat GC address breakpoint address for REG, INT3 and REM breakpoints. */
    1092         RTGCUINTPTR         GCPtr;
    1093 
    1094         /** Debug register data. */
    1095         struct DBGFBPREG
    1096         {
    1097             /** The flat GC address of the breakpoint. */
    1098             RTGCUINTPTR     GCPtr;
    1099             /** The debug register number. */
    1100             uint8_t         iReg;
    1101             /** The access type (one of the X86_DR7_RW_* value). */
    1102             uint8_t         fType;
    1103             /** The access size. */
    1104             uint8_t         cb;
    1105         } Reg;
    1106 
    1107         /** INT3 breakpoint data. */
    1108         struct DBGFBPINT3
    1109         {
    1110             /** The flat GC address of the breakpoint. */
    1111             RTGCUINTPTR     GCPtr;
    1112             /** The physical address of the breakpoint. */
    1113             RTGCPHYS        PhysAddr;
    1114             /** The byte value we replaced by the INT 3 instruction. */
    1115             uint8_t         bOrg;
    1116         } Int3;
    1117 
    1118         /** Recompiler breakpoint data. */
    1119         struct DBGFBPREM
    1120         {
    1121             /** The flat GC address of the breakpoint.
    1122              * (PC register value?) */
    1123             RTGCUINTPTR     GCPtr;
    1124         } Rem;
    1125 
    1126         /** I/O port breakpoint data.   */
    1127         struct DBGFBPPORTIO
    1128         {
    1129             /** The first port. */
    1130             RTIOPORT        uPort;
    1131             /** The number of ports. */
    1132             RTIOPORT        cPorts;
    1133             /** Valid DBGFBPIOACCESS_XXX selection, max DWORD size. */
    1134             uint32_t        fAccess;
    1135         } PortIo;
    1136 
    1137         /** Memory mapped I/O breakpoint data. */
    1138         struct DBGFBPMMIO
    1139         {
    1140             /** The first MMIO address. */
    1141             RTGCPHYS        PhysAddr;
    1142             /** The size of the MMIO range in bytes. */
    1143             uint32_t        cb;
    1144             /** Valid DBGFBPIOACCESS_XXX selection, max DWORD size. */
    1145             uint32_t        fAccess;
    1146         } Mmio;
    1147 
    1148         /** Paddind to ensure that the size is identical on win32 and linux. */
    1149         uint64_t    u64Padding[3];
    1150     } u;
    1151 } DBGFBP;
    1152 AssertCompileMembersAtSameOffset(DBGFBP, u.GCPtr, DBGFBP, u.Reg.GCPtr);
    1153 AssertCompileMembersAtSameOffset(DBGFBP, u.GCPtr, DBGFBP, u.Int3.GCPtr);
    1154 AssertCompileMembersAtSameOffset(DBGFBP, u.GCPtr, DBGFBP, u.Rem.GCPtr);
    1155 
    1156 /** Pointer to a breakpoint. */
    1157 typedef DBGFBP *PDBGFBP;
    1158 /** Pointer to a const breakpoint. */
    1159 typedef const DBGFBP *PCDBGFBP;
    1160 
    1161 # ifdef IN_RING3 /* The breakpoint management API is only available in ring-3. */
    1162 VMMR3DECL(int)  DBGFR3BpSetInt3(PUVM pUVM, VMCPUID idSrcCpu, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
    1163 VMMR3DECL(int)  DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
    1164                                uint8_t fType, uint8_t cb, uint32_t *piBp);
    1165 VMMR3DECL(int)  DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
    1166 VMMR3DECL(int)  DBGFR3BpSetPortIo(PUVM pUVM, RTIOPORT uPort, RTIOPORT cPorts, uint32_t fAccess,
    1167                                   uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
    1168 VMMR3DECL(int)  DBGFR3BpSetMmio(PUVM pUVM, RTGCPHYS GCPhys, uint32_t cb, uint32_t fAccess,
    1169                                 uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
    1170 VMMR3DECL(int)  DBGFR3BpClear(PUVM pUVM, uint32_t iBp);
    1171 VMMR3DECL(int)  DBGFR3BpEnable(PUVM pUVM, uint32_t iBp);
    1172 VMMR3DECL(int)  DBGFR3BpDisable(PUVM pUVM, uint32_t iBp);
    1173 
    1174 /**
    1175  * Breakpoint enumeration callback function.
    1176  *
    1177  * @returns VBox status code.
    1178  *          The enumeration stops on failure status and VINF_CALLBACK_RETURN.
    1179  * @param   pUVM        The user mode VM handle.
    1180  * @param   pvUser      The user argument.
    1181  * @param   pBp         Pointer to the breakpoint information. (readonly)
    1182  */
    1183 typedef DECLCALLBACKTYPE(int, FNDBGFBPENUM,(PUVM pUVM, void *pvUser, PCDBGFBP pBp));
    1184 /** Pointer to a breakpoint enumeration callback function. */
    1185 typedef FNDBGFBPENUM *PFNDBGFBPENUM;
    1186 
    1187 VMMR3DECL(int)              DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
    1188 # endif /* IN_RING3 */
    1189 #endif /* !VBOX_WITH_LOTS_OF_DBGF_BPS */
    11901052
    11911053VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR7(PVM pVM);
  • trunk/include/VBox/vmm/vm.h

    r87481 r87594  
    13951395            /** The number of enabled hardware I/O breakpoints. */
    13961396            uint8_t                     cEnabledHwIoBreakpoints;
    1397 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
     1397            uint8_t                     au8Alignment1[2]; /**< Alignment padding. */
    13981398            /** The number of enabled INT3 breakpoints. */
    1399             uint8_t                     cEnabledInt3Breakpoints;
    1400             uint8_t                     abPadding[1]; /**< Unused padding space up for grabs. */
    1401 #else
    1402             uint16_t                    u16Pad; /**< Unused padding space up for grabs. */
    1403             /** The number of enabled INT3 breakpoints. */
    1404             volatile uint32_t           cEnabledInt3Breakpoints;
    1405 #endif
     1399            uint32_t volatile           cEnabledInt3Breakpoints;
    14061400        } const     ro;
    14071401#endif
  • trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp

    r86755 r87594  
    945945
    946946
    947 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    948 /**
    949  * Breakpoint enumeration callback function.
    950  *
    951  * @returns VBox status code. Any failure will stop the enumeration.
    952  * @param   pUVM        The user mode VM handle.
    953  * @param   pvUser      The user argument.
    954  * @param   pBp         Pointer to the breakpoint information. (readonly)
    955  */
    956 static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, PCDBGFBP pBp)
    957 #else
    958947/**
    959948 * Breakpoint enumeration callback function.
     
    966955 */
    967956static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, DBGFBP hBp, PCDBGFBPPUB pBp)
    968 #endif
    969957{
    970958    PDBGC   pDbgc   = (PDBGC)pvUser;
    971 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    972     PDBGCBP pDbgcBp = dbgcBpGet(pDbgc, pBp->iBp);
    973 #else
    974959    PDBGCBP pDbgcBp = dbgcBpGet(pDbgc, hBp);
    975 #endif
    976960
    977961    /*
    978962     * BP type and size.
    979963     */
    980 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    981     DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%#4x %c ", pBp->iBp, pBp->fEnabled ? 'e' : 'd');
    982 #else
    983964    DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%#4x %c ", hBp, DBGF_BP_PUB_IS_ENABLED(pBp->fFlagsAndType) ? 'e' : 'd');
    984 #endif
    985965    bool fHasAddress = false;
    986 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    987     switch (pBp->enmType)
    988 #else
    989966    switch (DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType))
    990 #endif
    991967    {
    992968        case DBGFBPTYPE_INT3:
     
    1011987        }
    1012988
    1013 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1014         case DBGFBPTYPE_REM:
    1015             DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " r %RGv", pBp->u.Rem.GCPtr);
    1016             fHasAddress = true;
    1017             break;
    1018 #endif
    1019 
    1020989/** @todo realign the list when I/O and MMIO breakpoint command have been added and it's possible to test this code. */
    1021990        case DBGFBPTYPE_PORT_IO:
    1022991        case DBGFBPTYPE_MMIO:
    1023992        {
    1024 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1025             uint32_t fAccess = pBp->enmType == DBGFBPTYPE_PORT_IO ? pBp->u.PortIo.fAccess : pBp->u.Mmio.fAccess;
    1026             DBGCCmdHlpPrintf(&pDbgc->CmdHlp, pBp->enmType == DBGFBPTYPE_PORT_IO ?  " i" : " m");
    1027 #else
    1028993            uint32_t fAccess = DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType) == DBGFBPTYPE_PORT_IO ? pBp->u.PortIo.fAccess : pBp->u.Mmio.fAccess;
    1029994            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType) == DBGFBPTYPE_PORT_IO ?  " i" : " m");
    1030 #endif
    1031995            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " %c%c%c%c%c%c",
    1032996                             fAccess & DBGFBPIOACCESS_READ_MASK   ? 'r' : '-',
     
    10431007                             fAccess & DBGFBPIOACCESS_WRITE_QWORD ? '8' : '-',
    10441008                             fAccess & DBGFBPIOACCESS_WRITE_OTHER ? '+' : '-');
    1045 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1046             if (pBp->enmType == DBGFBPTYPE_PORT_IO)
    1047 #else
    10481009            if (DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType) == DBGFBPTYPE_PORT_IO)
    1049 #endif
    10501010                DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " %04x-%04x",
    10511011                                 pBp->u.PortIo.uPort, pBp->u.PortIo.uPort + pBp->u.PortIo.cPorts - 1);
     
    10561016
    10571017        default:
    1058 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1059             DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " unknown type %d!!", pBp->enmType);
    1060 #else
    10611018            DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " unknown type %d!!", DBGF_BP_PUB_GET_TYPE(pBp->fFlagsAndType));
    1062 #endif
    10631019            AssertFailed();
    10641020            break;
  • trunk/src/VBox/Debugger/DBGCRemoteKd.cpp

    r87580 r87594  
    11601160typedef struct KDCTXHWBP
    11611161{
    1162 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1163     /** The DBGF breakpoint handle if active, UINT32_MAX if not active. */
    1164     uint32_t                    hDbgfBp;
    1165 #else
    11661162    /** The DBGF breakpoint handle if active, NIL_DBGFBP if not active. */
    11671163    DBGFBP                      hDbgfBp;
    1168 #endif
    11691164    /** The linear address of the breakpoint if active. */
    11701165    RTGCPTR                     GCPtrBp;
     
    12451240#define KD_PTR_GET(a_pThis, a_GCPtr) ((a_pThis)->f32Bit ? (a_GCPtr) & ~UINT64_C(0xffffffff00000000) : (a_GCPtr))
    12461241
    1247 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1248 # define NIL_DBGFBP              ((uint32_t)UINT32_MAX)
    1249 #endif
    1250 
    12511242
    12521243/*********************************************************************************************************************************
    12531244*   Internal Functions                                                                                                           *
    12541245*********************************************************************************************************************************/
    1255 
    12561246static void dbgcKdCtxMsgSend(PKDCTX pThis, bool fWarning, const char *pszMsg);
    12571247
  • trunk/src/VBox/Debugger/Makefile.kmk

    r86755 r87594  
    3535Debugger_TEMPLATE  = VBOXR3
    3636Debugger_DEFS      = IN_VMM_R3 IN_DBG_R3 IN_DIS
    37 ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    38 Debugger_DEFS     += VBOX_WITH_LOTS_OF_DBGF_BPS
    39 endif
    4037ifneq ($(KBUILD_TYPE),release)
    4138 Debugger_DEFS    += VBOX_WITH_DEBUGGER_TCP_BY_DEFAULT
  • trunk/src/VBox/VMM/Makefile.kmk

    r87477 r87594  
    7171ifdef VBOX_WITH_DBGF_TRACING
    7272VBoxVMM_DEFS    += VBOX_WITH_DBGF_TRACING
    73 endif
    74 ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    75 VBoxVMM_DEFS    += VBOX_WITH_LOTS_OF_DBGF_BPS
    7673endif
    7774ifdef VBOX_WITH_DBGF_FLOW_TRACING
     
    10299        VMMR3/DBGFAddr.cpp \
    103100        VMMR3/DBGFAddrSpace.cpp \
    104         $(if-expr defined(VBOX_WITH_LOTS_OF_DBGF_BPS), VMMR3/DBGFR3Bp.cpp, VMMR3/DBGFBp.cpp) \
     101        VMMR3/DBGFR3Bp.cpp \
    105102        VMMR3/DBGFR3BugCheck.cpp \
    106103        VMMR3/DBGFCoreWrite.cpp \
     
    176173        VMMAll/CPUMAllMsrs.cpp \
    177174        VMMAll/DBGFAll.cpp \
    178         $(if-expr defined(VBOX_WITH_LOTS_OF_DBGF_BPS), VMMAll/DBGFAllBp.cpp,) \
     175        VMMAll/DBGFAllBp.cpp \
    179176        $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMAll/DBGFAllTracer.cpp,) \
    180177        VMMAll/HMAll.cpp \
     
    463460VMMR0_DEFS     += VBOX_WITH_DBGF_TRACING
    464461 endif
    465  ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    466 VMMR0_DEFS     += VBOX_WITH_LOTS_OF_DBGF_BPS
    467  endif
    468462 ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
    469463VMMR0_DEFS     += VMM_R0_SWITCH_STACK
     
    488482        VMMR0/CPUMR0A.asm \
    489483        VMMR0/DBGFR0.cpp \
    490         $(if-expr defined(VBOX_WITH_LOTS_OF_DBGF_BPS), VMMR0/DBGFR0Bp.cpp,) \
     484        VMMR0/DBGFR0Bp.cpp \
    491485        $(if-expr defined(VBOX_WITH_DBGF_TRACING), VMMR0/DBGFR0Tracer.cpp,) \
    492486        VMMR0/GIMR0.cpp \
  • trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp

    r86667 r87594  
    5050{
    5151    RTGCUINTREG uDr7 = X86_DR7_GD | X86_DR7_GE | X86_DR7_LE | X86_DR7_RA1_MASK;
    52 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    53     PDBGFBP     pBp = &pVM->dbgf.s.aHwBreakpoints[0];
    54     unsigned    cLeft = RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints);
    55     while (cLeft-- > 0)
    56     {
    57         if (    pBp->enmType == DBGFBPTYPE_REG
    58             &&  pBp->fEnabled)
    59         {
    60             static const uint8_t s_au8Sizes[8] =
    61             {
    62                 X86_DR7_LEN_BYTE, X86_DR7_LEN_BYTE, X86_DR7_LEN_WORD, X86_DR7_LEN_BYTE,
    63                 X86_DR7_LEN_DWORD,X86_DR7_LEN_BYTE, X86_DR7_LEN_BYTE, X86_DR7_LEN_QWORD
    64             };
    65             uDr7 |= X86_DR7_G(pBp->u.Reg.iReg)
    66                  |  X86_DR7_RW(pBp->u.Reg.iReg, pBp->u.Reg.fType)
    67                  |  X86_DR7_LEN(pBp->u.Reg.iReg, s_au8Sizes[pBp->u.Reg.cb]);
    68         }
    69         pBp++;
    70     }
    71 #else
    7252    for (uint32_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); i++)
    7353    {
    74         PCDBGFBPHW  pBp = &pVM->dbgf.s.aHwBreakpoints[i];
    75 
    76         if (    pBp->hBp != NIL_DBGFBP
    77             &&  pBp->fEnabled)
     54        if (   pVM->dbgf.s.aHwBreakpoints[i].fEnabled
     55            && pVM->dbgf.s.aHwBreakpoints[i].hBp != NIL_DBGFBP)
    7856        {
    7957            static const uint8_t s_au8Sizes[8] =
     
    8361            };
    8462            uDr7 |= X86_DR7_G(i)
    85                  |  X86_DR7_RW(i, pBp->fType)
    86                  |  X86_DR7_LEN(i, s_au8Sizes[pBp->cb]);
    87         }
    88         pBp++;
     63                 |  X86_DR7_RW(i, pVM->dbgf.s.aHwBreakpoints[i].fType)
     64                 |  X86_DR7_LEN(i, s_au8Sizes[pVM->dbgf.s.aHwBreakpoints[i].cb]);
     65        }
    8966    }
    90 #endif
    9167    return uDr7;
    9268}
     
    10177VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM)
    10278{
    103 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    104     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[0];
    105     Assert(pBp->u.Reg.iReg == 0);
    106     return pBp->u.Reg.GCPtr;
    107 #else
    108     PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[0];
    109     return pBp->GCPtr;
    110 #endif
     79    return pVM->dbgf.s.aHwBreakpoints[0].GCPtr;
    11180}
    11281
     
    12089VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM)
    12190{
    122 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    123     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[1];
    124     Assert(pBp->u.Reg.iReg == 1);
    125     return pBp->u.Reg.GCPtr;
    126 #else
    127     PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[1];
    128     return pBp->GCPtr;
    129 #endif
     91    return pVM->dbgf.s.aHwBreakpoints[1].GCPtr;
    13092}
    13193
     
    139101VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM)
    140102{
    141 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    142     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[2];
    143     Assert(pBp->u.Reg.iReg == 2);
    144     return pBp->u.Reg.GCPtr;
    145 #else
    146     PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[2];
    147     return pBp->GCPtr;
    148 #endif
     103    return pVM->dbgf.s.aHwBreakpoints[2].GCPtr;
    149104}
    150105
     
    158113VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM)
    159114{
    160 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    161     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[3];
    162     Assert(pBp->u.Reg.iReg == 3);
    163     return pBp->u.Reg.GCPtr;
    164 #else
    165     PCDBGFBPHW pBp = &pVM->dbgf.s.aHwBreakpoints[3];
    166     return pBp->GCPtr;
    167 #endif
     115    return pVM->dbgf.s.aHwBreakpoints[3].GCPtr;
    168116}
    169117
     
    204152VMM_INT_DECL(bool) DBGFBpIsInt3Armed(PVM pVM)
    205153{
    206 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
     154    /** @todo There was a todo here and returning false when I (bird) removed
     155     *        VBOX_WITH_LOTS_OF_DBGF_BPS, so this might not be correct. */
    207156    return pVM->dbgf.s.cEnabledInt3Breakpoints > 0;
    208 #else
    209     RT_NOREF(pVM);
    210     return false; /** @todo */
    211 #endif
    212157}
    213158
     
    222167 *          been updated appropriately.
    223168 *
    224  * @param   pVM        The cross context VM structure.
     169 * @param   pVM         The cross context VM structure.
    225170 * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
    226171 * @param   pCtx        The CPU context for the calling EMT.
     
    241186        for (unsigned iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); iBp++)
    242187        {
    243 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    244             if (   pVM->dbgf.s.aHwBreakpoints[iBp].u.Reg.fType == X86_DR7_RW_IO
     188            if (   pVM->dbgf.s.aHwBreakpoints[iBp].fType == X86_DR7_RW_IO
    245189                && pVM->dbgf.s.aHwBreakpoints[iBp].fEnabled
    246                 && pVM->dbgf.s.aHwBreakpoints[iBp].enmType     == DBGFBPTYPE_REG )
     190                && pVM->dbgf.s.aHwBreakpoints[iBp].hBp   == NIL_DBGFBP) /** @todo r=bird: this cannot be right... */
    247191            {
    248                 uint8_t  cbReg      = pVM->dbgf.s.aHwBreakpoints[iBp].u.Reg.cb; Assert(RT_IS_POWER_OF_TWO(cbReg));
    249                 uint64_t uDrXFirst  = pVM->dbgf.s.aHwBreakpoints[iBp].u.Reg.GCPtr & ~(uint64_t)(cbReg - 1);
     192                uint8_t  cbReg      = pVM->dbgf.s.aHwBreakpoints[iBp].cb; Assert(RT_IS_POWER_OF_TWO(cbReg));
     193                uint64_t uDrXFirst  = pVM->dbgf.s.aHwBreakpoints[iBp].GCPtr & ~(uint64_t)(cbReg - 1);
    250194                uint64_t uDrXLast   = uDrXFirst + cbReg - 1;
    251195                if (uDrXFirst <= uIoPortLast && uDrXLast >= uIoPortFirst)
    252196                {
    253197                    /* (See also DBGFRZTrap01Handler.) */
    254                     pVCpu->dbgf.s.iActiveBp = pVM->dbgf.s.aHwBreakpoints[iBp].iBp;
    255                     pVCpu->dbgf.s.fSingleSteppingRaw = false;
    256 
    257                     LogFlow(("DBGFBpCheckIo: hit hw breakpoint %d at %04x:%RGv (iop %#x)\n",
    258                              pVM->dbgf.s.aHwBreakpoints[iBp].iBp, pCtx->cs.Sel, pCtx->rip, uIoPort));
    259                     return VINF_EM_DBG_BREAKPOINT;
    260                 }
    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;
     198                    pVCpu->dbgf.s.hBpActive = pVM->dbgf.s.aHwBreakpoints[iBp].hBp;
    276199                    pVCpu->dbgf.s.fSingleSteppingRaw = false;
    277200
     
    281204                }
    282205            }
    283 #endif
    284206        }
    285207    }
  • trunk/src/VBox/VMM/VMMAll/DBGFAllBp.cpp

    r87132 r87594  
    3232#include <iprt/assert.h>
    3333
    34 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    35 # include "DBGFInline.h"
    36 #endif
     34#include "DBGFInline.h"
    3735
    3836
     
    4240
    4341
    44 /*********************************************************************************************************************************
    45 *   Internal Functions                                                                                                           *
    46 *********************************************************************************************************************************/
    47 
    48 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    4942/**
    5043 * Returns the internal breakpoint state for the given handle.
     
    5649 *                              on success, optional.
    5750 */
    58 # ifdef IN_RING0
     51#ifdef IN_RING0
    5952DECLINLINE(PDBGFBPINT) dbgfBpGetByHnd(PVMCC pVM, DBGFBP hBp, PDBGFBPINTR0 *ppBpR0)
    60 # else
     53#else
    6154DECLINLINE(PDBGFBPINT) dbgfBpGetByHnd(PVMCC pVM, DBGFBP hBp)
    62 # endif
     55#endif
    6356{
    6457    uint32_t idChunk  = DBGF_BP_HND_GET_CHUNK_ID(hBp);
     
    6861    AssertReturn(idxEntry < DBGF_BP_COUNT_PER_CHUNK, NULL);
    6962
    70 # ifdef IN_RING0
     63#ifdef IN_RING0
    7164    PDBGFBPCHUNKR0 pBpChunk = &pVM->dbgfr0.s.aBpChunks[idChunk];
    7265    AssertPtrReturn(pBpChunk->CTX_SUFF(paBpBaseShared), NULL);
     
    7568        *ppBpR0 = &pBpChunk->paBpBaseR0Only[idxEntry];
    7669    return &pBpChunk->CTX_SUFF(paBpBaseShared)[idxEntry];
    77 # elif defined(IN_RING3)
     70
     71#elif defined(IN_RING3)
    7872    PUVM pUVM = pVM->pUVM;
    7973    PDBGFBPCHUNKR3 pBpChunk = &pUVM->dbgf.s.aBpChunks[idChunk];
     
    8175
    8276    return &pBpChunk->CTX_SUFF(pBpBase)[idxEntry];
    83 # else
    84 #  error "Unsupported host context"
    85 # endif
     77
     78#else
     79# error "Unsupported context"
     80#endif
    8681}
    8782
     
    10499    AssertReturn(idxEntry < DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK, NULL);
    105100
    106 # ifdef IN_RING0
     101#ifdef IN_RING0
    107102    PDBGFBPL2TBLCHUNKR0 pL2Chunk = &pVM->dbgfr0.s.aBpL2TblChunks[idChunk];
    108103    AssertPtrReturn(pL2Chunk->CTX_SUFF(paBpL2TblBaseShared), NULL);
    109104
    110105    return &pL2Chunk->CTX_SUFF(paBpL2TblBaseShared)[idxEntry];
    111 # elif defined(IN_RING3)
     106#elif defined(IN_RING3)
    112107    PUVM pUVM = pVM->pUVM;
    113108    PDBGFBPL2TBLCHUNKR3 pL2Chunk = &pUVM->dbgf.s.aBpL2TblChunks[idChunk];
     
    116111
    117112    return &pL2Chunk->CTX_SUFF(pL2Base)[idxEntry];
    118 # endif
    119 }
    120 
    121 
    122 # ifdef IN_RING0
     113#endif
     114}
     115
     116
     117#ifdef IN_RING0
    123118/**
    124119 * Returns the internal breakpoint owner state for the given handle.
     
    140135    return pBpOwnerR0;
    141136}
    142 # endif
     137#endif
    143138
    144139
     
    154149 * @param   pBpR0       The ring-0 only breakpoint state.
    155150 */
    156 # ifdef IN_RING0
    157 DECLINLINE(int) dbgfBpHit(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame,
    158                           DBGFBP hBp, PDBGFBPINT pBp, PDBGFBPINTR0 pBpR0)
    159 # else
    160 DECLINLINE(int) dbgfBpHit(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame,
    161                           DBGFBP hBp, PDBGFBPINT pBp)
    162 # endif
     151#ifdef IN_RING0
     152DECLINLINE(int) dbgfBpHit(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame, DBGFBP hBp, PDBGFBPINT pBp, PDBGFBPINTR0 pBpR0)
     153#else
     154DECLINLINE(int) dbgfBpHit(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame, DBGFBP hBp, PDBGFBPINT pBp)
     155#endif
    163156{
    164157    uint64_t cHits = ASMAtomicIncU64(&pBp->Pub.cHits); RT_NOREF(cHits);
     
    169162
    170163    int rc = VINF_EM_DBG_BREAKPOINT;
    171 # ifdef IN_RING0
     164#ifdef IN_RING0
    172165    PCDBGFBPOWNERINTR0 pBpOwnerR0 = dbgfR0BpOwnerGetByHnd(pVM,
    173166                                                            pBpR0->fInUse
     
    208201        pVCpu->dbgf.s.hBpActive              = hBp;
    209202    }
    210 # else
     203#else
    211204    RT_NOREF(pVM);
    212205    pVCpu->dbgf.s.fBpInvokeOwnerCallback = true;
    213206    pVCpu->dbgf.s.hBpActive = hBp;
    214 # endif
     207#endif
    215208
    216209    return rc;
     
    249242
    250243            /* Query the internal breakpoint state from the handle. */
    251 # ifdef IN_RING0
     244#ifdef IN_RING3
     245            PDBGFBPINT   pBp = dbgfBpGetByHnd(pVM, hBp);
     246#else
    252247            PDBGFBPINTR0 pBpR0 = NULL;
    253             PDBGFBPINT pBp = dbgfBpGetByHnd(pVM, hBp, &pBpR0);
    254 # else
    255             PDBGFBPINT pBp = dbgfBpGetByHnd(pVM, hBp);
    256 # endif
     248            PDBGFBPINT   pBp = dbgfBpGetByHnd(pVM, hBp, &pBpR0);
     249#endif
    257250            if (   pBp
    258251                && DBGF_BP_PUB_GET_TYPE(pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3)
    259                 return dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp
    260 # ifdef IN_RING0
    261                                  , pBpR0
    262 # endif
    263                                  );
     252#ifdef IN_RING3
     253                return dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp);
     254#else
     255                return dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp, pBpR0);
     256#endif
    264257
    265258            /* The entry got corrupted, just abort. */
     
    280273    return VERR_DBGF_BP_L2_LOOKUP_FAILED;
    281274}
    282 #endif /* !VBOX_WITH_LOTS_OF_DBGF_BPS */
    283275
    284276
     
    309301    {
    310302        for (unsigned iBp = 0; iBp < RT_ELEMENTS(pVM->dbgf.s.aHwBreakpoints); iBp++)
    311         {
    312 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    313             if (    ((uint32_t)uDr6 & RT_BIT_32(iBp))
    314                 &&  pVM->dbgf.s.aHwBreakpoints[iBp].enmType == DBGFBPTYPE_REG)
    315             {
    316                 pVCpu->dbgf.s.iActiveBp = pVM->dbgf.s.aHwBreakpoints[iBp].iBp;
    317                 pVCpu->dbgf.s.fSingleSteppingRaw = false;
    318                 LogFlow(("DBGFRZTrap03Handler: hit hw breakpoint %d at %04x:%RGv\n",
    319                          pVM->dbgf.s.aHwBreakpoints[iBp].iBp, pRegFrame->cs.Sel, pRegFrame->rip));
    320 
    321                 return VINF_EM_DBG_BREAKPOINT;
    322             }
    323 #else
    324303            if (    ((uint32_t)uDr6 & RT_BIT_32(iBp))
    325304                &&  pVM->dbgf.s.aHwBreakpoints[iBp].hBp != NIL_DBGFBP)
     
    332311                return VINF_EM_DBG_BREAKPOINT;
    333312            }
    334 #endif
    335         }
    336313    }
    337314
     
    340317     * Are we single stepping or is it the guest?
    341318     */
    342     if (    (uDr6 & X86_DR6_BS)
    343         &&  (pVCpu->dbgf.s.fSingleSteppingRaw || fAltStepping))
     319    if (   (uDr6 & X86_DR6_BS)
     320        && (pVCpu->dbgf.s.fSingleSteppingRaw || fAltStepping))
    344321    {
    345322        pVCpu->dbgf.s.fSingleSteppingRaw = false;
     
    366343VMM_INT_DECL(int) DBGFTrap03Handler(PVMCC pVM, PVMCPUCC pVCpu, PCPUMCTXCORE pRegFrame)
    367344{
    368 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    369     /*
    370      * Get the trap address and look it up in the breakpoint table.
    371      * Don't bother if we don't have any breakpoints.
    372      */
    373     unsigned cToSearch = pVM->dbgf.s.Int3.cToSearch;
    374     if (cToSearch > 0)
    375     {
    376         RTGCPTR pPc;
    377         int rc = SELMValidateAndConvertCSAddr(pVCpu, pRegFrame->eflags, pRegFrame->ss.Sel, pRegFrame->cs.Sel, &pRegFrame->cs,
    378                                               pRegFrame->rip /* no -1 in R0 */,
    379                                               &pPc);
    380         AssertRCReturn(rc, rc);
    381 
    382         unsigned iBp = pVM->dbgf.s.Int3.iStartSearch;
    383         while (cToSearch-- > 0)
    384         {
    385             if (   pVM->dbgf.s.aBreakpoints[iBp].u.GCPtr == (RTGCUINTPTR)pPc
    386                 && pVM->dbgf.s.aBreakpoints[iBp].enmType == DBGFBPTYPE_INT3)
    387             {
    388                 pVM->dbgf.s.aBreakpoints[iBp].cHits++;
    389                 pVCpu->dbgf.s.iActiveBp = pVM->dbgf.s.aBreakpoints[iBp].iBp;
    390 
    391                 LogFlow(("DBGFRZTrap03Handler: hit breakpoint %d at %RGv (%04x:%RGv) cHits=0x%RX64\n",
    392                          pVM->dbgf.s.aBreakpoints[iBp].iBp, pPc, pRegFrame->cs.Sel, pRegFrame->rip,
    393                          pVM->dbgf.s.aBreakpoints[iBp].cHits));
    394                 return VINF_EM_DBG_BREAKPOINT;
    395             }
    396             iBp++;
    397         }
    398     }
    399 #else
    400 # if defined(IN_RING0)
     345#if defined(IN_RING0)
    401346    uint32_t volatile *paBpLocL1 = pVM->dbgfr0.s.CTX_SUFF(paBpLocL1);
    402 # elif defined(IN_RING3)
     347#elif defined(IN_RING3)
    403348    PUVM pUVM = pVM->pUVM;
    404349    uint32_t volatile *paBpLocL1 = pUVM->dbgf.s.CTX_SUFF(paBpLocL1);
    405 # else
    406 #  error "Unsupported host context"
    407 # endif
     350#else
     351# error "Unsupported host context"
     352#endif
    408353    if (paBpLocL1)
    409354    {
     
    427372
    428373                /* Query the internal breakpoint state from the handle. */
    429 #ifdef IN_RING0
     374#ifdef IN_RING3
     375                PDBGFBPINT   pBp = dbgfBpGetByHnd(pVM, hBp);
     376#else
    430377                PDBGFBPINTR0 pBpR0 = NULL;
    431 #endif
    432                 PDBGFBPINT pBp = dbgfBpGetByHnd(pVM, hBp
    433 #ifdef IN_RING0
    434                                                 , &pBpR0
    435 #endif
    436                                                 );
     378                PDBGFBPINT   pBp = dbgfBpGetByHnd(pVM, hBp, &pBpR0);
     379#endif
    437380                if (   pBp
    438381                    && DBGF_BP_PUB_GET_TYPE(pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3)
    439382                {
    440383                    if (pBp->Pub.u.Int3.GCPtr == (RTGCUINTPTR)GCPtrBp)
    441                         rc = dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp
    442 #ifdef IN_RING0
    443                                        , pBpR0
    444 #endif
    445                                        );
     384#ifdef IN_RING3
     385                        rc = dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp);
     386#else
     387                        rc = dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp, pBpR0);
     388#endif
    446389                    /* else: Genuine guest trap. */
    447390                }
     
    459402        return rc;
    460403    }
    461 #endif /* !VBOX_WITH_LOTS_OF_DBGF_BPS */
    462404
    463405    return VINF_EM_RAW_GUEST_TRAP;
  • trunk/src/VBox/VMM/VMMR0/DBGFR0.cpp

    r86699 r87594  
    4040
    4141
    42 /*********************************************************************************************************************************
    43 *   Internal Functions                                                                                                           *
    44 *********************************************************************************************************************************/
    4542
    4643/**
     
    5653    pGVM->dbgfr0.s.pTracerR0 = NULL;
    5754
    58 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    5955    dbgfR0BpInit(pGVM);
    60 #endif
    6156}
    6257
     
    7368#endif
    7469
    75 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    7670    dbgfR0BpDestroy(pGVM);
    77 #endif
    7871}
    7972
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r87591 r87594  
    22572257            if (!pReqHdr || u64Arg)
    22582258                return VERR_INVALID_PARAMETER;
    2259 #if 0 /** @todo */
     2259# if 0 /** @todo */
    22602260            rc = DBGFR0TracerGenCallReqHandler(pGVM, (PDBGFTRACERGENCALLREQ)pReqHdr, idCpu);
    2261 #else
     2261# else
    22622262            rc = VERR_NOT_IMPLEMENTED;
    2263 #endif
    2264             VMM_CHECK_SMAP_CHECK2(pGVM, RT_NOTHING);
    2265             break;
    2266         }
    2267 #endif
    2268 
    2269 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
     2263# endif
     2264            VMM_CHECK_SMAP_CHECK2(pGVM, RT_NOTHING);
     2265            break;
     2266        }
     2267#endif
     2268
    22702269        case VMMR0_DO_DBGF_BP_INIT:
    22712270        {
     
    23032302            break;
    23042303        }
    2305 #endif
    23062304
    23072305        /*
     
    24072405            case VMMR0_DO_IOM_GROW_IO_PORTS:
    24082406            case VMMR0_DO_IOM_GROW_IO_PORT_STATS:
    2409 
    2410 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    24112407            case VMMR0_DO_DBGF_BP_INIT:
    24122408            case VMMR0_DO_DBGF_BP_CHUNK_ALLOC:
    24132409            case VMMR0_DO_DBGF_BP_L2_TBL_CHUNK_ALLOC:
    2414 #endif
    24152410            {
    24162411                PGVMCPU        pGVCpu        = &pGVM->aCpus[idCpu];
  • trunk/src/VBox/VMM/VMMR3/DBGF.cpp

    r86755 r87594  
    149149                if (RT_SUCCESS(rc))
    150150                {
    151 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    152                     rc = dbgfR3BpInit(pVM);
    153 #else
    154151                    rc = dbgfR3BpInit(pUVM);
    155 #endif
    156152                    if (RT_SUCCESS(rc))
    157153                    {
     
    178174                            dbgfR3OSTermPart2(pUVM);
    179175                        }
    180 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    181176                        dbgfR3BpTerm(pUVM);
    182 #endif
    183177                    }
    184178                    dbgfR3AsTerm(pUVM);
     
    210204    dbgfR3PlugInTerm(pUVM);
    211205    dbgfR3OSTermPart2(pUVM);
    212 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    213206    dbgfR3BpTerm(pUVM);
    214 #endif
    215207    dbgfR3AsTerm(pUVM);
    216208    dbgfR3RegTerm(pUVM);
     
    785777     */
    786778    DBGFEVENT DbgEvent;
    787 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    788     RTUINT iBp = DbgEvent.u.Bp.hBp = pVCpu->dbgf.s.iActiveBp;
    789     pVCpu->dbgf.s.iActiveBp = ~0U;
    790     if (iBp != ~0U)
    791     {
    792         DbgEvent.enmCtx = DBGFEVENTCTX_RAW;
    793         return dbgfR3SendEventWaitEx(pVM, pVCpu, enmEvent, DBGFEVENTCTX_RAW, &DbgEvent.u, sizeof(DbgEvent.u.Bp));
    794     }
    795 #else
    796779    DbgEvent.u.Bp.hBp = pVCpu->dbgf.s.hBpActive;
    797780    pVCpu->dbgf.s.hBpActive = NIL_DBGFBP;
     
    801784        return dbgfR3SendEventWaitEx(pVM, pVCpu, enmEvent, DBGFEVENTCTX_RAW, &DbgEvent.u, sizeof(DbgEvent.u.Bp));
    802785    }
    803 #endif
    804 
    805 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    806     AssertFailed(); /** @todo this should be obsolete now...   */
    807 
    808     /* REM breakpoints has be been searched for. */
    809 #if 0   /** @todo get flat PC api! */
    810     uint32_t eip = CPUMGetGuestEIP(pVM);
    811 #else
    812     PCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    813     RTGCPTR  eip = pCtx->rip + pCtx->cs.u64Base;
    814 #endif
    815     for (size_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.aBreakpoints); i++)
    816         if (    pVM->dbgf.s.aBreakpoints[i].enmType == DBGFBPTYPE_REM
    817             &&  pVM->dbgf.s.aBreakpoints[i].u.Rem.GCPtr == eip)
    818         {
    819             DbgEvent.u.Bp.hBp = pVM->dbgf.s.aBreakpoints[i].iBp;
    820             break;
    821         }
    822     AssertMsg(DbgEvent.u.Bp.hBp != ~0U, ("eip=%08x\n", eip));
    823     return dbgfR3SendEventWaitEx(pVM, pVCpu, enmEvent, DBGFEVENTCTX_REM, &DbgEvent.u, sizeof(DbgEvent.u.Bp));
    824 #else
     786
    825787    return VERR_DBGF_IPE_1;
    826 #endif
    827788}
    828789
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r87130 r87594  
    839839
    840840            case VINF_EM_DBG_BREAKPOINT:
    841 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    842841                rc = DBGFR3BpHit(pVM, pVCpu);
    843 #else
    844                 rc = DBGFR3EventBreakpoint(pVM, DBGFEVENT_BREAKPOINT);
    845 #endif
    846842                break;
    847843
  • trunk/src/VBox/VMM/include/DBGFInternal.h

    r87130 r87594  
    5555
    5656
    57 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    5857/** @name Global breakpoint table handling defines.
    5958 * @{ */
     
    8180#define DBGF_BP_L2_TBL_CHUNK_COUNT          (DBGF_BP_L2_TBL_ENTRY_COUNT_MAX / DBGF_BP_L2_TBL_ENTRIES_PER_CHUNK)
    8281/** @} */
    83 #endif
    8482
    8583
     
    775773
    776774
    777 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    778 /**
    779  * Breakpoint search optimization.
    780  */
    781 typedef struct DBGFBPSEARCHOPT
    782 {
    783     /** Where to start searching for hits.
    784      * (First enabled is #DBGF::aBreakpoints[iStartSearch]). */
    785     uint32_t volatile       iStartSearch;
    786     /** The number of aBreakpoints entries to search.
    787      * (Last enabled is #DBGF::aBreakpoints[iStartSearch + cToSearch - 1])  */
    788     uint32_t volatile       cToSearch;
    789 } DBGFBPSEARCHOPT;
    790 /** Pointer to a breakpoint search optimziation structure. */
    791 typedef DBGFBPSEARCHOPT *PDBGFBPSEARCHOPT;
    792 #else
    793 
    794775/** An invalid breakpoint chunk ID. */
    795776#define DBGF_BP_CHUNK_ID_INVALID                    UINT32_MAX
     
    10871068/** Pointer to a breakpoint L2 lookup table chunk - Ring-0 Ptr. */
    10881069typedef R0PTRTYPE(DBGFBPL2TBLCHUNKR0 *) PDBGFBPL2TBLCHUNKR0;
    1089 #endif
    10901070
    10911071
     
    11171097    /** The number of enabled hardware I/O breakpoints. */
    11181098    uint8_t                     cEnabledHwIoBreakpoints;
    1119 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
     1099    uint8_t                     au8Alignment1[2]; /**< Alignment padding. */
    11201100    /** The number of enabled INT3 breakpoints. */
    1121     uint8_t                     cEnabledInt3Breakpoints;
    1122     uint8_t                     abPadding; /**< Unused padding space up for grabs. */
    1123     uint32_t                    uPadding;
    1124 #else
    1125     uint16_t                    u16Pad; /**< Unused padding space up for grabs. */
    1126     /** The number of enabled INT3 breakpoints. */
    1127     volatile uint32_t           cEnabledInt3Breakpoints;
    1128 #endif
     1101    uint32_t volatile           cEnabledInt3Breakpoints;
    11291102
    11301103    /** Debugger Attached flag.
     
    11611134    } SteppingFilter;
    11621135
    1163     uint32_t                    u32Padding[2]; /**< Alignment padding. */
    1164 
    1165 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1166     /** Array of hardware breakpoints. (0..3)
    1167      * This is shared among all the CPUs because life is much simpler that way. */
    1168     DBGFBP                      aHwBreakpoints[4];
    1169     /** Array of int 3 and REM breakpoints. (4..)
    1170      * @remark This is currently a fixed size array for reasons of simplicity. */
    1171     DBGFBP                      aBreakpoints[32];
    1172 
    1173     /** MMIO breakpoint search optimizations. */
    1174     DBGFBPSEARCHOPT             Mmio;
    1175     /** I/O port breakpoint search optimizations. */
    1176     DBGFBPSEARCHOPT             PortIo;
    1177     /** INT3 breakpoint search optimizations. */
    1178     DBGFBPSEARCHOPT             Int3;
    1179 #else
     1136    uint32_t                    au32Alignment2[2]; /**< Alignment padding. */
     1137
    11801138    /** @name Breakpoint handling related state.
    11811139     * @{ */
    11821140    /** Array of hardware breakpoints (0..3).
    11831141     * This is shared among all the CPUs because life is much simpler that way. */
    1184     DBGFBPHW                        aHwBreakpoints[4];
     1142    DBGFBPHW                    aHwBreakpoints[4];
    11851143    /** @} */
    1186 #endif
    11871144
    11881145    /**
     
    12491206    uint32_t                offVM;
    12501207
    1251 #ifndef VBOX_WITH_LOTS_OF_DBGF_BPS
    1252     /** Current active breakpoint (id).
    1253      * This is ~0U if not active. It is set when a execution engine
    1254      * encounters a breakpoint and returns VINF_EM_DBG_BREAKPOINT. This is
    1255      * currently not used for REM breakpoints because of the lazy coupling
    1256      * between VBox and REM.
    1257      *
    1258      * @todo drop this in favor of aEvents!  */
    1259     uint32_t                iActiveBp;
    1260 #else
     1208    /** Flag whether the to invoke any owner handlers in ring-3 before dropping into the debugger. */
     1209    bool                    fBpInvokeOwnerCallback;
     1210    /** Set if we're singlestepping in raw mode.
     1211     * This is checked and cleared in the \#DB handler. */
     1212    bool                    fSingleSteppingRaw;
     1213    /** Alignment padding. */
     1214    bool                    afPadding[2];
    12611215    /** Current active breakpoint handle.
    12621216     * This is NIL_DBGFBP if not active. It is set when a execution engine
     
    12651219     * @todo drop this in favor of aEvents!  */
    12661220    DBGFBP                  hBpActive;
    1267     /** Flag whether the to invoke any owner handlers in ring-3 before dropping into the debugger. */
    1268     bool                    fBpInvokeOwnerCallback;
    1269 #endif
    1270     /** Set if we're singlestepping in raw mode.
    1271      * This is checked and cleared in the \#DB handler. */
    1272     bool                    fSingleSteppingRaw;
    1273 
    1274     /** Alignment padding. */
    1275     bool                    afPadding[3];
    12761221
    12771222    /** The number of events on the stack (aEvents).
     
    13261271    R0PTRTYPE(struct DBGFTRACERINSR0 *) pTracerR0;
    13271272
    1328 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    13291273    /** @name Breakpoint handling related state, Ring-0 only part.
    13301274     * @{ */
     
    13491293    bool                                fInit;
    13501294    /** @} */
    1351 #endif
    13521295} DBGFR0PERVM;
    13531296
     
    14241367    /** @} */
    14251368
    1426 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    14271369    /** @name Breakpoint handling related state.
    14281370     * @{ */
     
    14421384    RTSEMFASTMUTEX                  hMtxBpL2Wr;
    14431385    /** @} */
    1444 #endif
    14451386
    14461387    /** The type database lock. */
     
    14901431void dbgfR3AsTerm(PUVM pUVM);
    14911432void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta);
    1492 #ifdef VBOX_WITH_LOTS_OF_DBGF_BPS
    14931433DECLHIDDEN(int) dbgfR3BpInit(PUVM pUVM);
    14941434DECLHIDDEN(int) dbgfR3BpTerm(PUVM pUVM);
    1495 #else
    1496 int  dbgfR3BpInit(PVM pVM);
    1497 #endif
    14981435int  dbgfR3InfoInit(PUVM pUVM);
    14991436int  dbgfR3InfoTerm(PUVM pUVM);
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