VirtualBox

Changeset 11461 in vbox for trunk


Ignore:
Timestamp:
Aug 18, 2008 12:26:35 PM (16 years ago)
Author:
vboxsync
Message:

Backed out 34906. Not necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r11460 r11461  
    404404    return VINF_SUCCESS;
    405405}
    406 /**************************************************************************************/
    407 /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    408 /**************************************************************************************/
    409 static void CheckForceFlags(PDISCPUSTATE pCpu, PCOPCODE pOp)
    410 {
     406//*****************************************************************************
     407//*****************************************************************************
     408unsigned ParseInstruction(RTUINTPTR lpszCodeBlock, PCOPCODE pOp, PDISCPUSTATE pCpu)
     409{
     410    int  size = 0;
     411    bool fFiltered = false;
     412
     413    // Store the opcode format string for disasmPrintf
     414#ifndef DIS_CORE_ONLY
     415    pCpu->pszOpcode = pOp->pszOpcode;
     416#endif
     417    pCpu->pCurInstr = pOp;
     418
     419    /*
     420     * Apply filter to instruction type to determine if a full disassembly is required.
     421     * @note Multibyte opcodes are always marked harmless until the final byte.
     422     */
     423    if ((pOp->optype & pCpu->uFilter) == 0)
     424    {
     425        fFiltered = true;
     426        pCpu->pfnDisasmFnTable = pfnCalcSize;
     427    }
     428    else
     429    {
     430        /* Not filtered out -> full disassembly */
     431        pCpu->pfnDisasmFnTable = pfnFullDisasm;
     432    }
     433
     434    // Should contain the parameter type on input
     435    pCpu->param1.param = pOp->param1;
     436    pCpu->param2.param = pOp->param2;
     437    pCpu->param3.param = pOp->param3;
     438
    411439    /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    412440    if (pCpu->mode == CPUMODE_64BIT)
     
    419447            pCpu->opsize = CPUMODE_64BIT;
    420448    }
    421 }
    422 //*****************************************************************************
    423 //*****************************************************************************
    424 unsigned ParseInstruction(RTUINTPTR lpszCodeBlock, PCOPCODE pOp, PDISCPUSTATE pCpu)
    425 {
    426     int  size = 0;
    427     bool fFiltered = false;
    428 
    429     // Store the opcode format string for disasmPrintf
    430 #ifndef DIS_CORE_ONLY
    431     pCpu->pszOpcode = pOp->pszOpcode;
    432 #endif
    433     pCpu->pCurInstr = pOp;
    434 
    435     /*
    436      * Apply filter to instruction type to determine if a full disassembly is required.
    437      * @note Multibyte opcodes are always marked harmless until the final byte.
    438      */
    439     if ((pOp->optype & pCpu->uFilter) == 0)
    440     {
    441         fFiltered = true;
    442         pCpu->pfnDisasmFnTable = pfnCalcSize;
    443     }
    444     else
    445     {
    446         /* Not filtered out -> full disassembly */
    447         pCpu->pfnDisasmFnTable = pfnFullDisasm;
    448     }
    449 
    450     // Should contain the parameter type on input
    451     pCpu->param1.param = pOp->param1;
    452     pCpu->param2.param = pOp->param2;
    453     pCpu->param3.param = pOp->param3;
    454 
    455     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    456     CheckForceFlags(pCpu, pOp);
    457449
    458450    if (pOp->idxParse1 != IDX_ParseNop)
     
    18001792        pOp = &g_aMapX86_NopPause[0]; /* NOP */
    18011793
    1802     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1803     CheckForceFlags(pCpu, pOp);
    1804 
    18051794    size += ParseInstruction(pu8CodeBlock, pOp, pCpu);
    18061795    return size;
     
    18201809    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
    18211810        size = sizeof(uint8_t); //ModRM byte
    1822 
    1823     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1824     CheckForceFlags(pCpu, pOp);
    18251811
    18261812    size += ParseInstruction(lpszCodeBlock, pOp, pCpu);
     
    18591845    pOp = (PCOPCODE)&g_aMapX86_Group2[idx+reg];
    18601846
    1861     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1862     CheckForceFlags(pCpu, pOp);
    1863 
    18641847    //little hack to make sure the ModRM byte is included in the returned size
    18651848    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    18821865    pOp = (PCOPCODE)&g_aMapX86_Group3[idx+reg];
    18831866
    1884     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1885     CheckForceFlags(pCpu, pOp);
    1886 
    18871867    //little hack to make sure the ModRM byte is included in the returned size
    18881868    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    19041884    pOp = (PCOPCODE)&g_aMapX86_Group4[reg];
    19051885
    1906     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1907     CheckForceFlags(pCpu, pOp);
    1908 
    19091886    //little hack to make sure the ModRM byte is included in the returned size
    19101887    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    19251902
    19261903    pOp = (PCOPCODE)&g_aMapX86_Group5[reg];
    1927 
    1928     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1929     CheckForceFlags(pCpu, pOp);
    19301904
    19311905    //little hack to make sure the ModRM byte is included in the returned size
     
    19631937    pOp = (PCOPCODE)&g_aTwoByteMapX86_3DNow[opcode];
    19641938
    1965     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1966     CheckForceFlags(pCpu, pOp);
    1967 
    19681939    //little hack to make sure the ModRM byte is included in the returned size
    19691940    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    19911962    pOp = (PCOPCODE)&g_aMapX86_Group6[reg];
    19921963
    1993     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    1994     CheckForceFlags(pCpu, pOp);
    1995 
    19961964    //little hack to make sure the ModRM byte is included in the returned size
    19971965    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    20211989        pOp = (PCOPCODE)&g_aMapX86_Group7_mem[reg];
    20221990
    2023     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2024     CheckForceFlags(pCpu, pOp);
    2025 
    20261991    //little hack to make sure the ModRM byte is included in the returned size
    20271992    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    20432008    pOp = (PCOPCODE)&g_aMapX86_Group8[reg];
    20442009
    2045     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2046     CheckForceFlags(pCpu, pOp);
    2047 
    20482010    //little hack to make sure the ModRM byte is included in the returned size
    20492011    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    20652027    pOp = (PCOPCODE)&g_aMapX86_Group9[reg];
    20662028
    2067     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2068     CheckForceFlags(pCpu, pOp);
    2069 
    20702029    //little hack to make sure the ModRM byte is included in the returned size
    20712030    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    20872046    pOp = (PCOPCODE)&g_aMapX86_Group10[reg];
    20882047
    2089     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2090     CheckForceFlags(pCpu, pOp);
    2091 
    20922048    //little hack to make sure the ModRM byte is included in the returned size
    20932049    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    21112067
    21122068    pOp = (PCOPCODE)&g_aMapX86_Group12[reg];
    2113 
    2114     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2115     CheckForceFlags(pCpu, pOp);
    21162069
    21172070    //little hack to make sure the ModRM byte is included in the returned size
     
    21352088    pOp = (PCOPCODE)&g_aMapX86_Group13[reg];
    21362089
    2137     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2138     CheckForceFlags(pCpu, pOp);
    2139 
    21402090    //little hack to make sure the ModRM byte is included in the returned size
    21412091    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    21592109    pOp = (PCOPCODE)&g_aMapX86_Group14[reg];
    21602110
    2161     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2162     CheckForceFlags(pCpu, pOp);
    2163 
    21642111    //little hack to make sure the ModRM byte is included in the returned size
    21652112    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    21862133        pOp = (PCOPCODE)&g_aMapX86_Group15_mem[reg];
    21872134
    2188     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2189     CheckForceFlags(pCpu, pOp);
    2190 
    21912135    //little hack to make sure the ModRM byte is included in the returned size
    21922136    if (pOp->idxParse1 != IDX_ParseModRM && pOp->idxParse2 != IDX_ParseModRM)
     
    22062150
    22072151    pOp = (PCOPCODE)&g_aMapX86_Group16[reg];
    2208 
    2209     /* Correct the operand size if the instruction is marked as forced or default 64 bits */
    2210     CheckForceFlags(pCpu, pOp);
    22112152
    22122153    //little hack to make sure the ModRM byte is included in the returned size
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