VirtualBox

Changeset 25777 in vbox


Ignore:
Timestamp:
Jan 12, 2010 4:53:18 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56535
Message:

PATM.cpp: Shut up -Wshadow warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PATM/PATM.cpp

    r25647 r25777  
    186186     * Debugger commands.
    187187     */
    188     static bool fRegisteredCmds = false;
    189     if (!fRegisteredCmds)
    190     {
    191         int rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
    192         if (RT_SUCCESS(rc))
    193             fRegisteredCmds = true;
     188    static bool s_fRegisteredCmds = false;
     189    if (!s_fRegisteredCmds)
     190    {
     191        int rc2 = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds));
     192        if (RT_SUCCESS(rc2))
     193            s_fRegisteredCmds = true;
    194194    }
    195195#endif
     
    17031703        RTRCPTR pNextInstrGC = 0;   /* by default no inhibit irq */
    17041704
    1705         /** In a sequence of instructions that inhibit irqs, only the first one actually inhibits irqs. */
     1705        /* In a sequence of instructions that inhibit irqs, only the first one actually inhibits irqs. */
    17061706        if (!(pPatch->flags & PATMFL_INHIBIT_IRQS))
    17071707        {
     
    17181718            unsigned    opsize;
    17191719            int         disret;
    1720             RCPTRTYPE(uint8_t *) pNextInstrGC, pReturnInstrGC;
     1720            RCPTRTYPE(uint8_t *) pReturnInstrGC;
    17211721            R3PTRTYPE(uint8_t *) pNextInstrHC;
    17221722
     
    25742574    if (rc == VINF_SUCCESS)
    25752575    {
    2576         DISCPUSTATE cpu;
    2577         char szOutput[256];
    2578         uint32_t opsize, i = 0;
    2579         bool disret;
    2580 
     2576        i = 0;
    25812577        while(i < pPatch->cbPrivInstr)
    25822578        {
     
    32673263            if (pPatchPage->aPatch[i])
    32683264            {
    3269                 PPATCHINFO pPatch = pPatchPage->aPatch[i];
    3270 
    3271                 if (    (pPatch->flags & PATMFL_DUPLICATE_FUNCTION)
    3272                     &&  pPatch->uState == PATCH_ENABLED)
     3265                PPATCHINFO pPatch2 = pPatchPage->aPatch[i];
     3266
     3267                if (    (pPatch2->flags & PATMFL_DUPLICATE_FUNCTION)
     3268                    &&  pPatch2->uState == PATCH_ENABLED)
    32733269                {
    3274                     pPatchTargetGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch, pInstrGC);
     3270                    pPatchTargetGC = patmGuestGCPtrToPatchGCPtr(pVM, pPatch2, pInstrGC);
    32753271                    if (pPatchTargetGC)
    32763272                    {
    32773273                        uint32_t         offsetPatch      = pPatchTargetGC - pVM->patm.s.pPatchMemGC;
    3278                         PRECPATCHTOGUEST pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32GetBestFit(&pPatch->Patch2GuestAddrTree, offsetPatch, false);
     3274                        PRECPATCHTOGUEST pPatchToGuestRec = (PRECPATCHTOGUEST)RTAvlU32GetBestFit(&pPatch2->Patch2GuestAddrTree, offsetPatch, false);
    32793275                        Assert(pPatchToGuestRec);
    32803276
    32813277                        pPatchToGuestRec->fJumpTarget = true;
    3282                         Assert(pPatchTargetGC != pPatch->pPrivInstrGC);
    3283                         Log(("patmCreateTrampoline: generating jump to code inside patch at %RRv\n", pPatch->pPrivInstrGC));
    3284                         pPatch->flags |= PATMFL_EXTERNAL_JUMP_INSIDE;
     3278                        Assert(pPatchTargetGC != pPatch2->pPrivInstrGC);
     3279                        Log(("patmCreateTrampoline: generating jump to code inside patch at %RRv\n", pPatch2->pPrivInstrGC));
     3280                        pPatch2->flags |= PATMFL_EXTERNAL_JUMP_INSIDE;
    32853281                        break;
    32863282                    }
     
    52355231
    52365232                    // let's first check if the guest code is still the same
    5237                     int rc = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
    5238                     AssertRC(rc);
     5233                    int rc2 = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
     5234                    AssertRC(rc2);
    52395235
    52405236                    if (memcmp(temp, pPatch->aPrivInstr, pPatch->cbPatchJump))
     
    52485244                    }
    52495245
    5250                     rc = patmGenJumpToPatch(pVM, pPatch, false);
    5251                     AssertRC(rc);
    5252                     if (RT_FAILURE(rc))
    5253                         return rc;
     5246                    rc2 = patmGenJumpToPatch(pVM, pPatch, false);
     5247                    AssertRC(rc2);
     5248                    if (RT_FAILURE(rc2))
     5249                        return rc2;
    52545250
    52555251#ifdef DEBUG
     
    52745270
    52755271                /* Let's first check if the guest code is still the same. */
    5276                 int rc = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
    5277                 AssertRC(rc);
     5272                int rc2 = PGMPhysSimpleReadGCPtr(VMMGetCpu0(pVM), temp, pPatch->pPrivInstrGC, pPatch->cbPatchJump);
     5273                AssertRC(rc2);
    52785274
    52795275                if (memcmp(temp, pPatch->aPrivInstr, pPatch->cbPatchJump))
     
    52865282                }
    52875283
    5288                 rc = patmActivateInt3Patch(pVM, pPatch);
    5289                 if (RT_FAILURE(rc))
    5290                     return rc;
     5284                rc2 = patmActivateInt3Patch(pVM, pPatch);
     5285                if (RT_FAILURE(rc2))
     5286                    return rc2;
    52915287            }
    52925288
     
    56315627    if (pPatch->flags & PATMFL_CODE_MONITORED)
    56325628    {
    5633         int rc = patmRemovePatchPages(pVM, pPatch);
     5629        rc = patmRemovePatchPages(pVM, pPatch);
    56345630        AssertRCReturn(rc, rc);
    56355631    }
     
    61976193        {
    61986194            RTRCPTR retaddr;
    6199             PCPUMCTX pCtx;
    6200 
    6201             pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    6202 
    6203             rc = PGMPhysSimpleReadGCPtr(pVCpu,  &retaddr, pCtx->esp, sizeof(retaddr));
     6195            PCPUMCTX pCtx2;
     6196
     6197            pCtx2 = CPUMQueryGuestCtxPtr(pVCpu);
     6198
     6199            rc = PGMPhysSimpleReadGCPtr(pVCpu,  &retaddr, pCtx2->esp, sizeof(retaddr));
    62046200            AssertRC(rc);
    62056201
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