|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.DebuggerSupport
public class DebuggerSupport
Provides support for the Squawk Debugger Agent SDA
Some of this is to fit in to package encapsulation.
Nested Class Summary | |
---|---|
static class |
DebuggerSupport.SlotSetter
A SlotSetter is a kind of StackInspector that can set the value of a slot |
static class |
DebuggerSupport.StackInspector
A StackInspector instance is used in conjunction with inspectStack(com.sun.squawk.DebuggerSupport.StackInspector, com.sun.squawk.ExecutionPoint, int)
to traverse one or more stack frames in a suspended thread. |
Method Summary | |
---|---|
static int |
countStackFrames(VMThread vmThread,
ExecutionPoint from)
Count the number of frames on the stack, while thread is temporarily suspended. |
static Klass |
getDefiningClass(Object methodBody)
Gets the class in which a given method was defined.s |
static DataType.MethodID |
getIDForMethodBody(Klass definingClass,
Object methodBody)
Gets the JDWP identifier for a method given the method's body. |
static int |
getIDForROMObject(Object object)
Determines if a given object is in a read-only memory and returns a non-zero identifier for the object if it is. |
static String |
getJNISignature(Field field)
Gets the JNI signature of a field's type. |
static String |
getJNISignature(Klass klass)
Gets the JNI signature of a klass. |
static String |
getJNISignature(Method method)
Gets the JNI signature of a method's parameters and return type. |
static Object |
getMethodBody(Klass klass,
int offset,
boolean isStatic)
Gets the body of the method given a class and method table index. |
static int |
getMethodBodyLength(Object methodBody)
Return the length of methodBody (the byte code array) in bytes. |
static Object |
getROMObjectForID(int id)
Gets the object in read-only memory corresponding to an identifier that was returned from a call to getIDForROMObject(java.lang.Object) . |
static int |
getStaticInt(Isolate isolate,
Klass klass,
int offset)
Reads a static int variable. |
static long |
getStaticLong(Isolate isolate,
Klass klass,
int offset)
Reads a static long variable. |
static Object |
getStaticOop(Isolate isolate,
Klass klass,
int offset)
Reads a static reference variable. |
static ExecutionPoint |
getThreadCurrentExecutionPoint(VMThread thread)
Get execution state of non-running thread. |
static int |
getThreadJDWPState(VMThread vmThread)
Return the JDWP.ThreadStatus value for the given thread's internal state. |
static int |
inspectStack(DebuggerSupport.StackInspector inspector,
ExecutionPoint from,
int frameNo)
Traverses one or more stack frames in a thread (that must be suspended ). |
static boolean |
isAtExceptionBreakpoint(VMThread vmThread)
Determines if the current hit breakpoint (if any) is an exception breakpoint. |
static boolean |
isInitialized(Klass klass,
Isolate isolate)
Determines if a given class is initialized in a given isolate. |
static void |
setDebugger(Isolate isolate,
Debugger debugger,
boolean attach)
Attaches or detaches a debugger to an isolate. |
static void |
setStaticInt(Isolate isolate,
Klass klass,
int offset,
int value)
Writes a static int variable. |
static void |
setStaticLong(Isolate isolate,
Klass klass,
int offset,
long value)
Writes a static long variable. |
static void |
setStaticOop(Isolate isolate,
Klass klass,
int offset,
Object value)
Writes a static reference variable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int getThreadJDWPState(VMThread vmThread)
vmThread
- VMThread
public static String getJNISignature(Klass klass)
klass
- a class
klass
public static String getJNISignature(Field field)
field
- a field
field
public static String getJNISignature(Method method)
method
- a method
method
public static int getIDForROMObject(Object object)
getROMObjectForID(int)
object
- the object to test
object
if it's in a read-only memory otherwise 0public static Object getROMObjectForID(int id)
getIDForROMObject(java.lang.Object)
.
id
- an identifier for an object in read-only memory (must be positive)
id
public static boolean isInitialized(Klass klass, Isolate isolate)
klass
- the class to testisolate
- the isolate context
klass
is intialized in isolate
public static Object getStaticOop(Isolate isolate, Klass klass, int offset)
isolate
- the isolate context to use for variable lookupklass
- the class of the variableoffset
- the offset (in words) to the variable
public static int getStaticInt(Isolate isolate, Klass klass, int offset)
isolate
- the isolate context to use for variable lookupklass
- the class of the variableoffset
- the offset (in words) to the variable
public static long getStaticLong(Isolate isolate, Klass klass, int offset)
isolate
- the isolate context to use for variable lookupklass
- the class of the variableoffset
- the offset (in words) to the variable
public static void setStaticOop(Isolate isolate, Klass klass, int offset, Object value)
isolate
- the isolate context to use for variable lookupklass
- the class of the variableoffset
- the offset (in words) to the variablevalue
- public static void setStaticInt(Isolate isolate, Klass klass, int offset, int value)
isolate
- the isolate context to use for variable lookupklass
- the class of the variableoffset
- the offset (in words) to the variablevalue
- public static void setStaticLong(Isolate isolate, Klass klass, int offset, long value)
isolate
- the isolate context to use for variable lookupklass
- the class of the variableoffset
- the offset (in words) to the variablevalue
- public static Klass getDefiningClass(Object methodBody)
methodBody
- the body of a method
methodBody
was definedpublic static Object getMethodBody(Klass klass, int offset, boolean isStatic)
klass
- the class that defined the methodoffset
- the index of the method in its enclosing methods tableisStatic
- true if the requested method is static, false if it is virtual
public static int getMethodBodyLength(Object methodBody)
methodBody
(the byte code array) in bytes.
methodBody
- Object
public static DataType.MethodID getIDForMethodBody(Klass definingClass, Object methodBody)
definingClass
- the class that defined the methodmethodBody
- the method's body
methodBody
public static boolean isAtExceptionBreakpoint(VMThread vmThread)
vmThread
- thread to check
public static ExecutionPoint getThreadCurrentExecutionPoint(VMThread thread)
thread
-
public static int inspectStack(DebuggerSupport.StackInspector inspector, ExecutionPoint from, int frameNo)
suspended
).
inspector
- the frame inspector delegatefrom
- the location in the call stack of the thread at which to start inspecting.
If null, then inspection starts at the inner most frame.frameNo
- the frame to inspect or -1 if all frames are to be inspected. 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)
public static void setDebugger(Isolate isolate, Debugger debugger, boolean attach)
isolate
- the target debuggee isolatedebugger
- the debugger wanting to attach or detachattach
- specifies if this in an attach or detach operationpublic static int countStackFrames(VMThread vmThread, ExecutionPoint from)
thread
is temporarily suspended.
vmThread
- the thread to count the frames offrom
- the location in the call stack of the thread at which to start inspecting.
If null, then inspection starts at the inner most frame.
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |