- Timestamp:
- Feb 17, 2021 12:21:16 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
include/VBox/vmm/dbgf.h (modified) (5 diffs)
-
src/VBox/Debugger/DBGCEmulateCodeView.cpp (modified) (4 diffs)
-
src/VBox/VMM/VMMAll/DBGFAllBp.cpp (modified) (4 diffs)
-
src/VBox/VMM/VMMR3/DBGFR3Bp.cpp (modified) (31 diffs)
-
src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/dbgf.h
r87595 r87776 874 874 * debugger). */ 875 875 DBGFBPOWNER hOwner; 876 /** Breakpoint type and flags, see DBGFBPTYPE for type and DBGF_BP_F_XXX for flags. 877 * Needs to be smashed together to be able to stay in the size limits. */ 878 uint32_t fFlagsAndType; 876 /** Breakpoint type stored as a 16bit integer to stay within size limits. */ 877 uint16_t u16Type; 878 /** Breakpoint flags. */ 879 uint16_t fFlags; 879 880 880 881 /** Union of type specific data. */ … … 943 944 typedef const DBGFBPPUB *PCDBGFBPPUB; 944 945 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. */ 948 #define DBGF_BP_PUB_SET_FLAGS_AND_TYPE(a_enmType, a_fFlags) ((uint32_t)(a_enmType) | (a_fFlags)) 949 /** Returns the type of the DBGFPUB::fFlagsAndType member. */ 950 #define DBGF_BP_PUB_GET_TYPE(a_fFlagsAndType) ((DBGFBPTYPE)((a_fFlagsAndType) & (UINT32_C(0x7fffffff)))) 951 /** Returns the enabled status of DBGFPUB::fFlagsAndType member. */ 952 #define DBGF_BP_PUB_IS_ENABLED(a_fFlagsAndType) RT_BOOL((a_fFlagsAndType) & DBGF_BP_F_ENABLED) 953 954 /** @name Possible DBGFBPPUB::fFlagsAndType flags. 946 /** Sets the DBGFPUB::u16Type member. */ 947 #define DBGF_BP_PUB_MAKE_TYPE(a_enmType) ((uint16_t)(a_enmType)) 948 /** Returns the type of the DBGFPUB::u16Type member. */ 949 #define DBGF_BP_PUB_GET_TYPE(a_pBp) ((DBGFBPTYPE)((a_pBp)->u16Type)) 950 /** Returns the enabled status of DBGFPUB::fFlags member. */ 951 #define DBGF_BP_PUB_IS_ENABLED(a_pBp) RT_BOOL((a_pBp)->fFlags & DBGF_BP_F_ENABLED) 952 /** Returns whether DBGF_BP_F_HIT_EXEC_BEFORE is set for DBGFPUB::fFlags. */ 953 #define DBGF_BP_PUB_IS_EXEC_BEFORE(a_pBp) RT_BOOL((a_pBp)->fFlags & DBGF_BP_F_HIT_EXEC_BEFORE) 954 /** Returns whether DBGF_BP_F_HIT_EXEC_AFTER is set for DBGFPUB::fFlags. */ 955 #define DBGF_BP_PUB_IS_EXEC_AFTER(a_pBp) RT_BOOL((a_pBp)->fFlags & DBGF_BP_F_HIT_EXEC_AFTER) 956 957 958 /** @name Possible DBGFBPPUB::fFlags flags. 955 959 * @{ */ 956 /** Default flags . */957 #define DBGF_BP_F_DEFAULT 0960 /** Default flags, breakpoint is enabled and hits before the instruction is executed. */ 961 #define DBGF_BP_F_DEFAULT (DBGF_BP_F_ENABLED | DBGF_BP_F_HIT_EXEC_BEFORE) 958 962 /** Flag whether the breakpoint is enabled currently. */ 959 #define DBGF_BP_F_ENABLED RT_BIT_32(31) 963 #define DBGF_BP_F_ENABLED RT_BIT(0) 964 /** Flag indicating whether the action assoicated with the breakpoint should be carried out 965 * before the instruction causing the breakpoint to hit was executed. */ 966 #define DBGF_BP_F_HIT_EXEC_BEFORE RT_BIT(1) 967 /** Flag indicating whether the action assoicated with the breakpoint should be carried out 968 * after the instruction causing the breakpoint to hit was executed. */ 969 #define DBGF_BP_F_HIT_EXEC_AFTER RT_BIT(2) 960 970 /** @} */ 961 971 … … 974 984 * @param hBp The breakpoint handle. 975 985 * @param pBpPub Pointer to the readonly public state of the breakpoint. 986 * @param fFlags Flags indicating when the handler was called (DBGF_BP_F_HIT_EXEC_BEFORE vs DBGF_BP_F_HIT_EXEC_AFTER). 976 987 * 977 988 * @remarks The handler is called on the EMT of vCPU triggering the breakpoint and no locks are held. … … 979 990 * guru meditation. 980 991 */ 981 typedef DECLCALLBACKTYPE(VBOXSTRICTRC, FNDBGFBPHIT,(PVM pVM, VMCPUID idCpu, void *pvUserBp, DBGFBP hBp, PCDBGFBPPUB pBpPub)); 992 typedef DECLCALLBACKTYPE(VBOXSTRICTRC, FNDBGFBPHIT,(PVM pVM, VMCPUID idCpu, void *pvUserBp, DBGFBP hBp, PCDBGFBPPUB pBpPub, 993 uint16_t fFlags)); 982 994 /** Pointer to a FNDBGFBPHIT(). */ 983 995 typedef FNDBGFBPHIT *PFNDBGFBPHIT; … … 993 1005 uint64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp); 994 1006 VMMR3DECL(int) DBGFR3BpSetInt3Ex(PUVM pUVM, DBGFBPOWNER hOwner, void *pvUser, 995 VMCPUID idSrcCpu, PCDBGFADDRESS pAddress, 1007 VMCPUID idSrcCpu, PCDBGFADDRESS pAddress, uint16_t fFlags, 996 1008 uint64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp); 997 1009 VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, 998 1010 uint64_t iHitDisable, uint8_t fType, uint8_t cb, PDBGFBP phBp); 999 1011 VMMR3DECL(int) DBGFR3BpSetRegEx(PUVM pUVM, DBGFBPOWNER hOwner, void *pvUser, 1000 PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 1012 PCDBGFADDRESS pAddress, uint16_t fFlags, 1013 uint64_t iHitTrigger, uint64_t iHitDisable, 1001 1014 uint8_t fType, uint8_t cb, PDBGFBP phBp); 1002 1015 VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, -
trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp
r87594 r87776 962 962 * BP type and size. 963 963 */ 964 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%#4x %c ", hBp, DBGF_BP_PUB_IS_ENABLED(pBp ->fFlagsAndType) ? 'e' : 'd');964 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, "%#4x %c ", hBp, DBGF_BP_PUB_IS_ENABLED(pBp) ? 'e' : 'd'); 965 965 bool fHasAddress = false; 966 switch (DBGF_BP_PUB_GET_TYPE(pBp ->fFlagsAndType))966 switch (DBGF_BP_PUB_GET_TYPE(pBp)) 967 967 { 968 968 case DBGFBPTYPE_INT3: … … 991 991 case DBGFBPTYPE_MMIO: 992 992 { 993 uint32_t fAccess = DBGF_BP_PUB_GET_TYPE(pBp ->fFlagsAndType) == DBGFBPTYPE_PORT_IO ? pBp->u.PortIo.fAccess : pBp->u.Mmio.fAccess;994 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, DBGF_BP_PUB_GET_TYPE(pBp ->fFlagsAndType) == DBGFBPTYPE_PORT_IO ? " i" : " m");993 uint32_t fAccess = DBGF_BP_PUB_GET_TYPE(pBp) == DBGFBPTYPE_PORT_IO ? pBp->u.PortIo.fAccess : pBp->u.Mmio.fAccess; 994 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, DBGF_BP_PUB_GET_TYPE(pBp) == DBGFBPTYPE_PORT_IO ? " i" : " m"); 995 995 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " %c%c%c%c%c%c", 996 996 fAccess & DBGFBPIOACCESS_READ_MASK ? 'r' : '-', … … 1007 1007 fAccess & DBGFBPIOACCESS_WRITE_QWORD ? '8' : '-', 1008 1008 fAccess & DBGFBPIOACCESS_WRITE_OTHER ? '+' : '-'); 1009 if (DBGF_BP_PUB_GET_TYPE(pBp ->fFlagsAndType) == DBGFBPTYPE_PORT_IO)1009 if (DBGF_BP_PUB_GET_TYPE(pBp) == DBGFBPTYPE_PORT_IO) 1010 1010 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " %04x-%04x", 1011 1011 pBp->u.PortIo.uPort, pBp->u.PortIo.uPort + pBp->u.PortIo.cPorts - 1); … … 1016 1016 1017 1017 default: 1018 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " unknown type %d!!", DBGF_BP_PUB_GET_TYPE(pBp ->fFlagsAndType));1018 DBGCCmdHlpPrintf(&pDbgc->CmdHlp, " unknown type %d!!", DBGF_BP_PUB_GET_TYPE(pBp)); 1019 1019 AssertFailed(); 1020 1020 break; -
trunk/src/VBox/VMM/VMMAll/DBGFAllBp.cpp
r87594 r87776 169 169 if (pBpOwnerR0) 170 170 { 171 VBOXSTRICTRC rcStrict = pBpOwnerR0->pfnBpHitR0(pVM, pVCpu->idCpu, pBpR0->pvUserR0, hBp, &pBp->Pub); 171 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 172 173 if (DBGF_BP_PUB_IS_EXEC_BEFORE(&pBp->Pub)) 174 rcStrict = pBpOwnerR0->pfnBpHitR0(pVM, pVCpu->idCpu, pBpR0->pvUserR0, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_BEFORE); 172 175 if (rcStrict == VINF_SUCCESS) 173 176 { … … 181 184 abInstr[0] = pBp->Pub.u.Int3.bOrg; 182 185 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr, &abInstr[0], sizeof(abInstr)); 183 rc = VBOXSTRICTRC_VAL(rcStrict); 186 if ( rcStrict == VINF_SUCCESS 187 && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub)) 188 { 189 rcStrict = pBpOwnerR0->pfnBpHitR0(pVM, pVCpu->idCpu, pBpR0->pvUserR0, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_AFTER); 190 if (rcStrict == VINF_SUCCESS) 191 rc = VINF_SUCCESS; 192 else if ( rcStrict == VINF_DBGF_BP_HALT 193 || rcStrict == VINF_DBGF_R3_BP_OWNER_DEFER) 194 { 195 pVCpu->dbgf.s.hBpActive = hBp; 196 if (rcStrict == VINF_DBGF_R3_BP_OWNER_DEFER) 197 pVCpu->dbgf.s.fBpInvokeOwnerCallback = true; 198 else 199 pVCpu->dbgf.s.fBpInvokeOwnerCallback = false; 200 } 201 else /* Guru meditation. */ 202 rc = VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS; 203 } 204 else 205 rc = VBOXSTRICTRC_VAL(rcStrict); 184 206 } 185 207 } … … 249 271 #endif 250 272 if ( pBp 251 && DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3)273 && DBGF_BP_PUB_GET_TYPE(&pBp->Pub) == DBGFBPTYPE_INT3) 252 274 #ifdef IN_RING3 253 275 return dbgfBpHit(pVM, pVCpu, pRegFrame, hBp, pBp); … … 379 401 #endif 380 402 if ( pBp 381 && DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3)403 && DBGF_BP_PUB_GET_TYPE(&pBp->Pub) == DBGFBPTYPE_INT3) 382 404 { 383 405 if (pBp->Pub.u.Int3.GCPtr == (RTGCUINTPTR)GCPtrBp) -
trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp
r87597 r87776 568 568 * @param pvUser Opaque user data passed in the owner callback. 569 569 * @param enmType Breakpoint type to allocate. 570 * @param fFlags Flags assoicated with the allocated breakpoint. 570 571 * @param iHitTrigger The hit count at which the breakpoint start triggering. 571 572 * Use 0 (or 1) if it's gonna trigger at once. … … 578 579 */ 579 580 static int dbgfR3BpAlloc(PUVM pUVM, DBGFBPOWNER hOwner, void *pvUser, DBGFBPTYPE enmType, 580 uint 64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp,581 uint16_t fFlags, uint64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp, 581 582 PDBGFBPINT *ppBp) 582 583 { … … 637 638 pBp->Pub.iHitDisable = iHitDisable; 638 639 pBp->Pub.hOwner = hOwner; 639 pBp->Pub.fFlagsAndType = DBGF_BP_PUB_SET_FLAGS_AND_TYPE(enmType, DBGF_BP_F_DEFAULT); 640 pBp->Pub.u16Type = DBGF_BP_PUB_MAKE_TYPE(enmType); 641 pBp->Pub.fFlags = fFlags & ~DBGF_BP_F_ENABLED; /* The enabled flag is handled in the respective APIs. */ 640 642 pBp->pvUserR3 = pvUser; 641 643 … … 881 883 DECLINLINE(void) dbgfR3BpSetEnabled(PDBGFBPINT pBp, bool fEnabled) 882 884 { 883 DBGFBPTYPE enmType = DBGF_BP_PUB_GET_TYPE(pBp->Pub.fFlagsAndType);884 885 if (fEnabled) 885 pBp->Pub.fFlags AndType = DBGF_BP_PUB_SET_FLAGS_AND_TYPE(enmType, DBGF_BP_F_ENABLED);886 pBp->Pub.fFlags |= DBGF_BP_F_ENABLED; 886 887 else 887 pBp->Pub.fFlags AndType = DBGF_BP_PUB_SET_FLAGS_AND_TYPE(enmType, 0 /*fFlags*/);888 pBp->Pub.fFlags &= ~DBGF_BP_F_ENABLED; 888 889 } 889 890 … … 913 914 pHwBp->fType = pBp->Pub.u.Reg.fType; 914 915 pHwBp->cb = pBp->Pub.u.Reg.cb; 915 pHwBp->fEnabled = DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType);916 pHwBp->fEnabled = DBGF_BP_PUB_IS_ENABLED(&pBp->Pub); 916 917 917 918 pBp->Pub.u.Reg.iReg = i; … … 1321 1322 static int dbgfR3BpInt3Add(PUVM pUVM, DBGFBP hBp, PDBGFBPINT pBp) 1322 1323 { 1323 AssertReturn(DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3, VERR_DBGF_BP_IPE_3);1324 AssertReturn(DBGF_BP_PUB_GET_TYPE(&pBp->Pub) == DBGFBPTYPE_INT3, VERR_DBGF_BP_IPE_3); 1324 1325 1325 1326 int rc = VINF_SUCCESS; … … 1509 1510 static int dbgfR3BpInt3Remove(PUVM pUVM, DBGFBP hBp, PDBGFBPINT pBp) 1510 1511 { 1511 AssertReturn(DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType) == DBGFBPTYPE_INT3, VERR_DBGF_BP_IPE_3);1512 AssertReturn(DBGF_BP_PUB_GET_TYPE(&pBp->Pub) == DBGFBPTYPE_INT3, VERR_DBGF_BP_IPE_3); 1512 1513 1513 1514 /* … … 1563 1564 PVM pVM = pUVM->pVM; 1564 1565 1565 Assert(!DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType));1566 switch (DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType))1566 Assert(!DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)); 1567 switch (DBGF_BP_PUB_GET_TYPE(&pBp->Pub)) 1567 1568 { 1568 1569 case DBGFBPTYPE_REG: … … 1614 1615 break; 1615 1616 default: 1616 AssertMsgFailedReturn(("Invalid breakpoint type %d\n", DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType)),1617 AssertMsgFailedReturn(("Invalid breakpoint type %d\n", DBGF_BP_PUB_GET_TYPE(&pBp->Pub)), 1617 1618 VERR_IPE_NOT_REACHED_DEFAULT_CASE); 1618 1619 } … … 1637 1638 PVM pVM = pUVM->pVM; 1638 1639 1639 Assert(DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType));1640 switch (DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType))1640 Assert(DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)); 1641 switch (DBGF_BP_PUB_GET_TYPE(&pBp->Pub)) 1641 1642 { 1642 1643 case DBGFBPTYPE_REG: … … 1682 1683 break; 1683 1684 default: 1684 AssertMsgFailedReturn(("Invalid breakpoint type %d\n", DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType)),1685 AssertMsgFailedReturn(("Invalid breakpoint type %d\n", DBGF_BP_PUB_GET_TYPE(&pBp->Pub)), 1685 1686 VERR_IPE_NOT_REACHED_DEFAULT_CASE); 1686 1687 } … … 1805 1806 { 1806 1807 return DBGFR3BpSetInt3Ex(pUVM, NIL_DBGFBPOWNER, NULL /*pvUser*/, idSrcCpu, pAddress, 1807 iHitTrigger, iHitDisable, phBp);1808 DBGF_BP_F_DEFAULT, iHitTrigger, iHitDisable, phBp); 1808 1809 } 1809 1810 … … 1819 1820 * breakpoint address resolution. 1820 1821 * @param pAddress The address of the breakpoint. 1822 * @param fFlags Combination of DBGF_BP_F_XXX. 1821 1823 * @param iHitTrigger The hit count at which the breakpoint start triggering. 1822 1824 * Use 0 (or 1) if it's gonna trigger at once. … … 1828 1830 */ 1829 1831 VMMR3DECL(int) DBGFR3BpSetInt3Ex(PUVM pUVM, DBGFBPOWNER hOwner, void *pvUser, 1830 VMCPUID idSrcCpu, PCDBGFADDRESS pAddress, 1832 VMCPUID idSrcCpu, PCDBGFADDRESS pAddress, uint16_t fFlags, 1831 1833 uint64_t iHitTrigger, uint64_t iHitDisable, PDBGFBP phBp) 1832 1834 { … … 1859 1861 { 1860 1862 rc = VINF_SUCCESS; 1861 if (!DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType))1863 if (!DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)) 1862 1864 rc = dbgfR3BpArm(pUVM, hBp, pBp); 1863 1865 if (RT_SUCCESS(rc)) … … 1870 1872 } 1871 1873 1872 rc = dbgfR3BpAlloc(pUVM, hOwner, pvUser, DBGFBPTYPE_INT3, iHitTrigger, iHitDisable, &hBp, &pBp);1874 rc = dbgfR3BpAlloc(pUVM, hOwner, pvUser, DBGFBPTYPE_INT3, fFlags, iHitTrigger, iHitDisable, &hBp, &pBp); 1873 1875 if (RT_SUCCESS(rc)) 1874 1876 { … … 1880 1882 if (RT_SUCCESS(rc)) 1881 1883 { 1882 /* Enable the breakpoint. */ 1883 rc = dbgfR3BpArm(pUVM, hBp, pBp); 1884 /* Enable the breakpoint if requested. */ 1885 if (fFlags & DBGF_BP_F_ENABLED) 1886 rc = dbgfR3BpArm(pUVM, hBp, pBp); 1884 1887 if (RT_SUCCESS(rc)) 1885 1888 { … … 1920 1923 { 1921 1924 return DBGFR3BpSetRegEx(pUVM, NIL_DBGFBPOWNER, NULL /*pvUser*/, pAddress, 1922 iHitTrigger, iHitDisable, fType, cb, phBp);1925 DBGF_BP_F_DEFAULT, iHitTrigger, iHitDisable, fType, cb, phBp); 1923 1926 } 1924 1927 … … 1932 1935 * @param pvUser Opaque user data to pass in the owner callback. 1933 1936 * @param pAddress The address of the breakpoint. 1937 * @param fFlags Combination of DBGF_BP_F_XXX. 1934 1938 * @param iHitTrigger The hit count at which the breakpoint start triggering. 1935 1939 * Use 0 (or 1) if it's gonna trigger at once. … … 1944 1948 */ 1945 1949 VMMR3DECL(int) DBGFR3BpSetRegEx(PUVM pUVM, DBGFBPOWNER hOwner, void *pvUser, 1946 PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 1950 PCDBGFADDRESS pAddress, uint16_t fFlags, 1951 uint64_t iHitTrigger, uint64_t iHitDisable, 1947 1952 uint8_t fType, uint8_t cb, PDBGFBP phBp) 1948 1953 { … … 1977 1982 { 1978 1983 rc = VINF_SUCCESS; 1979 if (!DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType))1984 if (!DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)) 1980 1985 rc = dbgfR3BpArm(pUVM, hBp, pBp); 1981 1986 if (RT_SUCCESS(rc)) … … 1989 1994 1990 1995 /* Allocate new breakpoint. */ 1991 rc = dbgfR3BpAlloc(pUVM, hOwner, pvUser, DBGFBPTYPE_REG, iHitTrigger, iHitDisable, &hBp, &pBp); 1996 rc = dbgfR3BpAlloc(pUVM, hOwner, pvUser, DBGFBPTYPE_REG, fFlags, 1997 iHitTrigger, iHitDisable, &hBp, &pBp); 1992 1998 if (RT_SUCCESS(rc)) 1993 1999 { … … 2003 2009 { 2004 2010 /* Arm the breakpoint. */ 2005 rc = dbgfR3BpArm(pUVM, hBp, pBp); 2011 if (fFlags & DBGF_BP_F_ENABLED) 2012 rc = dbgfR3BpArm(pUVM, hBp, pBp); 2006 2013 if (RT_SUCCESS(rc)) 2007 2014 { … … 2010 2017 return VINF_SUCCESS; 2011 2018 } 2012 else 2013 { 2014 int rc2 = dbgfR3BpRegRemove(pUVM->pVM, hBp, pBp); 2015 AssertRC(rc2); RT_NOREF(rc2); 2016 } 2019 2020 int rc2 = dbgfR3BpRegRemove(pUVM->pVM, hBp, pBp); 2021 AssertRC(rc2); RT_NOREF(rc2); 2017 2022 } 2018 2023 … … 2183 2188 2184 2189 /* Disarm the breakpoint when it is enabled. */ 2185 if (DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType))2190 if (DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)) 2186 2191 { 2187 2192 int rc = dbgfR3BpDisarm(pUVM, hBp, pBp); … … 2189 2194 } 2190 2195 2191 switch (DBGF_BP_PUB_GET_TYPE( pBp->Pub.fFlagsAndType))2196 switch (DBGF_BP_PUB_GET_TYPE(&pBp->Pub)) 2192 2197 { 2193 2198 case DBGFBPTYPE_REG: … … 2227 2232 2228 2233 int rc; 2229 if (!DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType))2234 if (!DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)) 2230 2235 rc = dbgfR3BpArm(pUVM, hBp, pBp); 2231 2236 else … … 2257 2262 2258 2263 int rc; 2259 if (DBGF_BP_PUB_IS_ENABLED( pBp->Pub.fFlagsAndType))2264 if (DBGF_BP_PUB_IS_ENABLED(&pBp->Pub)) 2260 2265 rc = dbgfR3BpDisarm(pUVM, hBp, pBp); 2261 2266 else … … 2304 2309 BpPub.iHitDisable = ASMAtomicReadU64((volatile uint64_t *)&pBp->Pub.iHitDisable); 2305 2310 BpPub.hOwner = ASMAtomicReadU32((volatile uint32_t *)&pBp->Pub.hOwner); 2306 BpPub.fFlagsAndType = ASMAtomicReadU32((volatile uint32_t *)&pBp->Pub.fFlagsAndType); 2311 BpPub.u16Type = ASMAtomicReadU16((volatile uint16_t *)&pBp->Pub.u16Type); /* Actually constant. */ 2312 BpPub.fFlags = ASMAtomicReadU16((volatile uint16_t *)&pBp->Pub.fFlags); 2307 2313 memcpy(&BpPub.u, &pBp->Pub.u, sizeof(pBp->Pub.u)); /* Is constant after allocation. */ 2308 2314 … … 2347 2353 if (pBpOwner) 2348 2354 { 2349 VBOXSTRICTRC rcStrict = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub); 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); 2350 2359 if (rcStrict == VINF_SUCCESS) 2351 2360 { … … 2359 2368 abInstr[0] = pBp->Pub.u.Int3.bOrg; 2360 2369 rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr, &abInstr[0], sizeof(abInstr)); 2361 return VBOXSTRICTRC_VAL(rcStrict); 2370 if ( rcStrict == VINF_SUCCESS 2371 && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub)) 2372 { 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 return VBOXSTRICTRC_VAL(rcStrict); 2376 else if (rcStrict2 != VINF_DBGF_BP_HALT) 2377 return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS; 2378 } 2379 else 2380 return VBOXSTRICTRC_VAL(rcStrict); 2362 2381 } 2363 2382 } -
trunk/src/VBox/VMM/VMMR3/DBGFR3FlowTrace.cpp
r87577 r87776 765 765 * @callback_method_impl{FNDBGFBPHIT} 766 766 */ 767 static DECLCALLBACK(VBOXSTRICTRC) dbgfR3FlowTraceModProbeFiredWorker(PVM pVM, VMCPUID idCpu, void *pvUserBp, DBGFBP hBp, PCDBGFBPPUB pBpPub )768 { 769 RT_NOREF(pVM, hBp, pBpPub );767 static DECLCALLBACK(VBOXSTRICTRC) dbgfR3FlowTraceModProbeFiredWorker(PVM pVM, VMCPUID idCpu, void *pvUserBp, DBGFBP hBp, PCDBGFBPPUB pBpPub, uint16_t fFlags) 768 { 769 RT_NOREF(pVM, hBp, pBpPub, fFlags); 770 770 LogFlowFunc(("pVM=%#p idCpu=%u pvUserBp=%#p hBp=%#x pBpPub=%p\n", 771 771 pVM, idCpu, pvUserBp, hBp, pBpPub)); … … 857 857 { 858 858 rc = DBGFR3BpSetInt3Ex(pThis->pUVM, pThis->hBpOwner, pProbeLoc, 859 0 /*idSrcCpu*/, &pProbeLoc->AddrProbe, 859 0 /*idSrcCpu*/, &pProbeLoc->AddrProbe, DBGF_BP_F_DEFAULT, 860 860 0 /*iHitTrigger*/, ~0ULL /*iHitDisable*/, &pProbeLoc->hBp); 861 861 if (RT_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.

