VirtualBox

Ignore:
Timestamp:
Oct 22, 2023 2:43:09 AM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159616
Message:

DIS,VMM,DBGC,IPRT,++: Some disassembler tweaks and TB disassembly work. bugref:10371 bugref:9898

Location:
trunk/src/VBox/Disassembler/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Disassembler/testcase/tstDisasm-1.cpp

    r99775 r101539  
    8989        DISSTATE        DisOnly;
    9090        rc = DISInstrWithPrefetchedBytes((uintptr_t)&pabInstrs[off], enmDisCpuMode,  0 /*fFilter - none */,
    91                                          Dis.u.abInstr, Dis.cbCachedInstr, NULL, NULL, &DisOnly, &cbOnly);
     91                                         Dis.Instr.ab, Dis.cbCachedInstr, NULL, NULL, &DisOnly, &cbOnly);
    9292
    9393        RTTESTI_CHECK_RC(rc, VINF_SUCCESS);
     
    109109{
    110110    RT_NOREF1(cbMinRead);
    111     memcpy(&pDis->u.abInstr[offInstr], (void *)((uintptr_t)pDis->uInstrAddr + offInstr), cbMaxRead);
     111    memcpy(&pDis->Instr.ab[offInstr], (void *)((uintptr_t)pDis->uInstrAddr + offInstr), cbMaxRead);
    112112    pDis->cbCachedInstr = offInstr + cbMaxRead;
    113113    return VINF_SUCCESS;
  • trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp

    r99220 r101539  
    149149        case OP_MOV_DR:
    150150        case OP_MOV_TR:
    151             if (pDis->arch.x86.ModRM.Bits.Mod != 3)
     151            if (pDis->x86.ModRM.Bits.Mod != 3)
    152152                return false;
    153153            break;
     
    155155         /* The 0x8f /0 variant of this instruction doesn't get its /r value verified. */
    156156        case OP_POP:
    157             if (    pDis->arch.x86.bOpCode == 0x8f
    158                 &&  pDis->arch.x86.ModRM.Bits.Reg != 0)
     157            if (    pDis->x86.bOpCode == 0x8f
     158                &&  pDis->x86.ModRM.Bits.Reg != 0)
    159159                return false;
    160160            break;
     
    162162        /* The 0xc6 /0 and 0xc7 /0 variants of this instruction don't get their /r values verified. */
    163163        case OP_MOV:
    164             if (    (   pDis->arch.x86.bOpCode == 0xc6
    165                      || pDis->arch.x86.bOpCode == 0xc7)
    166                 &&  pDis->arch.x86.ModRM.Bits.Reg != 0)
     164            if (    (   pDis->x86.bOpCode == 0xc6
     165                     || pDis->x86.bOpCode == 0xc7)
     166                &&  pDis->x86.ModRM.Bits.Reg != 0)
    167167                return false;
    168168            break;
     
    192192        //size_t cbToRead    = cbMaxRead;
    193193        size_t cbToRead    = cbMinRead;
    194         memcpy(&pState->Dis.u.abInstr[offInstr], pState->pbNext, cbToRead);
     194        memcpy(&pState->Dis.Instr.ab[offInstr], pState->pbNext, cbToRead);
    195195        pState->Dis.cbCachedInstr = offInstr + (uint8_t)cbToRead;
    196196        pState->pbNext    += cbToRead;
     
    207207        if (pState->cbLeft > 0)
    208208        {
    209             memcpy(&pState->Dis.u.abInstr[offInstr], pState->pbNext, pState->cbLeft);
     209            memcpy(&pState->Dis.Instr.ab[offInstr], pState->pbNext, pState->cbLeft);
    210210            offInstr          += (uint8_t)pState->cbLeft;
    211211            cbMinRead         -= (uint8_t)pState->cbLeft;
     
    214214            pState->cbLeft     = 0;
    215215        }
    216         memset(&pState->Dis.u.abInstr[offInstr], 0xcc, cbMinRead);
     216        memset(&pState->Dis.Instr.ab[offInstr], 0xcc, cbMinRead);
    217217        pState->rc = VERR_EOF;
    218218    }
     
    223223         */
    224224        RTStrmPrintf(g_pStdErr, "Reading before current instruction!\n");
    225         memset(&pState->Dis.u.abInstr[offInstr], 0x90, cbMinRead);
     225        memset(&pState->Dis.Instr.ab[offInstr], 0x90, cbMinRead);
    226226        pState->rc = VERR_INTERNAL_ERROR;
    227227    }
     
    316316                if (!State.cbInstr)
    317317                {
    318                     State.Dis.u.abInstr[0] = 0;
     318                    State.Dis.Instr.ab[0] = 0;
    319319                    State.Dis.pfnReadBytes(&State.Dis, 0, 1, 1);
    320320                    State.cbInstr = 1;
     
    322322                RTPrintf("    db");
    323323                for (unsigned off = 0; off < State.cbInstr; off++)
    324                     RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.u.abInstr[off]);
     324                    RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.Instr.ab[off]);
    325325                RTPrintf("    ; %s\n", State.szLine);
    326326            }
     
    345345                    RTPrintf("    db");
    346346                    for (unsigned off = 0; off < State.cbInstr; off++)
    347                         RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.u.abInstr[off]);
     347                        RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.Instr.ab[off]);
    348348                    RTPrintf(" ; ");
    349349                }
     
    376376        {
    377377            uint32_t cbInstrOnly = 32;
    378             uint8_t  abInstr[sizeof(State.Dis.u.abInstr)];
    379             memcpy(abInstr, State.Dis.u.abInstr, sizeof(State.Dis.u.abInstr));
     378            uint8_t  abInstr[sizeof(State.Dis.Instr.ab)];
     379            memcpy(abInstr, State.Dis.Instr.ab, sizeof(State.Dis.Instr.ab));
    380380            int rcOnly = DISInstrWithPrefetchedBytes(State.uAddress, enmCpuMode, 0 /*fFilter - none */,
    381381                                                     abInstr, State.Dis.cbCachedInstr, MyDisasInstrRead, &State,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette