VirtualBox

Changeset 99208 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Mar 29, 2023 2:13:56 PM (22 months ago)
Author:
vboxsync
Message:

Disassembler,VMM,Runtime: Get rid of deprecated DISCPUSTATE types (preparation for architecture specific separation in order to support ARMv8), bugref:10394

Location:
trunk/src/VBox/Runtime/testcase
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstLdr-2.cpp

    r98103 r99208  
    5151bool MyDisBlock(uint8_t const *pbCodeBlock, int32_t cbMax)
    5252{
    53     DISCPUSTATE Cpu;
     53    DISSTATE Dis;
    5454    int32_t i = 0;
    5555    while (i < cbMax)
     
    5757        char        szOutput[256];
    5858        uint32_t    cbInstr;
    59         if (RT_FAILURE(DISInstrToStr(pbCodeBlock + i, DISCPUMODE_32BIT, &Cpu, &cbInstr, szOutput, sizeof(szOutput))))
     59        if (RT_FAILURE(DISInstrToStr(pbCodeBlock + i, DISCPUMODE_32BIT, &Dis, &cbInstr, szOutput, sizeof(szOutput))))
    6060            return false;
    6161
  • trunk/src/VBox/Runtime/testcase/tstLdr-3.cpp

    r98103 r99208  
    137137}
    138138
    139 static DECLCALLBACK(int) MyGetSymbol(PCDISCPUSTATE pCpu, uint32_t u32Sel, RTUINTPTR uAddress,
     139static DECLCALLBACK(int) MyGetSymbol(PCDISSTATE pDis, uint32_t u32Sel, RTUINTPTR uAddress,
    140140                                     char *pszBuf, size_t cchBuf, RTINTPTR *poff,
    141141                                     void *pvUser)
    142142{
    143     RT_NOREF3(pCpu, u32Sel, pvUser);
     143    RT_NOREF3(pDis, u32Sel, pvUser);
    144144
    145145    if (   uAddress > RTLdrSize(g_hLdrMod) + g_uLoadAddr
     
    161161 * @callback_method_impl{FNDISREADBYTES}
    162162 */
    163 static DECLCALLBACK(int) MyReadBytes(PDISCPUSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
     163static DECLCALLBACK(int) MyReadBytes(PDISSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
    164164{
    165165    RT_NOREF1(cbMaxRead);
     
    174174                       RTUINTPTR uNearAddr, RTUINTPTR uSearchAddr)
    175175{
    176     DISCPUSTATE Cpu;
    177     int32_t     i = 0;
     176    DISSTATE Dis;
     177    int32_t  i = 0;
    178178    while (i < cbMax)
    179179    {
     
    184184        int rc = DISInstrWithReader(uNearAddr + i, enmCpuMode,
    185185                                    MyReadBytes, (uint8_t *)pvCodeBlock - (uintptr_t)uNearAddr,
    186                                     &Cpu, &cbInstr);
     186                                    &Dis, &cbInstr);
    187187        RTAssertSetMayPanic(fMayPanic);
    188188        RTAssertSetQuiet(fQuiet);
     
    195195            RTPrintf("%s:\n", NearSym.aSyms[0].szName);
    196196
    197         DISFormatYasmEx(&Cpu, szOutput, sizeof(szOutput),
     197        DISFormatYasmEx(&Dis, szOutput, sizeof(szOutput),
    198198                        DIS_FMT_FLAGS_RELATIVE_BRANCH | DIS_FMT_FLAGS_BYTES_RIGHT | DIS_FMT_FLAGS_ADDR_LEFT  | DIS_FMT_FLAGS_BYTES_SPACED,
    199199                        MyGetSymbol, NULL);
  • trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp

    r98103 r99208  
    9393 * @callback_method_impl{FNDISREADBYTES}
    9494 */
    95 static DECLCALLBACK(int) DisasmTest1ReadCode(PDISCPUSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
     95static DECLCALLBACK(int) DisasmTest1ReadCode(PDISSTATE pDis, uint8_t offInstr, uint8_t cbMinRead, uint8_t cbMaxRead)
    9696{
    9797    size_t cb = cbMaxRead;
     
    107107 * Use an inline function here just to test '__textcoal_nt' sections on darwin.
    108108 */
    109 inline int MyDisasm(uintptr_t CodeIndex, PDISCPUSTATE pCpu, uint32_t *pcb)
     109inline int MyDisasm(uintptr_t CodeIndex, PDISSTATE pDis, uint32_t *pcb)
    110110{
    111111    uint32_t cb;
    112     int rc = DISInstrWithReader(CodeIndex, DISCPUMODE_32BIT, DisasmTest1ReadCode, 0, pCpu, &cb);
     112    int rc = DISInstrWithReader(CodeIndex, DISCPUMODE_32BIT, DisasmTest1ReadCode, 0, pDis, &cb);
    113113    *pcb = cb;
    114114    MY_PRINTF(("DISCoreOneEx -> rc=%d cb=%d  Cpu: bOpCode=%#x pCurInstr=%p (42=%d)\n", \
    115                rc, cb, pCpu->bOpCode, pCpu->pCurInstr, 42)); \
     115               rc, cb, pDis->bOpCode, pDis->pCurInstr, 42)); \
    116116    return rc;
    117117}
     
    120120extern "C" DECLEXPORT(int) DisasmTest1(void)
    121121{
    122     DISCPUSTATE Cpu;
     122    DISSTATE  Dis;
    123123    uintptr_t CodeIndex = 0;
    124124    uint32_t cb;
     
    140140#endif
    141141
    142     memset(&Cpu, 0, sizeof(Cpu));
     142    memset(&Dis, 0, sizeof(Dis));
    143143
    144144#define DISAS_AND_CHECK(cbInstr, enmOp) \
    145145        do { \
    146             rc = MyDisasm(CodeIndex, &Cpu, &cb); \
     146            rc = MyDisasm(CodeIndex, &Dis, &cb); \
    147147            if (RT_FAILURE(rc)) \
    148148                return CodeIndex | 0xf000; \
    149             if (Cpu.pCurInstr->uOpcode != (enmOp)) \
     149            if (Dis.pCurInstr->uOpcode != (enmOp)) \
    150150                return CodeIndex| 0xe000; \
    151151            if (cb != (cbInstr)) \
  • trunk/src/VBox/Runtime/testcase/tstLdrObjR0.cpp

    r98103 r99208  
    103103{
    104104    static unsigned cb;
    105     DISCPUSTATE Cpu;
     105    DISSTATE Dis;
    106106
    107     memset(&Cpu, 0, sizeof(Cpu));
     107    memset(&Dis, 0, sizeof(Dis));
    108108
    109     DISInstr((void *)(uintptr_t)SomeExportFunction3, DISCPUMODE_32BIT, &Cpu, &cb);
     109    DISInstr((void *)(uintptr_t)SomeExportFunction3, DISCPUMODE_32BIT, &Dis, &cb);
    110110    return (void *)(uintptr_t)&SomeExportFunction1;
    111111}
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