|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.util.SequenceProbe
The SequenceProbe
is a probe composer that allows a probe to be fired for every instruction
executed between a specified entrypoint and a specified exit point. For example, if the entrypoint is a
call instruction and the exit point is the instruction following the call instruction, then the probe will
fire for every instruction executed between the call and return, including both the call and the
instruction following the call.
Nested Class Summary |
Nested classes inherited from class avrora.sim.Simulator.Probe |
Simulator.Probe.Empty |
Field Summary | |
int |
entry_addr
The immutable entry_addr field stores the address that enables the per-instruction calling
of the probe passed in the constructor. |
int |
exit_addr
The immutable exit_addr field stores the address that disables the per-instruction calling
of the probe passed when the nesting level reaches zero. |
int |
nesting
The nesting field stores the current nesting level (i.e. the number of times
entry_addr has been reached without exit_addr intervening). |
Simulator.Probe |
probe
The immutable probe field stores a reference to the probe passed in the constructor. |
Constructor Summary | |
SequenceProbe(Simulator.Probe p,
int entry,
int exit)
The constructor for the SequenceProbe class simply stores its arguments into the
corresponding public final fields in this object, leaving the probe in a state where it is ready to be
inserted into a simulator. |
Method Summary | |
void |
fireAfter(State state,
int pc)
The fireBefore() method is called before the probed instruction executes. |
void |
fireBefore(State state,
int pc)
The fireBefore() method is called before the probed instruction executes. |
void |
reset()
The reset() method simply resets the nesting level of the sequence probe, as if it had
exited from all nested entries into the region. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final int entry_addr
entry_addr
field stores the address that enables the per-instruction calling
of the probe passed in the constructor.
public final int exit_addr
exit_addr
field stores the address that disables the per-instruction calling
of the probe passed when the nesting level reaches zero.
public final Simulator.Probe probe
probe
field stores a reference to the probe passed in the constructor.
public int nesting
nesting
field stores the current nesting level (i.e. the number of times
entry_addr
has been reached without exit_addr
intervening).
Constructor Detail |
public SequenceProbe(Simulator.Probe p, int entry, int exit)
SequenceProbe
class simply stores its arguments into the
corresponding public final fields in this object, leaving the probe in a state where it is ready to be
inserted into a simulator.
p
- the probe to fire for each instruction when the sequence is enteredentry
- the byte address of the entrypoint to the sequenceexit
- the byte address of the exitpoint of the sequenceMethod Detail |
public void fireBefore(State state, int pc)
fireBefore()
method is called before the probed instruction executes. In the
implementation of the sequence probe, if the address is the entrypoint address, then the nesting level
is incremented. When the nesting level is greater than one, then the sequence probe will delegate the
fireBefore()
call to the user probe.
fireBefore
in interface Simulator.Probe
state
- the state of the simulationpc
- the address at which this instruction residespublic void fireAfter(State state, int pc)
fireBefore()
method is called before the probed instruction executes. When the nesting
level is greater than one, then the sequence probe will delegate the fireAfter()
call to
the user probe. If the address is the exit point, then the nesting level is decremented after the call
to fireAfter()
of the user probe.
fireAfter
in interface Simulator.Probe
state
- the state of the simulationpc
- the address at which this instruction residespublic void reset()
reset()
method simply resets the nesting level of the sequence probe, as if it had
exited from all nested entries into the region.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |