|
Eclipse JDT 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Clients are not intended to instantiate or subclass this class; this class provides static utility methods only.
Field Summary | |
static int |
DEF_REQUEST_TIMEOUT
The default JDI request timeout when no preference is set. |
static String |
PREF_HCR_WITH_COMPILATION_ERRORS
Preference key for specifying if hot code replace should be performed when a replacement class file contains compilation errors. |
static String |
PREF_REQUEST_TIMEOUT
Preference key for default JDI request timeout value. |
Method Summary | |
static void |
addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)
Registers the given listener for hot code replace notifications. |
static void |
addJavaBreakpointListener(IJavaBreakpointListener listener)
Registers the given listener for breakpoint notifications. |
static IJavaExceptionBreakpoint |
createExceptionBreakpoint(IResource resource,
String exceptionName,
boolean caught,
boolean uncaught,
boolean checked,
boolean register,
Map attributes)
Creates and returns an exception breakpoint for an exception with the given name. |
static IJavaLineBreakpoint |
createLineBreakpoint(IResource resource,
String typeName,
int lineNumber,
int charStart,
int charEnd,
int hitCount,
boolean register,
Map attributes)
Creates and returns a line breakpoint in the type with the given name, at the given line number. |
static IJavaMethodBreakpoint |
createMethodBreakpoint(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 attributes)
Creates and returns a method breakpoint with the specified criteria. |
static IJavaMethodEntryBreakpoint |
createMethodEntryBreakpoint(IResource resource,
String typeName,
String methodName,
String methodSignature,
int lineNumber,
int charStart,
int charEnd,
int hitCount,
boolean register,
Map attributes)
Creates and returns a method entry breakpoint with the specified criteria. |
static IJavaPatternBreakpoint |
createPatternBreakpoint(IResource resource,
String sourceName,
String pattern,
int lineNumber,
int charStart,
int charEnd,
int hitCount,
boolean register,
Map attributes)
Creates 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. |
static IJavaTargetPatternBreakpoint |
createTargetPatternBreakpoint(IResource resource,
String sourceName,
int lineNumber,
int charStart,
int charEnd,
int hitCount,
boolean register,
Map attributes)
Creates and returns a target pattern breakpoint for the given resource at the given line number. |
static IJavaWatchpoint |
createWatchpoint(IResource resource,
String typeName,
String fieldName,
int lineNumber,
int charStart,
int charEnd,
int hitCount,
boolean register,
Map attributes)
Creates and returns a watchpoint on a field with the given name in a type with the given name. |
static String |
getPluginIdentifier()
Returns the identifier for the JDI debug model plug-in |
static Preferences |
getPreferences()
Returns the preference store for this plug-in or null
if the store is not available. |
static 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 IDebugTarget |
newDebugTarget(ILaunch launch,
com.sun.jdi.VirtualMachine vm,
String name,
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 IDebugTarget |
newDebugTarget(ILaunch launch,
com.sun.jdi.VirtualMachine vm,
String name,
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 |
removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)
Deregisters the given listener for hot code replace notifications. |
static void |
removeJavaBreakpointListener(IJavaBreakpointListener listener)
Deregisters the given listener for breakpoint notifications. |
static void |
savePreferences()
Saves the preference store for this plug-in. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PREF_REQUEST_TIMEOUT
public static final String PREF_HCR_WITH_COMPILATION_ERRORS
public static final int DEF_REQUEST_TIMEOUT
Method Detail |
public static IDebugTarget newDebugTarget(ILaunch launch, com.sun.jdi.VirtualMachine vm, String name, IProcess process, boolean allowTerminate, boolean allowDisconnect)
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.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 from IDebugTarget.getName
. If null
the name will be retrieved from the underlying VM.process
- the process to associate with the debug target,
which will be returned from IDebugTarget.getProcess
allowTerminate
- whether the target will support termianationallowDisconnect
- whether the target will support disconnectionITerminate
,
IDisconnect
public static IDebugTarget newDebugTarget(ILaunch launch, com.sun.jdi.VirtualMachine vm, String name, IProcess process, boolean allowTerminate, boolean allowDisconnect, boolean resume)
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 esatbished). Launching the actual VM is a client responsibility.
The debug target is added to the given launch.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 from IDebugTarget.getName
. If null
the name will be retrieved from the underlying VM.process
- the process to associate with the debug target,
which will be returned from IDebugTarget.getProcess
allowTerminate
- whether the target will support termianationallowDisconnect
- 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.ITerminate
,
IDisconnect
public static String getPluginIdentifier()
public static void addHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)
listener
- hot code replace listenerIJavaHotCodeReplaceListener
public static void removeHotCodeReplaceListener(IJavaHotCodeReplaceListener listener)
listener
- hot code replace listenerIJavaHotCodeReplaceListener
public static void addJavaBreakpointListener(IJavaBreakpointListener listener)
listener
- breakpoint listenerIJavaBreakpointListener
public static void removeJavaBreakpointListener(IJavaBreakpointListener listener)
listener
- breakpoint listenerIJavaBreakpointListener
public static IJavaLineBreakpoint createLineBreakpoint(IResource resource, String typeName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException
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, but
example.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, or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaPatternBreakpoint createPatternBreakpoint(IResource resource, String sourceName, String pattern, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException
resource
- the resource on which to create the associated breakpoint
markersourceName
- the name of the source file in which the breakpoint is
set, or null
. 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, or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaTargetPatternBreakpoint createTargetPatternBreakpoint(IResource resource, String sourceName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException
resource
- the resource on which to create the associated breakpoint
markersourceName
- the name of the source file in which the breakpoint is
set, or null
. 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, or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaExceptionBreakpoint createExceptionBreakpoint(IResource resource, String exceptionName, boolean caught, boolean uncaught, boolean checked, boolean register, Map attributes) throws CoreException
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. complier
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 or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaWatchpoint createWatchpoint(IResource resource, String typeName, String fieldName, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException
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, but
example.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, or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaMethodBreakpoint createMethodBreakpoint(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 attributes) throws CoreException
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, or null
if this breakpoint does
not suspend execution based on method namemethodSignature
- the signature of the method(s) this breakpoint suspends
execution in, or null
if this breakpoint does not
suspend exectution 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, or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaMethodEntryBreakpoint createMethodEntryBreakpoint(IResource resource, String typeName, String methodName, String methodSignature, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes) throws CoreException
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, or null
if none.CoreException
- If this method fails. Reasons include:public static IJavaLineBreakpoint lineBreakpointExists(String typeName, int lineNumber) throws CoreException
typeName
- fully qualified type namelineNumber
- line numbernull
if no such breakpoint is registeredCoreException
- if unable to retrieve the associated marker
attributes (line number).public static Preferences getPreferences()
null
if the store is not available.public static void savePreferences()
|
Eclipse JDT 2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |