Interface IJavaDebugTarget
-
- All Superinterfaces:
IAdaptable,IBreakpointListener,IDebugElement,IDebugTarget,IDisconnect,IMemoryBlockRetrieval,IStepFilters,ISuspendResume,ITerminate
public interface IJavaDebugTarget extends IDebugTarget, IStepFilters
A Java virtual machine.- See Also:
IDebugTarget,IAdaptable- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)Adds the given listener to this target for hot code replace notifications.IJavaVariablefindVariable(String variableName)Searches for and returns a variable with the given name, ornullif unable to resolve a variable with the name.IJavaThreadGroup[]getAllThreadGroups()Returns all thread groups in this target.StringgetDefaultStratum()Return the default stratum used in this the target, ornullto indicate a per-class default stratum.IJavaType[]getJavaTypes(String name)Returns the types loaded in this debug target with the given fully qualified name, ornullof no type with the given name is loaded.intgetRequestTimeout()Returns the timeout value for JDI requests in milliseconds, or -1 if not supported.IJavaThreadGroup[]getRootThreadGroups()Returns the top level thread groups in this target.String[]getStepFilters()Returns the list of active step filters in this target.StringgetVersion()Returns the version of the underlying virtual machine as defined by the system propertyjava.version.StringgetVMName()Returns the name of the underlying virtual machine as defined by the system propertyjava.vm.name.booleanisFilterConstructors()Returns whether constructors are filtered when stepping, if step filters are enabled.booleanisFilterGetters()Returns whether simple getters are filtered when stepping.booleanisFilterSetters()Returns whether simple setters are filtered when stepping.booleanisFilterStaticInitializers()Returns whether static initializers are filtered when stepping, if step filters are enabled.booleanisFilterSynthetics()Returns whether synthetic methods are filtered when stepping, if step filters are enabled.booleanisOutOfSynch()Returns whether any of the threads associated with this debug target are running code in the VM that is out of synch with the code in the workspace.booleanisPerformingHotCodeReplace()Returns whether this target is currently performing a hot code replace.booleanisStepThruFilters()Returns whether a step that lands in a filtered location should proceed through to an un-filtered location or return to the location where a step originated.booleanmayBeOutOfSynch()Returns whether any of the threads associated with this debug target may be running code in the VM that is out of synch with the code in the workspace.IJavaValuenewValue(boolean value)Returns a value from this target that corresponds to the given boolean.IJavaValuenewValue(byte value)Returns a value from this target that corresponds to the given byte.IJavaValuenewValue(char value)Returns a value from this target that corresponds to the given char.IJavaValuenewValue(double value)Returns a value from this target that corresponds to the given double.IJavaValuenewValue(float value)Returns a value from this target that corresponds to the given float.IJavaValuenewValue(int value)Returns a value from this target that corresponds to the given int.IJavaValuenewValue(long value)Returns a value from this target that corresponds to the given long.IJavaValuenewValue(short value)Returns a value from this target that corresponds to the given short.IJavaValuenewValue(String value)Returns a value from this target that corresponds to the given string.IJavaValuenullValue()Returns a value from this target that corresponds tonull.voidrefreshState()Refreshes the state of the Java debug model elements (client) with the current state of the debug target.voidremoveHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)Removes the given listener from this target.byte[]sendCommand(byte commandSet, byte commandId, byte[] data)Sends a JDWP command to the back end and returns the JDWP reply packet as bytes.voidsetDefaultStratum(String stratum)Set the default stratum used in this debug target.voidsetFilterConstructors(boolean filter)Sets whether to filter constructors when stepping.voidsetFilterGetters(boolean filter)Sets whether simple getters are filtered when stepping.voidsetFilterSetters(boolean filter)Sets whether simple setters are filtered when stepping.voidsetFilterStaticInitializers(boolean filter)Sets whether to filter static initializers when stepping.voidsetFilterSynthetics(boolean filter)Sets whether synthetic methods are filtered when stepping.voidsetRequestTimeout(int timeout)Sets the timeout value for JDI requests in milliseconds.voidsetStepFilters(String[] list)Sets the list of active step filters in this target.voidsetStepThruFilters(boolean thru)Sets whether a step that lands in a filtered location should continue through to an un-filtered location, or return to where the step originated.booleansupportsAccessWatchpoints()Returns whether this target supports access watchpoints.booleansupportsForceReturn()Returns whether this VM supports the ability to force an early return from methods.booleansupportsHotCodeReplace()Returns whether this target supports hot code replace.booleansupportsInstanceBreakpoints()Returns whether this target supports instance breakpoints.booleansupportsInstanceRetrieval()Returns whether this VM supports instance and reference retrieval for types and objects.booleansupportsModificationWatchpoints()Returns whether this target supports modification watchpoints.booleansupportsMonitorInformation()Returns whether this target supports providing monitor information.booleansupportsRequestTimeout()Returns whether this debug target supports a request timeout - a maximum time for a JDI request to receive a response.booleansupportsSelectiveGarbageCollection()Returns whether this VM supports the ability to enable and disable garbage collection of individual objects.IJavaValuevoidValue()Returns a value from this target that corresponds tovoid.-
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Methods inherited from interface org.eclipse.debug.core.IBreakpointListener
breakpointAdded, breakpointChanged, breakpointRemoved
-
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
-
Methods inherited from interface org.eclipse.debug.core.model.IDebugTarget
getName, getProcess, getThreads, hasThreads, supportsBreakpoint
-
Methods inherited from interface org.eclipse.debug.core.model.IDisconnect
canDisconnect, disconnect, isDisconnected
-
Methods inherited from interface org.eclipse.debug.core.model.IMemoryBlockRetrieval
getMemoryBlock, supportsStorageRetrieval
-
Methods inherited from interface org.eclipse.debug.core.model.IStepFilters
isStepFiltersEnabled, setStepFiltersEnabled, supportsStepFilters
-
Methods inherited from interface org.eclipse.debug.core.model.ISuspendResume
canResume, canSuspend, isSuspended, resume, suspend
-
Methods inherited from interface org.eclipse.debug.core.model.ITerminate
canTerminate, isTerminated, terminate
-
-
-
-
Method Detail
-
findVariable
IJavaVariable findVariable(String variableName) throws DebugException
Searches for and returns a variable with the given name, ornullif unable to resolve a variable with the name.Variable lookup works only when a debug target has one or more threads suspended. Lookup is performed in each suspended thread, returning the first successful match, or
nullif no match if found. If this debug target has no suspended threads,nullis returned.- Parameters:
variableName- name of the variable- Returns:
- a variable with the given name, or
nullif none - Throws:
DebugException- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
-
getJavaTypes
IJavaType[] getJavaTypes(String name) throws DebugException
Returns the types loaded in this debug target with the given fully qualified name, ornullof no type with the given name is loaded.- Parameters:
name- fully qualified name of type, for examplejava.lang.String- Returns:
- the types with the given name, or
null - Throws:
DebugException- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
-
newValue
IJavaValue newValue(boolean value)
Returns a value from this target that corresponds to the given boolean. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a boolean from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(byte value)
Returns a value from this target that corresponds to the given byte. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a byte from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(char value)
Returns a value from this target that corresponds to the given char. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a char from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(double value)
Returns a value from this target that corresponds to the given double. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a double from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(float value)
Returns a value from this target that corresponds to the given float. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a float from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(int value)
Returns a value from this target that corresponds to the given int. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- an int from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(long value)
Returns a value from this target that corresponds to the given long. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a long from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(short value)
Returns a value from this target that corresponds to the given short. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a short from which to create a value- Returns:
- a corresponding value from this target
-
newValue
IJavaValue newValue(String value)
Returns a value from this target that corresponds to the given string. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Parameters:
value- a string from which to create a value- Returns:
- a corresponding value from this target
-
nullValue
IJavaValue nullValue()
Returns a value from this target that corresponds tonull. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Returns:
- a value corresponding to
null
-
voidValue
IJavaValue voidValue()
Returns a value from this target that corresponds tovoid. The returned value can be used for setting and comparing against a value retrieved from this debug target.- Returns:
- a value corresponding to
void
-
isOutOfSynch
boolean isOutOfSynch() throws DebugExceptionReturns whether any of the threads associated with this debug target are running code in the VM that is out of synch with the code in the workspace.- Returns:
- whether this debug target is out of synch with the workspace.
- Throws:
DebugException- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
-
mayBeOutOfSynch
boolean mayBeOutOfSynch() throws DebugExceptionReturns whether any of the threads associated with this debug target may be running code in the VM that is out of synch with the code in the workspace.- Returns:
- whether this debug target may be out of synch with the workspace.
- Throws:
DebugException- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
-
supportsHotCodeReplace
boolean supportsHotCodeReplace()
Returns whether this target supports hot code replace.- Returns:
- whether this target supports hot code replace
-
isPerformingHotCodeReplace
boolean isPerformingHotCodeReplace()
Returns whether this target is currently performing a hot code replace.- Returns:
- whether this target is currently performing a hot code replace
- Since:
- 2.1
-
supportsInstanceBreakpoints
boolean supportsInstanceBreakpoints()
Returns whether this target supports instance breakpoints.- Returns:
- whether this target supports instance breakpoints
- Since:
- 2.1
-
isFilterSynthetics
boolean isFilterSynthetics()
Returns whether synthetic methods are filtered when stepping, if step filters are enabled.- Returns:
- whether synthetic methods are filtered when stepping
-
setFilterSynthetics
void setFilterSynthetics(boolean filter)
Sets whether synthetic methods are filtered when stepping.- Parameters:
filter- whether to synthetic methods are filtered when stepping
-
isFilterGetters
boolean isFilterGetters()
Returns whether simple getters are filtered when stepping.- Returns:
- true, if simple getters should be filtered when stepping
- Since:
- 3.7
-
setFilterGetters
void setFilterGetters(boolean filter)
Sets whether simple getters are filtered when stepping.- Parameters:
filter- whether to filter simple getters when stepping- Since:
- 3.7
-
isFilterSetters
boolean isFilterSetters()
Returns whether simple setters are filtered when stepping.- Returns:
- true, if simple setters should be filtered when stepping
- Since:
- 3.7
-
setFilterSetters
void setFilterSetters(boolean filter)
Sets whether simple setters are filtered when stepping.- Parameters:
filter- whether to filter simple setters when stepping- Since:
- 3.7
-
isFilterStaticInitializers
boolean isFilterStaticInitializers()
Returns whether static initializers are filtered when stepping, if step filters are enabled.- Returns:
- whether static initializers are filtered when stepping
-
setFilterStaticInitializers
void setFilterStaticInitializers(boolean filter)
Sets whether to filter static initializers when stepping.- Parameters:
filter- whether to filter static initializers when stepping
-
isFilterConstructors
boolean isFilterConstructors()
Returns whether constructors are filtered when stepping, if step filters are enabled.- Returns:
- whether constructors are filtered when stepping
-
setFilterConstructors
void setFilterConstructors(boolean filter)
Sets whether to filter constructors when stepping.- Parameters:
filter- whether to filter constructors when stepping
-
getStepFilters
String[] getStepFilters()
Returns the list of active step filters in this target. The list is a collection of Strings. Each string is the fully qualified name/pattern of a type/package to filter when stepping. For examplejava.lang.*orjava.lang.String.- Returns:
- the list of active step filters, or
null
-
setStepFilters
void setStepFilters(String[] list)
Sets the list of active step filters in this target. The list is a collection of Strings. Each string is the fully qualified name/pattern of a type/package to filter when stepping. For examplejava.lang.*orjava.lang.String.- Parameters:
list- active step filters, ornull
-
setStepThruFilters
void setStepThruFilters(boolean thru)
Sets whether a step that lands in a filtered location should continue through to an un-filtered location, or return to where the step originated.- Parameters:
thru- whether to step thru a filtered location or return to location where step originated- Since:
- 3.5
-
isStepThruFilters
boolean isStepThruFilters()
Returns whether a step that lands in a filtered location should proceed through to an un-filtered location or return to the location where a step originated.- Returns:
- whether a step that lands in a filtered location should proceed through to an un-filtered location or return to the location where a step originated
- Since:
- 3.5
-
supportsRequestTimeout
boolean supportsRequestTimeout()
Returns whether this debug target supports a request timeout - a maximum time for a JDI request to receive a response. This option is only supported by the Eclipse JDI implementation.- Returns:
- whether this debug target supports a request timeout
-
setRequestTimeout
void setRequestTimeout(int timeout)
Sets the timeout value for JDI requests in milliseconds. Has no effect if this target does not support a request timeout.- Parameters:
timeout- the communication timeout, in milliseconds
-
getRequestTimeout
int getRequestTimeout()
Returns the timeout value for JDI requests in milliseconds, or -1 if not supported.- Returns:
- timeout value, in milliseconds, or -1 if not supported
-
supportsMonitorInformation
boolean supportsMonitorInformation()
Returns whether this target supports providing monitor information.- Returns:
- whether this target supports providing monitor information.
- Since:
- 2.1
-
supportsAccessWatchpoints
boolean supportsAccessWatchpoints()
Returns whether this target supports access watchpoints.- Returns:
- whether this target supports access watchpoints
- Since:
- 3.0
-
supportsModificationWatchpoints
boolean supportsModificationWatchpoints()
Returns whether this target supports modification watchpoints.- Returns:
- whether this target supports modification watchpoints
- Since:
- 3.0
-
setDefaultStratum
void setDefaultStratum(String stratum)
Set the default stratum used in this debug target.- Parameters:
stratum- the new default stratum, ornullto indicate per-class default stratum- Since:
- 3.0
-
getDefaultStratum
String getDefaultStratum()
Return the default stratum used in this the target, ornullto indicate a per-class default stratum.- Returns:
- the default stratum, or
nullto indicate a per-class default stratum - Since:
- 3.0
- See Also:
setDefaultStratum(String)
-
getRootThreadGroups
IJavaThreadGroup[] getRootThreadGroups() throws DebugException
Returns the top level thread groups in this target. Top level thread groups do not have a parent.- Returns:
- top level thread groups
- Throws:
DebugException- if an exception occurs- Since:
- 3.2
-
getAllThreadGroups
IJavaThreadGroup[] getAllThreadGroups() throws DebugException
Returns all thread groups in this target.- Returns:
- all thread groups in this target
- Throws:
DebugException- if an exception occurs- Since:
- 3.2
-
supportsInstanceRetrieval
boolean supportsInstanceRetrieval()
Returns whether this VM supports instance and reference retrieval for types and objects.- Returns:
- whether this VM supports instance and reference retrieval for types and objects
- Since:
- 3.3
-
supportsForceReturn
boolean supportsForceReturn()
Returns whether this VM supports the ability to force an early return from methods.- Returns:
- whether this VM can force an early return from methods
- Since:
- 3.3
- See Also:
IJavaThread
-
supportsSelectiveGarbageCollection
boolean supportsSelectiveGarbageCollection()
Returns whether this VM supports the ability to enable and disable garbage collection of individual objects.- Returns:
- whether this VM supports the ability to enable and disable garbage collection of individual objects
- Since:
- 3.4
- See Also:
IJavaObject
-
getVMName
String getVMName() throws DebugException
Returns the name of the underlying virtual machine as defined by the system propertyjava.vm.name.- Returns:
- virtual machine name
- Throws:
DebugException- if retrieving the name fails- Since:
- 3.4
-
getVersion
String getVersion() throws DebugException
Returns the version of the underlying virtual machine as defined by the system propertyjava.version.- Returns:
java.versionsystem property- Throws:
DebugException- if retrieving the version property fails- Since:
- 3.4
-
refreshState
void refreshState() throws DebugExceptionRefreshes the state of the Java debug model elements (client) with the current state of the debug target.For example, a
IJavaThreadmay currently have a suspended state, but was somehow resumed on the target. Calling this method will causes all threads to update their state based on the current state of the target. Elements will fire debug events associated with any state changes. For example, a thread would fire a resume event if it discovered it was in a running state when it thought it was suspended.- Throws:
DebugException- if an exception occurs- Since:
- 3.6
-
sendCommand
byte[] sendCommand(byte commandSet, byte commandId, byte[] data) throws DebugExceptionSends a JDWP command to the back end and returns the JDWP reply packet as bytes. This method creates an appropriate command header and packet id, before sending to the back end.- Parameters:
commandSet- command set identifier as defined by JDWPcommandId- command identifier as defined by JDWPdata- any bytes required for the command that follow the command header ornullfor commands that have no data- Returns:
- raw reply packet as bytes defined by JDWP
- Throws:
DebugException- if an error occurs sending the packet or receiving the reply- Since:
- 3.6
-
addHotCodeReplaceListener
void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)
Adds the given listener to this target for hot code replace notifications. Has no effect if an identical listener is already registered.When a hot code replace listener is added to a specific target, general hot code replace notifications via
JDIDebugModelare not reported for that target. This allows a target to override general/default hot code replace listeners/handlers.- Parameters:
listener- hot code replace listener- Since:
- 3.6
-
removeHotCodeReplaceListener
void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)
Removes the given listener from this target. Has no effect if an identical listener is not already registered.- Parameters:
listener- hot code replace listener- Since:
- 3.6
-
-