Changeset 101539 in vbox for trunk/src/VBox/Disassembler/testcase
- Timestamp:
- Oct 22, 2023 2:43:09 AM (18 months ago)
- svn:sync-xref-src-repo-rev:
- 159616
- Location:
- trunk/src/VBox/Disassembler/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/testcase/tstDisasm-1.cpp
r99775 r101539 89 89 DISSTATE DisOnly; 90 90 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); 92 92 93 93 RTTESTI_CHECK_RC(rc, VINF_SUCCESS); … … 109 109 { 110 110 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); 112 112 pDis->cbCachedInstr = offInstr + cbMaxRead; 113 113 return VINF_SUCCESS; -
trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
r99220 r101539 149 149 case OP_MOV_DR: 150 150 case OP_MOV_TR: 151 if (pDis-> arch.x86.ModRM.Bits.Mod != 3)151 if (pDis->x86.ModRM.Bits.Mod != 3) 152 152 return false; 153 153 break; … … 155 155 /* The 0x8f /0 variant of this instruction doesn't get its /r value verified. */ 156 156 case OP_POP: 157 if ( pDis-> arch.x86.bOpCode == 0x8f158 && pDis-> arch.x86.ModRM.Bits.Reg != 0)157 if ( pDis->x86.bOpCode == 0x8f 158 && pDis->x86.ModRM.Bits.Reg != 0) 159 159 return false; 160 160 break; … … 162 162 /* The 0xc6 /0 and 0xc7 /0 variants of this instruction don't get their /r values verified. */ 163 163 case OP_MOV: 164 if ( ( pDis-> arch.x86.bOpCode == 0xc6165 || 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) 167 167 return false; 168 168 break; … … 192 192 //size_t cbToRead = cbMaxRead; 193 193 size_t cbToRead = cbMinRead; 194 memcpy(&pState->Dis. u.abInstr[offInstr], pState->pbNext, cbToRead);194 memcpy(&pState->Dis.Instr.ab[offInstr], pState->pbNext, cbToRead); 195 195 pState->Dis.cbCachedInstr = offInstr + (uint8_t)cbToRead; 196 196 pState->pbNext += cbToRead; … … 207 207 if (pState->cbLeft > 0) 208 208 { 209 memcpy(&pState->Dis. u.abInstr[offInstr], pState->pbNext, pState->cbLeft);209 memcpy(&pState->Dis.Instr.ab[offInstr], pState->pbNext, pState->cbLeft); 210 210 offInstr += (uint8_t)pState->cbLeft; 211 211 cbMinRead -= (uint8_t)pState->cbLeft; … … 214 214 pState->cbLeft = 0; 215 215 } 216 memset(&pState->Dis. u.abInstr[offInstr], 0xcc, cbMinRead);216 memset(&pState->Dis.Instr.ab[offInstr], 0xcc, cbMinRead); 217 217 pState->rc = VERR_EOF; 218 218 } … … 223 223 */ 224 224 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); 226 226 pState->rc = VERR_INTERNAL_ERROR; 227 227 } … … 316 316 if (!State.cbInstr) 317 317 { 318 State.Dis. u.abInstr[0] = 0;318 State.Dis.Instr.ab[0] = 0; 319 319 State.Dis.pfnReadBytes(&State.Dis, 0, 1, 1); 320 320 State.cbInstr = 1; … … 322 322 RTPrintf(" db"); 323 323 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]); 325 325 RTPrintf(" ; %s\n", State.szLine); 326 326 } … … 345 345 RTPrintf(" db"); 346 346 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]); 348 348 RTPrintf(" ; "); 349 349 } … … 376 376 { 377 377 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)); 380 380 int rcOnly = DISInstrWithPrefetchedBytes(State.uAddress, enmCpuMode, 0 /*fFilter - none */, 381 381 abInstr, State.Dis.cbCachedInstr, MyDisasInstrRead, &State,
Note:
See TracChangeset
for help on using the changeset viewer.