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