frysk.stack
Class FrameIdentifier

java.lang.Object
  extended by frysk.stack.FrameIdentifier

public class FrameIdentifier
extends Object


Constructor Summary
FrameIdentifier(long functionAddress, long cfa)
          Create a new FrameIdentifier.
 
Method Summary
 boolean equals(Object fi)
          Compares this FrameIdentifier to the parameter and returns true if both the cfa and function address match.
 long getFunctionAddress()
          Returns the function address from this FrameIdentifier
 int hashCode()
          Returns a hashCode for this object
 boolean innerTo(FrameIdentifier fi)
          Returns true if this FrameIdentifier is inner to the parameter.
 boolean outerTo(FrameIdentifier fi)
          Returns true if this FrameIdentifier is outer to the parameter.
 String toString()
          Displays customized String output.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameIdentifier

public FrameIdentifier(long functionAddress,
                       long cfa)
Create a new FrameIdentifier. Identifies a stack frame based on its canonical frame address and function starting address.

Parameters:
functionAddress - The address of the start of the frame
cfa - The canonical frame address of the stack frame
Method Detail

innerTo

public boolean innerTo(FrameIdentifier fi)
Returns true if this FrameIdentifier is inner to the parameter.

Parameters:
fi - The FrameIdentifier to compare to
Returns:
true If this is inner to fi

outerTo

public boolean outerTo(FrameIdentifier fi)
Returns true if this FrameIdentifier is outer to the parameter.

Parameters:
fi - The FrameIdentifier to compare to
Returns:
true If this is outer to fi

equals

public boolean equals(Object fi)
Compares this FrameIdentifier to the parameter and returns true if both the cfa and function address match. It is important to use the function address instead of the stack frame's current address because that address may change in the lifetime of * a stack frame, and thus this method could potentially return false if * one of the frames had been stepped and the other was not. Using the * frame start address guarantees that if two StackFrames are compared, * and they both represent the same frame on the stack, this method will * return true regardless of the state of either frame.

Overrides:
equals in class Object
Parameters:
fi - The FrameIdentifier to compare to.
Returns:
true If the cfa and function address belonging to this FrameIdentifier match the cfa and function address in the parameter.

getFunctionAddress

public long getFunctionAddress()
Returns the function address from this FrameIdentifier

Returns:
functionAddress The start address of the frame represented by this FrameIdentifier

hashCode

public int hashCode()
Returns a hashCode for this object

Overrides:
hashCode in class Object

toString

public String toString()
Displays customized String output.

Overrides:
toString in class Object