|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kohsuke.youdebug.VM
public class VM
Debugger view of a Virtual machine.
Field Summary | |
---|---|
static ExceptionBreakpointModifier |
CAUGHT
|
static ExceptionBreakpointModifier |
UNCAUGHT
|
Constructor Summary | |
---|---|
VM(com.sun.jdi.VirtualMachine vm)
|
Method Summary | |
---|---|
com.sun.jdi.ReferenceType |
_(Class c)
Short hand for {@link #ref(Class) |
com.sun.jdi.ReferenceType |
_(String c)
Short hand for {@link #ref(String) |
Object |
_new(Class c,
Object args)
Creates a new instance of the given type in the remote JVM. |
Object |
_new(com.sun.jdi.ReferenceType t,
Object args)
|
Object |
_new(String c,
Object args)
Creates a new instance of the given type in the remote JVM. |
com.sun.jdi.request.AccessWatchpointRequest |
accessWatchpoint(Class c,
String fieldName,
groovy.lang.Closure body)
Same as accessWatchpoint(c.name,fieldName,body) |
com.sun.jdi.request.AccessWatchpointRequest |
accessWatchpoint(com.sun.jdi.Field f,
groovy.lang.Closure body)
Sets a breakpoint that fires when the specified field is read. |
com.sun.jdi.request.AccessWatchpointRequest |
accessWatchpoint(String className,
String fieldName,
groovy.lang.Closure body)
Sets a breakpoint that fires when the specified field of the specified class is read. |
BundledBreakpointRequest |
breakpoint(Class className,
int line,
groovy.lang.Closure c)
Same as breakpoint(String, int, Closure) except you specify the class by using
a reference to the class in this JVM. |
BundledBreakpointRequest |
breakpoint(com.sun.jdi.ReferenceType type,
int line,
groovy.lang.Closure body)
Same as breakpoint(String, int, Closure) except you specify the class by using
a remote reference ReferenceType . |
BundledBreakpointRequest |
breakpoint(String className,
int line,
groovy.lang.Closure body)
Sets a break point at the specified line in the specified class, and if it hits, invoke the closure. |
com.sun.jdi.request.ClassPrepareRequest |
classPrepare(Class clazz,
groovy.lang.Closure c)
Same as classPrepare(String, Closure) except you specify the class by using
a reference to the class in this JVM. |
com.sun.jdi.request.ClassPrepareRequest |
classPrepare(String name,
groovy.lang.Closure body)
Sets a break point to be fired when a class of the specified name is loaded into the JVM. |
void |
close()
Shuts down the connection. |
static VM |
current()
Can be called during event dispatching to obtain the current VM instance. |
void |
dispatchEvents()
Dispatches events received from the target JVM until the connection is closed, the remote JVM exits, or the thread ges interrupted. |
void |
dumpAllThreads()
Short for dumpAllThreads(System.out) |
void |
dumpAllThreads(PrintStream out)
Dumps information about all the threads in the target JVM to the specified object. |
void |
dumpAllThreads(PrintWriter out)
Dumps information about all the threads in the target JVM to the specified object. |
void |
dumpHeap(String path)
Instructs the target JVM to create a heap dump. |
com.sun.jdi.request.ExceptionRequest |
exceptionBreakpoint(Class exceptionClass,
groovy.lang.Closure c)
Short for exceptionBreakpoint(exceptionClass,null,c) , to get notified for both kinds of exceptions. |
com.sun.jdi.request.ExceptionRequest |
exceptionBreakpoint(Class exceptionClass,
Collection modifiers,
groovy.lang.Closure c)
Same as #exceptionBreakpoint(String, Collection
except you specify the exception type by a local class of the same name. |
com.sun.jdi.request.ExceptionRequest |
exceptionBreakpoint(com.sun.jdi.ReferenceType exceptionClass,
groovy.lang.Closure c)
Short for exceptionBreakpoint(exceptionClass,null,c) , to get notified for both kinds of exceptions. |
com.sun.jdi.request.ExceptionRequest |
exceptionBreakpoint(com.sun.jdi.ReferenceType exceptionClass,
Collection modifiers,
groovy.lang.Closure body)
Same as #exceptionBreakpoint(String, Collection
except you specify the exception type by a remote reference of the type. |
com.sun.jdi.request.ExceptionRequest |
exceptionBreakpoint(String exceptionClass,
groovy.lang.Closure c)
Short for exceptionBreakpoint(exceptionClass,null,c) , to get notified for both kinds of exceptions. |
com.sun.jdi.request.ExceptionRequest |
exceptionBreakpoint(String className,
Collection modifiers,
groovy.lang.Closure c)
Sets a break point that hits upon an exception. |
void |
execute(File script)
Executes the specified YouDebug script. |
void |
execute(groovy.lang.GroovyCodeSource script)
Executes the specified YouDebug script. |
void |
execute(groovy.lang.GroovyCodeSource script,
Map variables)
Executes the given YouDebug script. |
void |
execute(InputStream script)
Executes the specified YouDebug script. |
void |
execute(URL script)
Executes the specified YouDebug script. |
com.sun.jdi.request.ClassPrepareRequest |
forEachClass(String className,
groovy.lang.Closure body)
Executes the given closure for each class of the given name. |
com.sun.jdi.event.Event |
getCurrentEvent()
Returns the current debugger event that we are dispatching. |
com.sun.jdi.ThreadReference |
getCurrentThread()
Returns the thread that raised the current event. |
static org.kohsuke.youdebug.Key |
getHANDLER()
|
groovy.lang.MetaClass |
getMetaClass()
|
Object |
getProperty(String name)
|
ThreadList |
getThreads()
Gets the list of all threads. |
com.sun.jdi.VirtualMachine |
getVirtualMachine()
Access to the underlying JDI VirtualMachine object. |
Object |
invokeMethod(String name,
Object args)
|
com.sun.jdi.ReferenceType |
loadClass(Class c)
|
com.sun.jdi.ReferenceType |
loadClass(String c)
Instead of just resolving an existing class, load the specified class in the target JVM and returns its reference. |
com.sun.jdi.request.MethodEntryRequest |
methodEntryBreakpoint(com.sun.jdi.ReferenceType type,
String methodName,
groovy.lang.Closure body)
|
com.sun.jdi.request.MethodEntryRequest |
methodEntryBreakpoint(String type,
String methodName,
groovy.lang.Closure body)
|
com.sun.jdi.request.MethodExitRequest |
methodExitBreakpoint(com.sun.jdi.ReferenceType type,
String methodName,
groovy.lang.Closure body)
|
com.sun.jdi.request.MethodExitRequest |
methodExitBreakpoint(String type,
String methodName,
groovy.lang.Closure body)
|
com.sun.jdi.request.AccessWatchpointRequest |
modificationWatchpoint(Class c,
String fieldName,
groovy.lang.Closure body)
Same as modificationWatchpoint(c.name,fieldName,body) |
com.sun.jdi.request.ModificationWatchpointRequest |
modificationWatchpoint(com.sun.jdi.Field f,
groovy.lang.Closure body)
Sets a breakpoint that fires when the specified field is updated. |
com.sun.jdi.request.AccessWatchpointRequest |
modificationWatchpoint(String className,
String fieldName,
groovy.lang.Closure body)
Sets a breakpoint that fires when the specified field of the specified class is updated. |
com.sun.jdi.ReferenceType |
ref(Class c)
Resolves the same class on the target JVM. |
com.sun.jdi.ReferenceType |
ref(String className)
Resolves a class by the name. |
void |
resume()
|
void |
setMetaClass(groovy.lang.MetaClass metaClass)
|
void |
setProperty(String name,
Object value)
|
void |
suspend()
|
void |
withFrozenWorld(groovy.lang.Closure c)
Executes the given closure by suspending the VM. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ExceptionBreakpointModifier CAUGHT
public static final ExceptionBreakpointModifier UNCAUGHT
Constructor Detail |
---|
public VM(com.sun.jdi.VirtualMachine vm)
Method Detail |
---|
public static final org.kohsuke.youdebug.Key getHANDLER()
public ThreadList getThreads()
public com.sun.jdi.VirtualMachine getVirtualMachine()
VirtualMachine
object.
Use this method when you want to go down to JDI.
public com.sun.jdi.ThreadReference getCurrentThread()
public com.sun.jdi.event.Event getCurrentEvent()
public void dispatchEvents() throws InterruptedException
InterruptedException
public com.sun.jdi.request.ClassPrepareRequest classPrepare(String name, groovy.lang.Closure body)
The closure will get the ReferenceType
object as a parameter, which represents
a newly loaded class.
classPrepare("org.acme.FooBar") { t -> ... }
public com.sun.jdi.request.ClassPrepareRequest classPrepare(Class clazz, groovy.lang.Closure c)
classPrepare(String, Closure)
except you specify the class by using
a reference to the class in this JVM.
public BundledBreakpointRequest breakpoint(String className, int line, groovy.lang.Closure body) throws com.sun.jdi.AbsentInformationException
com.sun.jdi.AbsentInformationException
public BundledBreakpointRequest breakpoint(Class className, int line, groovy.lang.Closure c) throws com.sun.jdi.AbsentInformationException
breakpoint(String, int, Closure)
except you specify the class by using
a reference to the class in this JVM.
com.sun.jdi.AbsentInformationException
public BundledBreakpointRequest breakpoint(com.sun.jdi.ReferenceType type, int line, groovy.lang.Closure body) throws com.sun.jdi.AbsentInformationException
breakpoint(String, int, Closure)
except you specify the class by using
a remote reference ReferenceType
.
com.sun.jdi.AbsentInformationException
public com.sun.jdi.request.ExceptionRequest exceptionBreakpoint(com.sun.jdi.ReferenceType exceptionClass, Collection modifiers, groovy.lang.Closure body)
#exceptionBreakpoint(String, Collection, Closure)
except you specify the exception type by a remote reference of the type.
public com.sun.jdi.request.ExceptionRequest exceptionBreakpoint(String className, Collection modifiers, groovy.lang.Closure c)
exceptionBreakpoint(className) { e -> // e references the exception that is thrown }
modifiers
- Optionally specify the kind of exceptions (caught or uncaught) that you want to catch.
If this is null or empty, both kinds of exceptions are caught.public com.sun.jdi.request.ExceptionRequest exceptionBreakpoint(Class exceptionClass, Collection modifiers, groovy.lang.Closure c)
#exceptionBreakpoint(String, Collection, Closure)
except you specify the exception type by a local class of the same name.
public com.sun.jdi.request.ExceptionRequest exceptionBreakpoint(Class exceptionClass, groovy.lang.Closure c)
exceptionBreakpoint(exceptionClass,null,c)
, to get notified for both kinds of exceptions.
public com.sun.jdi.request.ExceptionRequest exceptionBreakpoint(com.sun.jdi.ReferenceType exceptionClass, groovy.lang.Closure c)
exceptionBreakpoint(exceptionClass,null,c)
, to get notified for both kinds of exceptions.
public com.sun.jdi.request.ExceptionRequest exceptionBreakpoint(String exceptionClass, groovy.lang.Closure c)
exceptionBreakpoint(exceptionClass,null,c)
, to get notified for both kinds of exceptions.
public com.sun.jdi.request.MethodEntryRequest methodEntryBreakpoint(com.sun.jdi.ReferenceType type, String methodName, groovy.lang.Closure body)
public com.sun.jdi.request.MethodEntryRequest methodEntryBreakpoint(String type, String methodName, groovy.lang.Closure body)
public com.sun.jdi.request.MethodExitRequest methodExitBreakpoint(com.sun.jdi.ReferenceType type, String methodName, groovy.lang.Closure body)
public com.sun.jdi.request.MethodExitRequest methodExitBreakpoint(String type, String methodName, groovy.lang.Closure body)
public com.sun.jdi.request.AccessWatchpointRequest accessWatchpoint(com.sun.jdi.Field f, groovy.lang.Closure body)
public com.sun.jdi.request.AccessWatchpointRequest accessWatchpoint(String className, String fieldName, groovy.lang.Closure body)
public com.sun.jdi.request.AccessWatchpointRequest accessWatchpoint(Class c, String fieldName, groovy.lang.Closure body)
accessWatchpoint(c.name,fieldName,body)
public com.sun.jdi.request.ModificationWatchpointRequest modificationWatchpoint(com.sun.jdi.Field f, groovy.lang.Closure body)
public com.sun.jdi.request.AccessWatchpointRequest modificationWatchpoint(String className, String fieldName, groovy.lang.Closure body)
public com.sun.jdi.request.AccessWatchpointRequest modificationWatchpoint(Class c, String fieldName, groovy.lang.Closure body)
modificationWatchpoint(c.name,fieldName,body)
public com.sun.jdi.ReferenceType ref(String className)
public com.sun.jdi.ReferenceType ref(Class c)
public com.sun.jdi.ReferenceType _(Class c)
public com.sun.jdi.ReferenceType _(String c)
public Object _new(Class c, Object args)
public Object _new(String c, Object args)
public Object _new(com.sun.jdi.ReferenceType t, Object args)
public com.sun.jdi.ReferenceType loadClass(String c)
public com.sun.jdi.ReferenceType loadClass(Class c)
public com.sun.jdi.request.ClassPrepareRequest forEachClass(String className, groovy.lang.Closure body)
The closure gets a ReferenceType
object as a parameter.
It'll be invoked immediately for all the loaded class (of the given name),
and then whenever a new class of the given name is loaded, the closure will be re-invoked.
EventRequest
that can be used to cancel future invcocations.public void close()
close
in interface Closeable
public void execute(InputStream script) throws InterruptedException
InterruptedException
public void execute(File script) throws InterruptedException
InterruptedException
public void execute(URL script) throws InterruptedException
InterruptedException
public void execute(groovy.lang.GroovyCodeSource script) throws InterruptedException
InterruptedException
public void execute(groovy.lang.GroovyCodeSource script, Map variables) throws InterruptedException
script
- The script to execute.variables
- Additional variables to be exposed to the script. This is useful for passing information
between the script and the calling program.
InterruptedException
public void dumpAllThreads() throws com.sun.jdi.IncompatibleThreadStateException
dumpAllThreads(System.out)
com.sun.jdi.IncompatibleThreadStateException
public void dumpAllThreads(PrintStream out) throws com.sun.jdi.IncompatibleThreadStateException
com.sun.jdi.IncompatibleThreadStateException
public void dumpAllThreads(PrintWriter out) throws com.sun.jdi.IncompatibleThreadStateException
com.sun.jdi.IncompatibleThreadStateException
public void suspend()
public void resume()
public void withFrozenWorld(groovy.lang.Closure c)
public void dumpHeap(String path)
public static VM current()
VM
instance.
public groovy.lang.MetaClass getMetaClass()
getMetaClass
in interface groovy.lang.GroovyObject
public void setMetaClass(groovy.lang.MetaClass metaClass)
setMetaClass
in interface groovy.lang.GroovyObject
public Object invokeMethod(String name, Object args)
invokeMethod
in interface groovy.lang.GroovyObject
public Object getProperty(String name)
getProperty
in interface groovy.lang.GroovyObject
public void setProperty(String name, Object value)
setProperty
in interface groovy.lang.GroovyObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |