frysk.stack
Class Frame

java.lang.Object
  extended by frysk.stack.Frame
Direct Known Subclasses:
FrameDecorator, LibunwindFrame

public abstract class Frame
extends Object


Field Summary
private static Log fine
           
private  Frame inner
           
private  int level
           
private  Frame outer
           
private  Task task
           
private  boolean unwound
          Has there already been an unwind attempt?
 
Constructor Summary
Frame(Frame inner, Task task)
          Construct a frame.
 
Method Summary
abstract  long getAddress()
          Returns the program counter for this StackFrame.
abstract  long getAdjustedAddress()
          Returns the pre-call PC for this non-interrupted StackFrame.
abstract  FrameIdentifier getFrameIdentifier()
          Return this frame's FrameIdentifier.
 Frame getInner()
          Returns this StackFrame's inner frame.
 String getLibraryName()
           
 Frame getOuter()
          Returns this StackFrame's outer frame.
 long getRegister(Register register)
           
abstract  void getRegister(Register register, long offset, int length, byte[] bytes, int start)
          Extracts OFFSET:LENGTH bytes of REGISTER storing them from START in BYTES (in the target's byte order).
private  byte[] getRegisterBytes(Register register)
           
 Value getRegisterValue(Register register)
           
abstract  Symbol getSymbol()
          Return this frame's symbol; UNKNOWN if there is no symbol.
 Task getTask()
          Returns the Task this StackFrame belongs to.
 int level()
           
 void printLevel(PrintWriter writer)
           
protected  void printLibraryName(PrintWriter writer, PrintStackOptions options)
          If requrested by the stack options, print the library name using the form " from LIBRARY".
abstract  void setRegister(Register register, long offset, int length, byte[] bytes, int start)
          Stores BYTES from START into REGISTER at OFFSET:LENGTH (in the target's byte order).
 void toPrint(PrintWriter writer, PrintStackOptions options)
          Write a simple string representation of this stack frame.
 String toString()
          Returns a plain string representation if this frame.
protected abstract  Frame unwind()
          Returns this Frame's outer frame; or null if there is no frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fine

private static Log fine

task

private final Task task

inner

private final Frame inner

outer

private Frame outer

level

private final int level

unwound

private boolean unwound
Has there already been an unwind attempt?

Constructor Detail

Frame

Frame(Frame inner,
      Task task)
Construct a frame. For the inner most frame "inner" is NULL. XXX: pacakge-private if you need to extend this, use FrameDecorator.

Method Detail

getAddress

public abstract long getAddress()
Returns the program counter for this StackFrame.

Returns:
The program counter for this StackFrame.

getAdjustedAddress

public abstract long getAdjustedAddress()
Returns the pre-call PC for this non-interrupted StackFrame.

Returns:
The pre-call program counter for this StackFrame.

getTask

public final Task getTask()
Returns the Task this StackFrame belongs to.

Returns:
The Task this StackFrame belongs to.

level

public final int level()

printLevel

public final void printLevel(PrintWriter writer)

getInner

public final Frame getInner()
Returns this StackFrame's inner frame.

Returns:
This StackFrame's inner frame.

getOuter

public final Frame getOuter()
Returns this StackFrame's outer frame.

Returns:
This StackFrame's outer frame.

unwind

protected abstract Frame unwind()
Returns this Frame's outer frame; or null if there is no frame.


toPrint

public void toPrint(PrintWriter writer,
                    PrintStackOptions options)
Write a simple string representation of this stack frame.

Parameters:
printWriter -

printLibraryName

protected void printLibraryName(PrintWriter writer,
                                PrintStackOptions options)
If requrested by the stack options, print the library name using the form " from LIBRARY".


getLibraryName

public String getLibraryName()

toString

public String toString()
Returns a plain string representation if this frame. This is similar to the result of calling toPrint() with both printParameters and fullPaths set to false.

Overrides:
toString in class Object

getRegister

public abstract void getRegister(Register register,
                                 long offset,
                                 int length,
                                 byte[] bytes,
                                 int start)
Extracts OFFSET:LENGTH bytes of REGISTER storing them from START in BYTES (in the target's byte order).


getRegisterBytes

private byte[] getRegisterBytes(Register register)

getRegisterValue

public final Value getRegisterValue(Register register)

getRegister

public final long getRegister(Register register)

setRegister

public abstract void setRegister(Register register,
                                 long offset,
                                 int length,
                                 byte[] bytes,
                                 int start)
Stores BYTES from START into REGISTER at OFFSET:LENGTH (in the target's byte order).


getFrameIdentifier

public abstract FrameIdentifier getFrameIdentifier()
Return this frame's FrameIdentifier.


getSymbol

public abstract Symbol getSymbol()
Return this frame's symbol; UNKNOWN if there is no symbol.