Lines Matching defs:State
243 MYDISSTATE State;
244 State.uAddress = uAddress;
245 State.pbInstr = pbFile;
246 State.cbInstr = 0;
247 State.enmUndefOp = enmUndefOp;
248 State.rc = VINF_SUCCESS;
249 State.cbLeft = cbFile;
250 State.pbNext = pbFile;
251 State.uNextAddr = uAddress;
277 while (State.cbLeft > 0)
282 State.cbInstr = 0;
283 State.cbLeft += State.pbNext - State.pbInstr;
284 State.uNextAddr = State.uAddress;
285 State.pbNext = State.pbInstr;
287 int rc = DISInstrToStrWithReader(State.uAddress, enmCpuMode, MyDisasInstrRead, &State,
288 &State.Dis, &State.cbInstr, State.szLine, sizeof(State.szLine));
292 && State.enmUndefOp == kUndefOp_DefineByte))
294 State.fUndefOp = rc == VERR_DIS_INVALID_OPCODE
296 || State.Dis.pCurInstr->uOpcode == OP_INVALID
297 || State.Dis.pCurInstr->uOpcode == OP_ILLUD2
298 || ( State.enmUndefOp == kUndefOp_DefineByte
299 && !MyDisasIsValidInstruction(&State.Dis));
300 if (State.fUndefOp && State.enmUndefOp == kUndefOp_DefineByte)
302 if (!State.cbInstr)
304 State.Dis.abInstr[0] = 0;
305 State.Dis.pfnReadBytes(&State.Dis, 0, 1, 1);
306 State.cbInstr = 1;
309 for (unsigned off = 0; off < State.cbInstr; off++)
310 RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.abInstr[off]);
311 RTPrintf(" ; %s\n", State.szLine);
313 else if (!State.fUndefOp && State.enmUndefOp == kUndefOp_All)
315 RTPrintf("%s: error at %#RX64: unexpected valid instruction (op=%d)\n", argv0, State.uAddress, State.Dis.pCurInstr->uOpcode);
316 pfnFormatter(&State);
319 else if (State.fUndefOp && State.enmUndefOp == kUndefOp_Fail)
321 RTPrintf("%s: error at %#RX64: undefined opcode (op=%d)\n", argv0, State.uAddress, State.Dis.pCurInstr->uOpcode);
322 pfnFormatter(&State);
328 if ( State.enmUndefOp == kUndefOp_DefineByte
329 && DISFormatYasmIsOddEncoding(&State.Dis))
332 for (unsigned off = 0; off < State.cbInstr; off++)
333 RTPrintf(off ? ", %03xh" : " %03xh", State.Dis.abInstr[off]);
337 pfnFormatter(&State);
342 State.cbInstr = State.pbNext - State.pbInstr;
343 if (!State.cbLeft)
344 RTPrintf("%s: error at %#RX64: read beyond the end (%Rrc)\n", argv0, State.uAddress, rc);
345 else if (State.cbInstr)
346 RTPrintf("%s: error at %#RX64: %Rrc cbInstr=%d\n", argv0, State.uAddress, rc, State.cbInstr);
349 RTPrintf("%s: error at %#RX64: %Rrc cbInstr=%d!\n", argv0, State.uAddress, rc, State.cbInstr);
357 if (uHighlightAddr - State.uAddress < State.cbInstr)
364 uint8_t abInstr[sizeof(State.Dis.abInstr)];
365 memcpy(abInstr, State.Dis.abInstr, sizeof(State.Dis.abInstr));
366 int rcOnly = DISInstrWithPrefetchedBytes(State.uAddress, enmCpuMode, 0 /*fFilter - none */,
367 abInstr, State.Dis.cbCachedInstr, MyDisasInstrRead, &State,
368 &State.Dis, &cbInstrOnly);
370 || cbInstrOnly != State.cbInstr)
373 rcOnly, cbInstrOnly, rc, State.cbInstr);
380 State.uAddress += State.cbInstr;
381 State.pbInstr += State.cbInstr;