|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The Policy interface allows for more modular, composable analysis. An instance
of this class is passed to the AbstractInterpreter and that instance
determines how to handle calls, returns, indirect jumps, and stack operations
in the abstract interpretation. Thus, multiple anlayses can share the same
core abstract interpreter in a clean way.
AbstractInterpreter| Method Summary | |
MutableState |
call(MutableState s,
int target_address)
The call() method is called by the abstract interpreter when it
encounters a call instruction within the program. |
MutableState |
indirectCall(MutableState s,
char addr_low,
char addr_hi)
The indirectCall() method is called by the abstract interpreter
when it encounters an indirect call within the program. |
MutableState |
indirectCall(MutableState s,
char addr_low,
char addr_hi,
char ext)
The indirectCall() method is called by the abstract interpreter
when it encounters an indirect call within the program. |
MutableState |
indirectJump(MutableState s,
char addr_low,
char addr_hi)
The indirectJump() method is called by the abstract interpreter
when it encounters an indirect jump within the program. |
MutableState |
indirectJump(MutableState s,
char addr_low,
char addr_hi,
char ext)
The indirectJump() method is called by the abstract interpreter
when it encounters an indirect jump within the program. |
MutableState |
interrupt(MutableState s,
int num)
The interrupt() is called by the abstract interrupt when it
encounters a place in the program when an interrupt might occur. |
char |
pop(MutableState s)
The pop() method is called by the abstract interpreter when
a pop from the stack is ecountered in the program. |
void |
push(MutableState s,
char val)
The push() method is called by the abstract interpreter when
a push to the stack is encountered in the program. |
void |
pushState(MutableState newState)
The pushState method is called by the abstract interpreter when
a state is forked by the abstract interpreter (for example when a branch
condition is not known and both branches must be taken. |
MutableState |
ret(MutableState s)
The ret() method is called by the abstract interpreter when it
encounters a return within the program. |
MutableState |
reti(MutableState s)
The reti() method is called by the abstract interpreter when it
encounters a return from an interrupt within the program. |
| Method Detail |
public MutableState call(MutableState s,
int target_address)
call() method is called by the abstract interpreter when it
encounters a call instruction within the program. Different policies may
handle calls differently. For example, a context-sensitive analysis might
fork and start analysis the called method in this context, which a context
insensitive analsysis may just merge the current state into the entrance
state for that address and then reanalyze that code.
s - the current calling abstract statetarget_address - the concrete target address of the call
public MutableState interrupt(MutableState s,
int num)
interrupt() is called by the abstract interrupt when it
encounters a place in the program when an interrupt might occur.
s - the abstract state just before interruptnum - the interrupt number that might occur
public MutableState ret(MutableState s)
ret() method is called by the abstract interpreter when it
encounters a return within the program.
s - the current abstract state
public MutableState reti(MutableState s)
reti() method is called by the abstract interpreter when it
encounters a return from an interrupt within the program.
s - the current abstract state
public MutableState indirectCall(MutableState s,
char addr_low,
char addr_hi)
indirectCall() method is called by the abstract interpreter
when it encounters an indirect call within the program. The abstract values
of the address are given as parameters, so that a policy can choose to compute
possible targets or be conservative or whatever it so chooses.
s - the current abstract stateaddr_low - the (abstract) low byte of the addressaddr_hi - the (abstract) high byte of the address
public MutableState indirectJump(MutableState s,
char addr_low,
char addr_hi)
indirectJump() method is called by the abstract interpreter
when it encounters an indirect jump within the program. The abstract values
of the address are given as parameters, so that a policy can choose to compute
possible targets or be conservative or whatever it so chooses.
s - the current abstract stateaddr_low - the (abstract) low byte of the addressaddr_hi - the (abstract) high byte of the address
public MutableState indirectCall(MutableState s,
char addr_low,
char addr_hi,
char ext)
indirectCall() method is called by the abstract interpreter
when it encounters an indirect call within the program. The abstract values
of the address are given as parameters, so that a policy can choose to compute
possible targets or be conservative or whatever it so chooses.
s - the current abstract stateaddr_low - the (abstract) low byte of the addressaddr_hi - the (abstract) high byte of the addressext - the (abstract) extended part of the address
public MutableState indirectJump(MutableState s,
char addr_low,
char addr_hi,
char ext)
indirectJump() method is called by the abstract interpreter
when it encounters an indirect jump within the program. The abstract values
of the address are given as parameters, so that a policy can choose to compute
possible targets or be conservative or whatever it so chooses.
s - the current abstract stateaddr_low - the (abstract) low byte of the addressaddr_hi - the (abstract) high byte of the addressext - the (abstract) extended part of the address
public void push(MutableState s,
char val)
push() method is called by the abstract interpreter when
a push to the stack is encountered in the program. The policy can then choose
what outgoing and/or modelling of the stack needs to be done.
s - the current abstract stateval - the abstract value to push onto the stackpublic char pop(MutableState s)
pop() method is called by the abstract interpreter when
a pop from the stack is ecountered in the program. The policy can then
choose to either return whatever information it has about the stack
contents, or return an UNKNOWN value.
s - the current abstract state
public void pushState(MutableState newState)
pushState method is called by the abstract interpreter when
a state is forked by the abstract interpreter (for example when a branch
condition is not known and both branches must be taken.
newState - the new state created
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||