VirtualBox

Changeset 41674 in vbox for trunk/src/VBox/Disassembler


Ignore:
Timestamp:
Jun 12, 2012 8:16:31 PM (12 years ago)
Author:
vboxsync
Message:

DISCoreOne* -> DISCore*.

Location:
trunk/src/VBox/Disassembler
Files:
3 edited

Legend:

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

    r41671 r41674  
    9696                             PDISCPUSTATE pCpu, uint32_t *pcbInstr, char *pszOutput, size_t cbOutput)
    9797{
    98     int rc = DISCoreOneExEx(uInstrAddr, enmCpuMode, uFilter, pfnReadBytes, pvUser, pCpu, pcbInstr);
     98    int rc = DISInstEx(uInstrAddr, enmCpuMode, uFilter, pfnReadBytes, pvUser, pCpu, pcbInstr);
    9999    if (RT_SUCCESS(rc) && pszOutput && cbOutput)
    100100    {
  • trunk/src/VBox/Disassembler/DisasmCore.cpp

    r41668 r41674  
    212212 *
    213213 * @returns VBox status code.
    214  * @param   uInstrAddr      Address of the instruction to decode.  This is a
     214 * @param   pvInstr         Address of the instruction to decode.  This is a
    215215 *                          real address in the current context that can be
    216  *                          derefferenced.  (Consider DISCoreOneWithReader if
    217  *                          this isn't the case.)
     216 *                          accessed without faulting.  (Consider
     217 *                          DISInstrWithReader if this isn't the case.)
    218218 * @param   enmCpuMode      The CPU mode. CPUMODE_32BIT, CPUMODE_16BIT, or CPUMODE_64BIT.
    219219 * @param   pfnReadBytes    Callback for reading instruction bytes.
     
    224224 *                          PDISCPUSTATE::opsize.
    225225 */
    226 DISDECL(int) DISCoreOne(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, PDISCPUSTATE pCpu, uint32_t *pcbInstr)
    227 {
    228     return DISCoreOneExEx(uInstrAddr, enmCpuMode, OPTYPE_ALL, NULL /*pfnReadBytes*/, NULL /*pvUser*/, pCpu, pcbInstr);
     226DISDECL(int) DISInstr(const void *pvInstr, DISCPUMODE enmCpuMode, PDISCPUSTATE pCpu, uint32_t *pcbInstr)
     227{
     228    return DISInstEx((uintptr_t)pvInstr, enmCpuMode, OPTYPE_ALL, NULL /*pfnReadBytes*/, NULL /*pvUser*/, pCpu, pcbInstr);
    229229}
    230230
     
    246246 *                          PDISCPUSTATE::opsize.
    247247 */
    248 DISDECL(int) DISCoreOneWithReader(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, PFNDISREADBYTES pfnReadBytes, void *pvUser,
    249                                   PDISCPUSTATE pCpu, uint32_t *pcbInstr)
    250 {
    251     return DISCoreOneExEx(uInstrAddr, enmCpuMode, OPTYPE_ALL, pfnReadBytes, pvUser, pCpu, pcbInstr);
     248DISDECL(int) DISInstrWithReader(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, PFNDISREADBYTES pfnReadBytes, void *pvUser,
     249                                PDISCPUSTATE pCpu, uint32_t *pcbInstr)
     250{
     251    return DISInstEx(uInstrAddr, enmCpuMode, OPTYPE_ALL, pfnReadBytes, pvUser, pCpu, pcbInstr);
    252252}
    253253
    254254
    255255/**
    256  * Parses one guest instruction.
    257  *
    258  * The result is found in pCpu and pcbInstr.
     256 * Disassembles on instruction, details in @a pCpu and length in @a pcbInstr.
    259257 *
    260258 * @returns VBox status code.
     
    263261 * @param   enmCpuMode      The CPU mode. CPUMODE_32BIT, CPUMODE_16BIT, or CPUMODE_64BIT.
    264262 * @param   pfnReadBytes    Callback for reading instruction bytes.
    265  * @param   uFilter         Instruction type filter.
     263 * @param   fFilter         Instruction type filter.
    266264 * @param   pvUser          User argument for the instruction reader. (Ends up in apvUserData[0].)
    267  * @param   pCpu            Pointer to cpu structure. Will be initialized.
    268  * @param   pcbInstr        Where to store the size of the instruction.
    269  *                          NULL is allowed.  This is also stored in
    270  *                          PDISCPUSTATE::opsize.
     265 * @param   pCpu            Pointer to CPU structure. With the exception of
     266 *                          DISCPUSTATE::apvUserData[1] and
     267 *                          DISCPUSTATE::apvUserData[2], the structure will be
     268 *                          completely initialized by this API, i.e. no input is
     269 *                          taken from it.
     270 * @param   pcbInstr        Where to store the size of the instruction.  (This
     271 *                          is also stored in PDISCPUSTATE::opsize.)  Optional.
    271272 */
    272 DISDECL(int) DISCoreOneExEx(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, uint32_t uFilter,
    273                             PFNDISREADBYTES pfnReadBytes, void *pvUser,
    274                             PDISCPUSTATE pCpu, uint32_t *pcbInstr)
     273DISDECL(int) DISInstEx(RTUINTPTR uInstrAddr, DISCPUMODE enmCpuMode, uint32_t fFilter,
     274                       PFNDISREADBYTES pfnReadBytes, void *pvUser,
     275                       PDISCPUSTATE pCpu, uint32_t *pcbInstr)
    275276{
    276277    const OPCODE *paOneByteMap;
     
    299300    pCpu->uInstrAddr        = uInstrAddr;
    300301    pCpu->pfnDisasmFnTable  = g_apfnFullDisasm;
    301     pCpu->uFilter           = uFilter;
     302    pCpu->fFilter           = fFilter;
    302303    pCpu->rc                = VINF_SUCCESS;
    303304    pCpu->pfnReadBytes      = pfnReadBytes ? pfnReadBytes : disReadBytesDefault;
     
    451452    /*
    452453     * Apply filter to instruction type to determine if a full disassembly is required.
    453      * @note Multibyte opcodes are always marked harmless until the final byte.
     454     * Note! Multibyte opcodes are always marked harmless until the final byte.
    454455     */
    455     if ((pOp->optype & pCpu->uFilter) == 0)
     456    if ((pOp->optype & pCpu->fFilter) == 0)
    456457    {
    457458        fFiltered = true;
     
    541542     * @note Multibyte opcodes are always marked harmless until the final byte.
    542543     */
    543     if ((fpop->optype & pCpu->uFilter) == 0)
     544    if ((fpop->optype & pCpu->fFilter) == 0)
    544545        pCpu->pfnDisasmFnTable = g_apfnCalcSize;
    545546    else
  • trunk/src/VBox/Disassembler/DisasmTestCore.cpp

    r41668 r41674  
    3939        unsigned    cb;
    4040        DISCPUSTATE cpu;
    41         if (DISCoreOne((uintptr_t)&DISCoreOne, CPUMODE_32BIT, &cpu, &cb))
     41        if (DISInstr((void *)(uintptr_t)&DISInstr, CPUMODE_32BIT, &cpu, &cb))
    4242            printf("ok %d\n", cpu.addrmode);
    4343        else
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