Changeset 99220 in vbox for trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
- Timestamp:
- Mar 30, 2023 12:40:46 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
r98103 r99220 149 149 case OP_MOV_DR: 150 150 case OP_MOV_TR: 151 if (pDis-> ModRM.Bits.Mod != 3)151 if (pDis->arch.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-> bOpCode == 0x8f158 && pDis-> ModRM.Bits.Reg != 0)157 if ( pDis->arch.x86.bOpCode == 0x8f 158 && pDis->arch.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-> bOpCode == 0xc6165 || pDis-> bOpCode == 0xc7)166 && pDis-> ModRM.Bits.Reg != 0)164 if ( ( pDis->arch.x86.bOpCode == 0xc6 165 || pDis->arch.x86.bOpCode == 0xc7) 166 && pDis->arch.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. abInstr[offInstr], pState->pbNext, cbToRead);194 memcpy(&pState->Dis.u.abInstr[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. abInstr[offInstr], pState->pbNext, pState->cbLeft);209 memcpy(&pState->Dis.u.abInstr[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. abInstr[offInstr], 0xcc, cbMinRead);216 memset(&pState->Dis.u.abInstr[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. abInstr[offInstr], 0x90, cbMinRead);225 memset(&pState->Dis.u.abInstr[offInstr], 0x90, cbMinRead); 226 226 pState->rc = VERR_INTERNAL_ERROR; 227 227 } … … 316 316 if (!State.cbInstr) 317 317 { 318 State.Dis. abInstr[0] = 0;318 State.Dis.u.abInstr[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. abInstr[off]);324 RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.u.abInstr[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. abInstr[off]);347 RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.u.abInstr[off]); 348 348 RTPrintf(" ; "); 349 349 } … … 376 376 { 377 377 uint32_t cbInstrOnly = 32; 378 uint8_t abInstr[sizeof(State.Dis. abInstr)];379 memcpy(abInstr, State.Dis. abInstr, sizeof(State.Dis.abInstr));378 uint8_t abInstr[sizeof(State.Dis.u.abInstr)]; 379 memcpy(abInstr, State.Dis.u.abInstr, sizeof(State.Dis.u.abInstr)); 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.