Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.squawk
Class DebuggerSupport.StackInspector

    java.lang.Object
      com.sun.squawk.DebuggerSupport.StackInspector

Direct Known Subclasses:
  DebuggerSupport.SlotSetter

Enclosing class:
  DebuggerSupport

    public static class DebuggerSupport.StackInspector

extends Object

A StackInspector instance is used in conjunction with `DebuggerSupport.inspectStack(com.sun.squawk.DebuggerSupport.StackInspector, com.sun.squawk.ExecutionPoint, int)` to traverse one or more stack frames in a suspended thread. The values of the slots in each frame can be inspected.

Field Summary
`protected boolean` | `doSlots` Determines if the inspector should be given a chance to inspect the value of the slots in each frame.
`protected VMThread` | `vmThread` The thread whose call stack is being inspected.

Constructor Summary
`protected` | `DebuggerSupport.StackInspector(VMThread thread, boolean doSlots)` Constructor.

Method Summary
`Object` | `getResult()` Gets the result (if any) of the inspection.
`Klass[]` | `getTypeMap(int frameNo, Object mp, int parameterCount)` Figure out the type map for the given frameNo and method pointer.
`void` | `inspectFrame(Object mp, Offset bci, int frame, Offset fo)` Invoked to inspect a frame in the thread's call stack
`void` | `inspectSlot(boolean isParameter, int slot, Klass type, long value)` Invoked to inspect the value of a primitive typed slot within a frame in the thread's call stack
`void` | `inspectSlot(boolean isParameter, int slot, Object value)` Invoked to inspect the value of a reference typed slot within a frame in the thread's call stack
`void` | `postInspection()` Hooks for any inspector specific behaviour that must run after the frame inspection is completed.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### doSlots

    protected final boolean doSlots

  Determines if the inspector should be given a chance to inspect the value of the slots in each frame.

### vmThread

    protected final VMThread vmThread

  The thread whose call stack is being inspected.

Constructor Detail

### DebuggerSupport.StackInspector

    protected DebuggerSupport.StackInspector(VMThread thread,
                                             boolean doSlots)

  Constructor.

  Parameters:
    `thread` - the thread whose call stack is being inspected. This thread must be suspended at the time the inspection is performed.
    `doSlots` - true if this inspector should be given a change to inspect the value of the slots in each frame by means of having it `inspectSlot(boolean, int, java.lang.Object)` methods invoked

Method Detail

### inspectFrame

    public void inspectFrame(Object mp,
                             Offset bci,
                             int frame,
                             Offset fo)

  Invoked to inspect a frame in the thread's call stack

  Parameters:
    `mp` - the method to which the frame pertains
    `bci` - the current bytecode index of the instruction pointer
    `frame` - the frame's identifier within the call stack. A frame is identified by the number of frames between it and the inner most frame (i.e. the inner most frame will be 0)
    `fo` - the frame's offset from the top of the stack

### inspectSlot

    public void inspectSlot(boolean isParameter,
                            int slot,
                            Object value)

  Invoked to inspect the value of a reference typed slot within a frame in the thread's call stack

  Parameters:
    `isParameter` - true if the slot holds the value of a parameter
    `slot` - the slot index
    `value` - the value in the slot

### inspectSlot

    public void inspectSlot(boolean isParameter,
                            int slot,
                            Klass type,
                            long value)

  Invoked to inspect the value of a primitive typed slot within a frame in the thread's call stack

  Parameters:
    `isParameter` - true if the slot holds the value of a parameter
    `slot` - the slot index
    `type` - `int`, `float`, `long`, `double`, `address`, `offset` or `uword`
    `value` - the value in the slot

### postInspection

    public void postInspection()

  Hooks for any inspector specific behaviour that must run after the frame inspection is completed.

### getResult

    public Object getResult()

  Gets the result (if any) of the inspection. This is also useful for propogating exceptions out to the caller.

  Returns:
    a value computed as a result of the inspection

### getTypeMap

    public Klass[] getTypeMap(int frameNo,
                              Object mp,
                              int parameterCount)

  Figure out the type map for the given frameNo and method pointer. The default implemention decodes the typemap in the method object, but that only includes ref/prim types (Object vs int). The debugger agent (SDA) gets more specific type info from the the debugger proxy.

  Parameters:
    `frameNo` -
    `mp` -
    `parameterCount` -
  Returns:
    a klass array with one klass per physical word (eg. longs and doubles will have two entries)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"