All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.tools.debug.RemoteDebugger

java.lang.Object
   |
   +----sun.tools.debug.RemoteDebugger

public class RemoteDebugger
extends Object
The RemoteDebugger class defines a client interface to the Java debugging classes. It is used to instantiate a connection with the Java interpreter being debugged.


Constructor Index

 o RemoteDebugger(String, DebuggerCallback, boolean)
Create a remote debugger.

 o RemoteDebugger(String, String, DebuggerCallback, boolean)
Create a remote debugger, connecting it with a running Java interpreter.

To connect to a running interpreter, it must be started with the "-debug" option, whereupon it will print out the password for that debugging session.

Method Index

 o addSystemThread()
Add the calling thread to the list of threads which aren't suspended by the RemoteDebugger.
 o addSystemThread(Thread)
Add the specified thread to the list of threads which aren't suspended by the RemoteDebugger.
 o close()
Close the connection to the remote debugging agent.
 o cont()
Continue an execution that has been suspended.
 o findClass(String)
Find a specified class.
 o freeMemory()
Report the free memory available to the Java interpreter being debugged.
 o gc(RemoteObject[])
Free all objects referenced by the debugger.
 o get(Integer)
Get an object from the remote object cache.
 o getExceptionCatchList()
Return the list of the exceptions the debugger will stop on.
 o getSourcePath()
Return the source file path the Agent is currently using.
 o itrace(boolean)
Turn on/off instruction tracing.
 o listBreakpoints()
Return a list of the breakpoints which are currently set.
 o listClasses()
List the currently known classes.
 o listThreadGroups(RemoteThreadGroup)
List threadgroups
 o run(int, String[])
Load and run a runnable Java class, with any optional parameters.
 o setSourcePath(String)
Specify the list of paths to use when searching for a source file.
 o totalMemory()
Report the total memory usage of the Java interpreter being debugged.
 o trace(boolean)
Turn on/off method call tracing.

Constructors

 o RemoteDebugger
 public RemoteDebugger(String host,
                       String password,
                       DebuggerCallback client,
                       boolean verbose) throws Exception
Create a remote debugger, connecting it with a running Java interpreter.

To connect to a running interpreter, it must be started with the "-debug" option, whereupon it will print out the password for that debugging session.

Parameters:
host - the name of the system where a debuggable Java instance is running (default is localhost).
password - the password reported by the debuggable Java instance. This should be null when starting a client interpreter.
client - the object to which notification messages are sent (it must support the DebuggerCallback interface)
verbose - turn on internal debugger message text
Throws: Exception
if a general exception occurs.
 o RemoteDebugger
 public RemoteDebugger(String javaArgs,
                       DebuggerCallback client,
                       boolean verbose) throws Exception
Create a remote debugger.

Parameters:
javaArgs - optional java command-line parameters, such as -classpath
client - the object to which notification messages are sent (it must support the DebuggerCallback interface)
verbose - turn on internal debugger message text
Throws: Exception
if a general exception occurs.

Methods

 o close
 public void close()
Close the connection to the remote debugging agent.

 o get
 public RemoteObject get(Integer id)
Get an object from the remote object cache.

Parameters:
id - the remote object's id
Returns:
the specified RemoteObject, or null if not cached.
 o listClasses
 public RemoteClass[] listClasses() throws Exception
List the currently known classes.

Throws: Exception
if a general exception occurs.
 o findClass
 public RemoteClass findClass(String name) throws Exception
Find a specified class. If the class isn't already known by the remote debugger, the lookup request will be passed to the Java interpreter being debugged. NOTE: Substrings, such as "String" for "java.lang.String" will return with the first match, and will not be successfully found if the request is passed to the remote interpreter.

Parameters:
name - the name (or a substring of the name)of the class
Returns:
the specified (Remote)Class, or null if not found.
Throws: Exception
if a general exception occurs.
 o listThreadGroups
 public RemoteThreadGroup[] listThreadGroups(RemoteThreadGroup tg) throws Exception
List threadgroups

Parameters:
tg - the threadgroup which hold the groups to be listed, or null for all threadgroups
Throws: Exception
if a general exception occurs.
 o cont
 public void cont() throws Exception
Continue an execution that has been suspended. Restarts all threads suspended by virtue of having encountered a breakpoint or step.

 o gc
 public void gc(RemoteObject save_list[]) throws Exception
Free all objects referenced by the debugger. The remote debugger maintains a copy of each object it has examined, so that references won't become invalidated by the garbage collector of the Java interpreter being debugged. The gc() method frees all all of these references, except those specified to save.

Parameters:
save_list - the list of objects to save.
Throws: Exception
if a general exception occurs.
 o trace
 public void trace(boolean traceOn) throws Exception
Turn on/off method call tracing. When turned on, each method call is reported to the stdout of the Java interpreter being debugged. This output is not captured in any way by the remote debugger.

Parameters:
traceOn - turn tracing on or off
Throws: Exception
if a general exception occurs.
 o itrace
 public void itrace(boolean traceOn) throws Exception
Turn on/off instruction tracing. When turned on, each Java instruction is reported to the stdout of the Java interpreter being debugged. This output is not captured in any way by the remote debugger.

Parameters:
traceOn - turn tracing on or off
Throws: Exception
if a general exception occurs.
 o totalMemory
 public int totalMemory() throws Exception
Report the total memory usage of the Java interpreter being debugged.

Throws: Exception
if a general exception occurs.
 o freeMemory
 public int freeMemory() throws Exception
Report the free memory available to the Java interpreter being debugged.

Throws: Exception
if a general exception occurs.
 o run
 public RemoteThreadGroup run(int argc,
                              String argv[]) throws Exception
Load and run a runnable Java class, with any optional parameters. The class is started inside a new threadgroup in the Java interpreter being debugged. NOTE: Although it is possible to run multiple runnable classes from the same Java interpreter, there is no guarantee that all applets will work cleanly with each other. For example, two applets may want exclusive access to the same shared resource,such as a specific port.

Parameters:
argc - the number of parameters
argv - the array of parameters: the class to be run is first, followed by any optional parameters used by that class.
Returns:
the new ThreadGroup the class is running in, or null on error
Throws: Exception
if a general exception occurs.
 o listBreakpoints
 public String[] listBreakpoints() throws Exception
Return a list of the breakpoints which are currently set.

Returns:
an array of Strings of the form "class_name:line_number".
Throws: Exception
if a general exception occurs.
 o getExceptionCatchList
 public String[] getExceptionCatchList() throws Exception
Return the list of the exceptions the debugger will stop on.

Returns:
an array of exception class names, which may be zero-length.
Throws: Exception
if a general exception occurs.
 o getSourcePath
 public String getSourcePath() throws Exception
Return the source file path the Agent is currently using.

Returns:
a string consisting of a list of colon-delineated paths.
Throws: Exception
if a general exception occurs.
 o setSourcePath
 public void setSourcePath(String pathList) throws Exception
Specify the list of paths to use when searching for a source file.

Parameters:
pathList - a string consisting of a list of colon-delineated paths.
Throws: Exception
if a general exception occurs.
 o addSystemThread
 public void addSystemThread()
Add the calling thread to the list of threads which aren't suspended by the RemoteDebugger. Typically these are only threads used by a debugger client. The thread which created the RemoteDebugger instance is automatically added, as is the AgentIn and other debugger-specific threads.

 o addSystemThread
 public void addSystemThread(Thread t)
Add the specified thread to the list of threads which aren't suspended by the RemoteDebugger. Typically these are only threads used by a debugger client. The thread which created the RemoteDebugger instance is automatically added, as is the AgentIn and other debugger-specific threads.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature