public void instructionEvent() throws GDBServerException
{
if (metEnd)
{
metEnd=false;
throw new TraceException();
}
if (resync&&trigger)
{
if (match())
{
/* we have to wait for the first instruction in the trace to be matched */
System.out.println("First matching instruction found!");
resync=false;
}
}
if (!resync&&trigger)
{
boolean m=match();
recordCurrent();
current=(current+1)%trace.length;
if (!m)
{
System.err.println("Trace file mismatch");
dumpTraceBack();
System.err.print("Expected by Java simulator: \n");
simulator.printState(this);
System.err.print("Actual from ModelSim: ");
System.err.println(line);
// we now have to ignore this match.
ignore=true;
throw new TraceException();
}
} else
{
recordCurrent();
current=(current+1)%trace.length;