Package org.eclipse.jdt.debug.core
Class JDIDebugModel
java.lang.Object
org.eclipse.jdt.debug.core.JDIDebugModel
Provides utility methods for creating debug targets and breakpoints specific
to the JDI debug model.
To provide access to behavior and information specific to the JDI debug
model, a set of interfaces are defined which extend the base set of debug
element interfaces. For example, IJavaStackFrame
is declared to
extend IStackFrame
, and provides methods specific to this debug
model. The specialized interfaces are also available as adapters from the
debug elements generated from this model.
This class provides static utility methods only.
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default JDI request timeout when no preference is set.static final int
The default value forPREF_SHOW_STEP_TIMEOUT
timeout when no preference is set.static final String
Launch attribute, use ILaunch.setAttribute to set it to "true", to disable hot code replace for an individual launch.static final String
Boolean preference controlling whether to not install (filter) breakpoints for types existing multiple times in source projects and not related to the current debug session.static final String
Preference key for specifying if hot code replace should be performed when a replacement class file contains compilation errors.static final String
Preference key for default JDI request timeout value.static final String
Preference key for specifying if the value returned or thrown should be displayed as variable after a "step return" or "step over" (if supported by the vm)static final String
Preference key for specifying if PREF_SHOW_STEP_RESULT is respected for remote debugging.static final String
Preference key for specifying if the timeout (in ms) after which the return method result of a step operation is not observed any longer (0 means no timeout, a negative value means: simulate a timeout condition).static final String
Boolean preference controlling whether breakpoints are hit during an evaluation operation.static final String
The preference key for the behavior of exception breakpoint hits recurring for the same exception instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Registers the given listener for hot code replace notifications.static void
Registers the given listener for breakpoint notifications.static IJavaClassPrepareBreakpoint
createClassPrepareBreakpoint
(org.eclipse.core.resources.IResource resource, String typeName, int memberType, int charStart, int charEnd, boolean register, Map<String, Object> attributes) Creates and returns a class prepare breakpoint for a type with the given name.static IJavaExceptionBreakpoint
createExceptionBreakpoint
(org.eclipse.core.resources.IResource resource, String exceptionName, boolean caught, boolean uncaught, boolean checked, boolean register, Map<String, Object> attributes) Creates and returns an exception breakpoint for an exception with the given name.static IJavaLineBreakpoint
createLineBreakpoint
(org.eclipse.core.resources.IResource resource, String typeName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Creates and returns a line breakpoint in the type with the given name, at the given line number.static IJavaMethodBreakpoint
createMethodBreakpoint
(org.eclipse.core.resources.IResource resource, String typePattern, String methodName, String methodSignature, boolean entry, boolean exit, boolean nativeOnly, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Creates and returns a method breakpoint with the specified criteria.static IJavaMethodEntryBreakpoint
createMethodEntryBreakpoint
(org.eclipse.core.resources.IResource resource, String typeName, String methodName, String methodSignature, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Creates and returns a method entry breakpoint with the specified criteria.static IJavaPatternBreakpoint
createPatternBreakpoint
(org.eclipse.core.resources.IResource resource, String sourceName, String pattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Deprecated.static IJavaStratumLineBreakpoint
createStratumBreakpoint
(org.eclipse.core.resources.IResource resource, String stratum, String sourceName, String sourcePath, String classNamePattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Creates and returns a line breakpoint identified by its source file name and/or path, and stratum that it is relative to.static IJavaTargetPatternBreakpoint
createTargetPatternBreakpoint
(org.eclipse.core.resources.IResource resource, String sourceName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Creates and returns a target pattern breakpoint for the given resource at the given line number.static IJavaWatchpoint
createWatchpoint
(org.eclipse.core.resources.IResource resource, String typeName, String fieldName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) Creates and returns a watchpoint on a field with the given name in a type with the given name.static String
Returns the identifier for the JDI debug model plug-instatic org.eclipse.core.runtime.Preferences
Deprecated.thePreferences
class has been deprecated, use theIEclipsePreferences
accessors insteadstatic IJavaLineBreakpoint
lineBreakpointExists
(String typeName, int lineNumber) Returns a Java line breakpoint that is already registered with the breakpoint manager for a type with the given name at the given line number.static IJavaLineBreakpoint
lineBreakpointExists
(org.eclipse.core.resources.IResource resource, String typeName, int lineNumber) Returns a Java line breakpoint that is already registered with the breakpoint manager for a type with the given name at the given line number in the given resource.static org.eclipse.debug.core.model.IDebugTarget
newDebugTarget
(org.eclipse.debug.core.ILaunch launch, VirtualMachine vm, String name, org.eclipse.debug.core.model.IProcess process, boolean allowTerminate, boolean allowDisconnect) Creates and returns a debug target for the given VM, with the specified name, and associates the debug target with the given process for console I/O.static org.eclipse.debug.core.model.IDebugTarget
newDebugTarget
(org.eclipse.debug.core.ILaunch launch, VirtualMachine vm, String name, org.eclipse.debug.core.model.IProcess process, boolean allowTerminate, boolean allowDisconnect, boolean resume) Creates and returns a debug target for the given VM, with the specified name, and associates the debug target with the given process for console I/O.static void
Unregisters the given listener for hot code replace notifications.static void
Unregisters the given listener for breakpoint notifications.static void
Deprecated.thePreferences
class has been deprecated, use theIEclipsePreferences
accessors instead
-
Field Details
-
PREF_REQUEST_TIMEOUT
Preference key for default JDI request timeout value. -
PREF_HCR_WITH_COMPILATION_ERRORS
Preference key for specifying if hot code replace should be performed when a replacement class file contains compilation errors. -
DEF_REQUEST_TIMEOUT
public static final int DEF_REQUEST_TIMEOUTThe default JDI request timeout when no preference is set.- See Also:
-
PREF_SUSPEND_FOR_BREAKPOINTS_DURING_EVALUATION
Boolean preference controlling whether breakpoints are hit during an evaluation operation. If true, breakpoints will be hit as usual during evaluations. If false, the breakpoint manager will be automatically disabled during evaluations.- Since:
- 3.0
-
PREF_FILTER_BREAKPOINTS_FROM_UNRELATED_SOURCES
Boolean preference controlling whether to not install (filter) breakpoints for types existing multiple times in source projects and not related to the current debug session.- Since:
- 3.10
-
PREF_SHOW_STEP_RESULT
Preference key for specifying if the value returned or thrown should be displayed as variable after a "step return" or "step over" (if supported by the vm)- Since:
- 3.11
-
PREF_SHOW_STEP_RESULT_REMOTE
Preference key for specifying if PREF_SHOW_STEP_RESULT is respected for remote debugging.- Since:
- 3.15
-
PREF_SHOW_STEP_TIMEOUT
Preference key for specifying if the timeout (in ms) after which the return method result of a step operation is not observed any longer (0 means no timeout, a negative value means: simulate a timeout condition).- Since:
- 3.12
-
DEF_SHOW_STEP_TIMEOUT
public static final int DEF_SHOW_STEP_TIMEOUTThe default value forPREF_SHOW_STEP_TIMEOUT
timeout when no preference is set.- Since:
- 3.12
- See Also:
-
PREF_SUSPEND_ON_RECURRENCE_STRATEGY
The preference key for the behavior of exception breakpoint hits recurring for the same exception instance.- Since:
- 3.14
- See Also:
-
DISABLE_HCR_LAUNCH_ATTRIBUTE
Launch attribute, use ILaunch.setAttribute to set it to "true", to disable hot code replace for an individual launch.- Since:
- 3.17
-
-
Method Details
-
newDebugTarget
public static org.eclipse.debug.core.model.IDebugTarget newDebugTarget(org.eclipse.debug.core.ILaunch launch, VirtualMachine vm, String name, org.eclipse.debug.core.model.IProcess process, boolean allowTerminate, boolean allowDisconnect) Creates and returns a debug target for the given VM, with the specified name, and associates the debug target with the given process for console I/O. The allow terminate flag specifies whether the debug target will support termination (ITerminate
). The allow disconnect flag specifies whether the debug target will support disconnection (IDisconnect
). Launching the actual VM is a client responsibility. By default, the target VM will be resumed on startup. The debug target is added to the given launch.- Parameters:
launch
- the launch the new debug target will be contained invm
- the VM to create a debug target forname
- the name to associate with the VM, which will be returned fromIDebugTarget.getName
. Ifnull
the name will be retrieved from the underlying VM.process
- the process to associate with the debug target, which will be returned fromIDebugTarget.getProcess
allowTerminate
- whether the target will support terminationallowDisconnect
- whether the target will support disconnection- Returns:
- a debug target
- Since:
- 2.0
- See Also:
-
ITerminate
IDisconnect
-
newDebugTarget
public static org.eclipse.debug.core.model.IDebugTarget newDebugTarget(org.eclipse.debug.core.ILaunch launch, VirtualMachine vm, String name, org.eclipse.debug.core.model.IProcess process, boolean allowTerminate, boolean allowDisconnect, boolean resume) Creates and returns a debug target for the given VM, with the specified name, and associates the debug target with the given process for console I/O. The allow terminate flag specifies whether the debug target will support termination (ITerminate
). The allow disconnect flag specifies whether the debug target will support disconnection (IDisconnect
). The resume flag specifies if the target VM should be resumed on startup (has no effect if the VM was already running when the connection to the VM was established). Launching the actual VM is a client responsibility. The debug target is added to the given launch.- Parameters:
launch
- the launch the new debug target will be contained invm
- the VM to create a debug target forname
- the name to associate with the VM, which will be returned fromIDebugTarget.getName
. Ifnull
the name will be retrieved from the underlying VM.process
- the process to associate with the debug target, which will be returned fromIDebugTarget.getProcess
allowTerminate
- whether the target will support terminationallowDisconnect
- whether the target will support disconnectionresume
- whether the target is to be resumed on startup. Has no effect if the target was already running when the connection to the VM was established.- Returns:
- a debug target
- Since:
- 2.0
- See Also:
-
ITerminate
IDisconnect
-
getPluginIdentifier
Returns the identifier for the JDI debug model plug-in- Returns:
- plug-in identifier
-
addHotCodeReplaceListener
Registers the given listener for hot code replace notifications. Has no effect if an identical listener is already registered.Note that since 3.6, if an
IJavaDebugTarget
has hot code replace listeners registered with it directly, listeners registered with this class are not notified of hot code replace events for that target. This allows a target to have custom hot code replace notification behavior.- Parameters:
listener
- hot code replace listener- Since:
- 2.0
- See Also:
-
removeHotCodeReplaceListener
Unregisters the given listener for hot code replace notifications. Has no effect if an identical listener is not already registered.- Parameters:
listener
- hot code replace listener- Since:
- 2.0
- See Also:
-
addJavaBreakpointListener
Registers the given listener for breakpoint notifications. Has no effect if an identical listener is already registered.- Parameters:
listener
- breakpoint listener- Since:
- 2.0
- See Also:
-
removeJavaBreakpointListener
Unregisters the given listener for breakpoint notifications. Has no effect if an identical listener is not already registered.- Parameters:
listener
- breakpoint listener- Since:
- 2.0
- See Also:
-
createLineBreakpoint
public static IJavaLineBreakpoint createLineBreakpoint(org.eclipse.core.resources.IResource resource, String typeName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a line breakpoint in the type with the given name, at the given line number. The marker associated with the breakpoint will be created on the specified resource. If a character range within the line is known, it may be specified by charStart/charEnd. If hitCount is > 0, the breakpoint will suspend execution when it is "hit" the specified number of times.- Parameters:
resource
- the resource on which to create the associated breakpoint markertypeName
- the fully qualified name of the type the breakpoint is to be installed in. If the breakpoint is to be installed in an inner type, it is sufficient to provide the name of the top level enclosing type. If an inner class name is specified, it should be formatted as the associated class file name (i.e. with$
). For example,example.SomeClass$InnerType
, could be specified, butexample.SomeClass
is sufficient.lineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a line breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
- Since:
- 2.0
-
createPatternBreakpoint
@Deprecated public static IJavaPatternBreakpoint createPatternBreakpoint(org.eclipse.core.resources.IResource resource, String sourceName, String pattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionDeprecated.usecreateStratumBreakpoint
insteadCreates and returns a pattern breakpoint for the given resource at the given line number, which is installed in all classes whose fully qualified name matches the given pattern. If hitCount > 0, the breakpoint will suspend execution when it is "hit" the specified number of times.- Parameters:
resource
- the resource on which to create the associated breakpoint markersourceName
- the name of the source file in which the breakpoint is set, ornull
. When specified, the pattern breakpoint will install itself in classes that have a source file name debug attribute that matches this value, and satisfies the class name pattern.pattern
- the class name pattern in which the pattern breakpoint should be installed. The pattern breakpoint will install itself in every class which matches the pattern.lineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a pattern breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
-
createStratumBreakpoint
public static IJavaStratumLineBreakpoint createStratumBreakpoint(org.eclipse.core.resources.IResource resource, String stratum, String sourceName, String sourcePath, String classNamePattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a line breakpoint identified by its source file name and/or path, and stratum that it is relative to.- Parameters:
resource
- the resource on which to create the associated breakpoint markerstratum
- the stratum in which the source name, source path and line number are relative, ornull
. Ifnull
or if the specified stratum is not defined for a type, the source name, source path and line number are relative to the type's default stratum.sourceName
- the simple name of the source file in which the breakpoint is set, ornull
. The breakpoint will install itself in classes that have a source file name debug attribute that matches this value in the specified stratum, and satisfies the class name pattern and source path attribute. Whennull
, the source file name debug attribute is not considered.sourcePath
- the qualified source file name in which the breakpoint is set, ornull
. The breakpoint will install itself in classes that have a source file path in the specified stratum that matches this value, and satisfies the class name pattern and source name attribute. Whennull
, the source path attribute is not considered.classNamePattern
- the class name pattern to which the breakpoint should be restricted, ornull
. The breakpoint will install itself in each type that matches this class name pattern, with a satisfying source name and source path. Patterns may begin or end with '*', which matches 0 or more characters. A pattern that does not contain a '*' is equivalent to a pattern ending in '*'. Specifyingnull
, or an empty string is the equivalent to "*". Multiple patterns can be specified by delimiting the patterns with a comma - e.g. "x.y.z,a.b.c". When multiple patterns are specified, The breakpoint will install itself in each of the types that match any of the specified class pattern, with a satisfying source name and source path.lineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file (stratum) in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a stratum breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
- Since:
- 3.0
-
createTargetPatternBreakpoint
public static IJavaTargetPatternBreakpoint createTargetPatternBreakpoint(org.eclipse.core.resources.IResource resource, String sourceName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a target pattern breakpoint for the given resource at the given line number. Clients must set the class name pattern per target for this type of breakpoint. If hitCount > 0, the breakpoint will suspend execution when it is "hit" the specified number of times.- Parameters:
resource
- the resource on which to create the associated breakpoint markersourceName
- the name of the source file in which the breakpoint is set, ornull
. When specified, the pattern breakpoint will install itself in classes that have a source file name debug attribute that matches this value, and satisfies the class name pattern.lineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a target pattern breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
-
createExceptionBreakpoint
public static IJavaExceptionBreakpoint createExceptionBreakpoint(org.eclipse.core.resources.IResource resource, String exceptionName, boolean caught, boolean uncaught, boolean checked, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns an exception breakpoint for an exception with the given name. The marker associated with the breakpoint will be created on the specified resource. Caught and uncaught specify where the exception should cause thread suspensions - that is, in caught and/or uncaught locations. Checked indicates if the given exception is a checked exception.- Parameters:
resource
- the resource on which to create the associated breakpoint markerexceptionName
- the fully qualified name of the exception for which to create the breakpointcaught
- whether to suspend in caught locationsuncaught
- whether to suspend in uncaught locationschecked
- whether the exception is a checked exception (i.e. compiler detected)register
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation ornull
if none.- Returns:
- an exception breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
- Since:
- 2.0
-
createWatchpoint
public static IJavaWatchpoint createWatchpoint(org.eclipse.core.resources.IResource resource, String typeName, String fieldName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a watchpoint on a field with the given name in a type with the given name. The marker associated with the breakpoint will be created on the specified resource. If hitCount > 0, the breakpoint will suspend execution when it is "hit" the specified number of times.- Parameters:
resource
- the resource on which to create the associated breakpoint markertypeName
- the fully qualified name of the type the breakpoint is to be installed in. If the breakpoint is to be installed in an inner type, it is sufficient to provide the name of the top level enclosing type. If an inner class name is specified, it should be formatted as the associated class file name (i.e. with$
). For example,example.SomeClass$InnerType
, could be specified, butexample.SomeClass
is sufficient.fieldName
- the name of the field on which to suspend (on access or modification)lineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a watchpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The CoreException's status contains the underlying exception responsible for the failure.
- Since:
- 2.0
-
createMethodBreakpoint
public static IJavaMethodBreakpoint createMethodBreakpoint(org.eclipse.core.resources.IResource resource, String typePattern, String methodName, String methodSignature, boolean entry, boolean exit, boolean nativeOnly, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a method breakpoint with the specified criteria.- Parameters:
resource
- the resource on which to create the associated breakpoint markertypePattern
- the pattern specifying the fully qualified name of type(s) this breakpoint suspends execution in. Patterns are limited to exact matches and patterns that begin or end with '*'.methodName
- the name of the method(s) this breakpoint suspends execution in, ornull
if this breakpoint does not suspend execution based on method namemethodSignature
- the signature of the method(s) this breakpoint suspends execution in, ornull
if this breakpoint does not suspend execution based on method signatureentry
- whether this breakpoint causes execution to suspend on entry of methodsexit
- whether this breakpoint causes execution to suspend on exit of methodsnativeOnly
- whether this breakpoint causes execution to suspend on entry/exit of native methods onlylineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a method breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
- Since:
- 2.0
-
createMethodEntryBreakpoint
public static IJavaMethodEntryBreakpoint createMethodEntryBreakpoint(org.eclipse.core.resources.IResource resource, String typeName, String methodName, String methodSignature, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a method entry breakpoint with the specified criteria. A method entry breakpoint will only be installed for methods that have executable code (i.e. will not work for native methods).- Parameters:
resource
- the resource on which to create the associated breakpoint markertypeName
- the fully qualified name of type this breakpoint suspends execution in.methodName
- the name of the method this breakpoint suspends execution inmethodSignature
- the signature of the method this breakpoint suspends execution inlineNumber
- the lineNumber on which the breakpoint is set - line numbers are 1 based, associated with the source file in which the breakpoint is setcharStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is sethitCount
- the number of times the breakpoint will be hit before suspending execution - 0 if it should always suspendregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation, ornull
if none.- Returns:
- a method entry breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
- Since:
- 2.0
-
lineBreakpointExists
public static IJavaLineBreakpoint lineBreakpointExists(String typeName, int lineNumber) throws org.eclipse.core.runtime.CoreException Returns a Java line breakpoint that is already registered with the breakpoint manager for a type with the given name at the given line number.- Parameters:
typeName
- fully qualified type namelineNumber
- line number- Returns:
- a Java line breakpoint that is already registered with the
breakpoint manager for a type with the given name at the given
line number or
null
if no such breakpoint is registered - Throws:
org.eclipse.core.runtime.CoreException
- if unable to retrieve the associated marker attributes (line number).
-
lineBreakpointExists
public static IJavaLineBreakpoint lineBreakpointExists(org.eclipse.core.resources.IResource resource, String typeName, int lineNumber) throws org.eclipse.core.runtime.CoreException Returns a Java line breakpoint that is already registered with the breakpoint manager for a type with the given name at the given line number in the given resource.- Parameters:
resource
- the resourcetypeName
- fully qualified type namelineNumber
- line number- Returns:
- a Java line breakpoint that is already registered with the
breakpoint manager for a type with the given name at the given
line number or
null
if no such breakpoint is registered - Throws:
org.eclipse.core.runtime.CoreException
- if unable to retrieve the associated marker attributes (line number).- Since:
- 3.1
-
getPreferences
Deprecated.thePreferences
class has been deprecated, use theIEclipsePreferences
accessors insteadReturns the preference store for this plug-in ornull
if the store is not available.
The Preferences class has been deprecated and clients should directly be using the InstanceScope node for JDIDebugPlugin rather than this convenience method.
For example:IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier()); if(node != null) { ... }
- Returns:
- the preference store for this plug-in
- Since:
- 2.0
-
savePreferences
Deprecated.thePreferences
class has been deprecated, use theIEclipsePreferences
accessors insteadSaves the preference store for this plug-in.
The Preferences class has been deprecated and clients should directly be using the InstanceScope node for JDIDebugPlugin rather than this convenience method.
For example:IEclipsePreferences node = InstanceScope.INSTANCE.getNode(JDIDebugPlugin.getUniqueIdentifier()); if(node != null) { try { node.flush(); } catch (BackingStoreException e) { log(e); } }
- Since:
- 2.0
-
createClassPrepareBreakpoint
public static IJavaClassPrepareBreakpoint createClassPrepareBreakpoint(org.eclipse.core.resources.IResource resource, String typeName, int memberType, int charStart, int charEnd, boolean register, Map<String, Object> attributes) throws org.eclipse.core.runtime.CoreExceptionCreates and returns a class prepare breakpoint for a type with the given name. The marker associated with the breakpoint will be created on the specified resource.- Parameters:
resource
- the resource on which to create the associated breakpoint markertypeName
- the fully qualified name of the type for which to create the breakpointmemberType
- one ofTYPE_CLASS
orTYPE_INTERFACE
charStart
- the first character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setcharEnd
- the last character index associated with the breakpoint, or -1 if unspecified, in the source file in which the breakpoint is setregister
- whether to add this breakpoint to the breakpoint managerattributes
- a map of client defined attributes that should be assigned to the underlying breakpoint marker on creation ornull
if none.- Returns:
- a class prepare breakpoint
- Throws:
org.eclipse.core.runtime.CoreException
- If this method fails. Reasons include:- Failure creating underlying marker. The exception's status contains the underlying exception responsible for the failure.
- Since:
- 3.0
-
createStratumBreakpoint
instead