VirtualBox

Changeset 92729 in vbox


Ignore:
Timestamp:
Dec 3, 2021 9:19:21 AM (3 years ago)
Author:
vboxsync
Message:

VMM/DBGF: nits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Bp.cpp

    r92727 r92729  
    11361136
    11371137            /* The L1 entry has changed due to another thread racing us during insertion, free nodes and try again. */
     1138            dbgfR3BpL2TblEntryFree(pUVM, idxL2Leaf, pL2Leaf);
    11381139            rc = VINF_TRY_AGAIN;
    1139             dbgfR3BpL2TblEntryFree(pUVM, idxL2Leaf, pL2Leaf);
    11401140        }
    11411141
     
    11721172            /* Make a copy of the entry. */
    11731173            DBGFBPL2ENTRY L2Entry;
    1174             L2Entry.u64GCPtrKeyAndBpHnd1       = ASMAtomicReadU64((volatile uint64_t *)&pL2Entry->u64GCPtrKeyAndBpHnd1);
    1175             L2Entry.u64LeftRightIdxDepthBpHnd2 = ASMAtomicReadU64((volatile uint64_t *)&pL2Entry->u64LeftRightIdxDepthBpHnd2);
     1174            L2Entry.u64GCPtrKeyAndBpHnd1       = ASMAtomicReadU64(&pL2Entry->u64GCPtrKeyAndBpHnd1);
     1175            L2Entry.u64LeftRightIdxDepthBpHnd2 = ASMAtomicReadU64(&pL2Entry->u64LeftRightIdxDepthBpHnd2);
    11761176
    11771177            RTGCUINTPTR GCPtrL2Entry = DBGF_BP_L2_ENTRY_GET_GCPTR(L2Entry.u64GCPtrKeyAndBpHnd1);
     
    11791179
    11801180            /* Not found, get to the next level. */
    1181             uint32_t idxL2Next =   (GCPtr < GCPtrL2Entry)
    1182                                  ? DBGF_BP_L2_ENTRY_GET_IDX_LEFT(L2Entry.u64LeftRightIdxDepthBpHnd2)
    1183                                  : DBGF_BP_L2_ENTRY_GET_IDX_RIGHT(L2Entry.u64LeftRightIdxDepthBpHnd2);
     1181            uint32_t idxL2Next = GCPtr < GCPtrL2Entry
     1182                               ? DBGF_BP_L2_ENTRY_GET_IDX_LEFT(L2Entry.u64LeftRightIdxDepthBpHnd2)
     1183                               : DBGF_BP_L2_ENTRY_GET_IDX_RIGHT(L2Entry.u64LeftRightIdxDepthBpHnd2);
    11841184            if (idxL2Next == DBGF_BP_L2_ENTRY_IDX_END)
    11851185            {
     
    11961196        }
    11971197
     1198        dbgfR3BpL2TblEntryFree(pUVM, idxL2Nd, pL2Nd);
    11981199        rc = VERR_DBGF_BP_L2_LOOKUP_FAILED;
    1199         dbgfR3BpL2TblEntryFree(pUVM, idxL2Nd, pL2Nd);
    12001200    }
    12011201
     
    14011401            Assert(DBGF_BP_L2_ENTRY_GET_BP_HND(pL2Entry->u64GCPtrKeyAndBpHnd1, pL2Entry->u64LeftRightIdxDepthBpHnd2) == hBp); RT_NOREF(hBp);
    14021402
    1403             rc = dbgfR3BpInt3BstNodeRemove(pUVM, idxL1, idxL2Root, idxL2Cur, pL2Entry,
    1404                                            idxL2Parent, pL2EntryParent, fLeftChild);
     1403            rc = dbgfR3BpInt3BstNodeRemove(pUVM, idxL1, idxL2Root, idxL2Cur, pL2Entry, idxL2Parent, pL2EntryParent, fLeftChild);
    14051404            break;
    14061405        }
     
    15411540                }
    15421541            }
    1543 
    15441542            break;
    15451543        }
     
    15721570
    15731571                        /* Not found, get to the next level. */
    1574                         uint32_t idxL2Next =   (GCPtrKey < GCPtrL2Entry)
    1575                                              ? DBGF_BP_L2_ENTRY_GET_IDX_LEFT(pL2Nd->u64LeftRightIdxDepthBpHnd2)
    1576                                              : DBGF_BP_L2_ENTRY_GET_IDX_RIGHT(pL2Nd->u64LeftRightIdxDepthBpHnd2);
     1572                        uint32_t idxL2Next = GCPtrKey < GCPtrL2Entry
     1573                                           ? DBGF_BP_L2_ENTRY_GET_IDX_LEFT(pL2Nd->u64LeftRightIdxDepthBpHnd2)
     1574                                           : DBGF_BP_L2_ENTRY_GET_IDX_RIGHT(pL2Nd->u64LeftRightIdxDepthBpHnd2);
    15771575                        /* Address not found if the entry denotes the end. */
    15781576                        if (idxL2Next == DBGF_BP_L2_ENTRY_IDX_END)
     
    15931591    if (   hBp != NIL_DBGFBP
    15941592        && ppBp)
    1595         *ppBp =  dbgfR3BpGetByHnd(pUVM, hBp);
     1593        *ppBp = dbgfR3BpGetByHnd(pUVM, hBp);
    15961594    return hBp;
    15971595}
     
    18011799static int dbgfR3BpArm(PUVM pUVM, DBGFBP hBp, PDBGFBPINT pBp)
    18021800{
    1803     int rc = VINF_SUCCESS;
     1801    int rc;
    18041802    PVM pVM = pUVM->pVM;
    18051803
     
    18551853            ASMAtomicIncU32(&pUVM->dbgf.s.cPortIoBps);
    18561854            IOMR3NotifyBreakpointCountChange(pVM, true /*fPortIo*/, false /*fMmio*/);
     1855            rc = VINF_SUCCESS;
    18571856            break;
    18581857        }
     
    18811880static int dbgfR3BpDisarm(PUVM pUVM, DBGFBP hBp, PDBGFBPINT pBp)
    18821881{
    1883     int rc = VINF_SUCCESS;
     1882    int rc;
    18841883    PVM pVM = pUVM->pVM;
    18851884
     
    19301929            if (!cPortIoBps) /** @todo Need to gather all EMTs to not have a stray EMT accessing BP data when it might go away. */
    19311930                IOMR3NotifyBreakpointCountChange(pVM, false /*fPortIo*/, false /*fMmio*/);
     1931            rc = VINF_SUCCESS;
    19321932            break;
    19331933        }
     
    19771977                    /* Replace the int3 with the original instruction byte. */
    19781978                    abInstr[0] = pBp->Pub.u.Int3.bOrg;
    1979                     rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr, &abInstr[0], sizeof(abInstr));
     1979                    rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(&pVCpu->cpum.GstCtx), GCPtrInstr,
     1980                                                            &abInstr[0], sizeof(abInstr));
    19801981                    if (   rcStrict == VINF_SUCCESS
    19811982                        && DBGF_BP_PUB_IS_EXEC_AFTER(&pBp->Pub))
    19821983                    {
    1983                         VBOXSTRICTRC rcStrict2 = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub, DBGF_BP_F_HIT_EXEC_AFTER);
     1984                        VBOXSTRICTRC rcStrict2 = pBpOwner->pfnBpHitR3(pVM, pVCpu->idCpu, pBp->pvUserR3, hBp, &pBp->Pub,
     1985                                                                      DBGF_BP_F_HIT_EXEC_AFTER);
    19841986                        if (rcStrict2 == VINF_SUCCESS)
    19851987                            return VBOXSTRICTRC_VAL(rcStrict);
    1986                         else if (rcStrict2 != VINF_DBGF_BP_HALT)
     1988                        if (rcStrict2 != VINF_DBGF_BP_HALT)
    19871989                            return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS;
    19881990                    }
     
    27522754                    return VINF_SUCCESS;
    27532755                }
    2754                 else if (VBOXSTRICTRC_VAL(rcStrict) != VINF_DBGF_BP_HALT) /* Guru meditation. */
     2756                if (VBOXSTRICTRC_VAL(rcStrict) != VINF_DBGF_BP_HALT) /* Guru meditation. */
    27552757                    return VERR_DBGF_BP_OWNER_CALLBACK_WRONG_STATUS;
    27562758                /* else: Halt in the debugger. */
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