This document lists changes made to the Debugger JPDA APIs. Please ask on the
nbdev@netbeans.org
mailing list if you have any questions about the details of a
change, or are wondering how to convert existing code to be compatible.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: org.netbeans.api.debugger.jpda/1 > 1.20
org.netbeans.spi.debugger.jpda.BreakpointsClassFilter
org.netbeans.spi.debugger.jpda.BreakpointStratifier
org.netbeans.api.debugger.jpda.CallStackFrame
org.netbeans.api.debugger.jpda.ClassVariable
org.netbeans.api.debugger.jpda.DeadlockDetector
org.netbeans.spi.debugger.jpda.EditorContext
org.netbeans.spi.debugger.jpda.Evaluator
org.netbeans.api.debugger.jpda.ExceptionBreakpoint
org.netbeans.api.debugger.jpda.FieldBreakpoint
org.netbeans.api.debugger.jpda.InvalidExpressionException
org.netbeans.api.debugger.jpda.JPDAArrayType
org.netbeans.api.debugger.jpda.JPDABreakpoint
org.netbeans.api.debugger.jpda.JPDAClassType
org.netbeans.api.debugger.jpda.JPDADebugger
org.netbeans.api.debugger.jpda.JPDAStep
org.netbeans.api.debugger.jpda.JPDAThread
org.netbeans.api.debugger.jpda.LineBreakpoint
org.netbeans.api.debugger.jpda.MethodBreakpoint
org.netbeans.api.debugger.jpda.MonitorInfo
org.netbeans.api.debugger.jpda.MutableVariable
org.netbeans.api.debugger.jpda.ObjectVariable
org.netbeans.api.debugger.jpda.ReturnVariable
org.netbeans.spi.debugger.jpda.SmartSteppingCallback
org.netbeans.spi.debugger.jpda.SourcePathProvider
org.netbeans.api.debugger.jpda.ThreadsCollector
org.netbeans.api.debugger.jpda.Variable
org.netbeans.api.debugger.jpda.VariableType
BreakpointStratifier
; made by: mentlicher
BreakpointStratifier
interface added to be able to adjust breakpoint properties
of newly created breakpoints according to the strata it belongs to.
ExceptionBreakpoint
; made by: mentlicher
ExceptionBreakpoint
class are deprecated and replaced with grammatically correct names.
JPDAStep
JPDADebugger
; made by: mentlicher
JPDAStep
enhanced with stepping filters for better control.
JPDADebugger.getSession()
added to be able to easily retrieve the session
this JPDA debugger belongs into.
InvalidExpressionException
; made by: mentlicher; issues:
#268011
InvalidExpressionException
can be thrown as a result
of an application-level exception. We need to differentiate this case
from exceptions thrown from NetBeans code. A boolean argument in the
constructor and a method hasApplicationTarget()
are
added to InvalidExpressionException
for this purpose.
SmartSteppingCallback
; made by: mentlicher; issues:
#255918
SmartSteppingCallback.stopAt()
method added to be able
to override the default smart-stepping logic and provide specific
steps that should be performed at given locations.
JPDAClassType
ClassVariable
; made by: mentlicher; issues:
#253295
JPDAClassType
class. These are:
ClassVariable
:
EditorContext
; made by: mentlicher; issues:
#246819
createMethodOperation()
, which takes
boolean isNative
is added to EditorContext
class. The EditorContext.Operation
has isNative()
method to retrieve that information. The implementation retrieves the
native flag from parser information, therefore there can occur native
methods at runtime, which are not marked as native by this flag.
JPDADebugger
JPDAClassType
; made by: mentlicher; issues:
#237233
Variable
MutableVariable
; made by: mentlicher; issues:
#228894
MutableVariable
interface is introduced. It's to be implemented by
variables that can change their values. Field
,
LocalVariable
and JPDAWatch
now extend
MutableVariable
.
Object createMirrorObject()
method is added to Variable
class and void setFromMirrorObject(Object obj)
method
is declared by MutableVariable
.
JPDADebugger
; made by: mentlicher; issues:
#79027
JPDABreakpoint
; made by: mentlicher; issues:
#226029
BreakpointsClassFilter
; made by: mentlicher; issues:
#215680
JPDADebugger
; made by: mentlicher; issues:
#182439
JPDADebugger
; made by: dprusa; issues:
#180695
Added field:
JPDADebugger.PROP_CLASSES_FIXED
Evaluator
; made by: mentlicher; issues:
#171342
An Evaluator
interface is introduced, with
evaluate()
method. It's implementation should be registered
for the desired language that compiles into bytecode.
Annotations are added for easy registration on module layers.
*Provider.Registration
annotations are introduced to register
implementations of appropriate providers.
JPDAThread
; made by: mentlicher; issues:
#156368
Added methods:
JPDAThread.getReadAccessLock()
,
CallStackFrame
DeadlockDetector
JPDADebugger
JPDAThread
MonitorInfo
ThreadsCollector
EditorContext
; made by: mentlicher; issues:
#136099
Added classes:
org.netbeans.api.debugger.jpda.DeadlockDetector
,
org.netbeans.api.debugger.jpda.MonitorInfo
,
org.netbeans.api.debugger.jpda.ThreadsCollector
Added methods:
CallStackFrame.getFrameDepth()
,
CallStackFrame.getOwnedMonitors()
,
JPDADebugger.getThreadsCollector()
,
JPDADebugger.getDeadlockDetector()
,
JPDAThread.getCurrentBreakpoint()
,
JPDAThread.getContendedMonitorAndOwner()
,
JPDAThread.getOwnedMonitorsAndFrames()
,
EditorContext.annotate()
with thread argument,
AttachingDICookie.getProcessID()
Added fields:
JPDADebugger.PROP_THREAD_STARTED
,
JPDADebugger.PROP_THREAD_DIED
,
JPDADebugger.PROP_THREAD_GROUP_ADDED
,
JPDAThread.PROP_SUSPENDED
,
JPDAThread.PROP_BREAKPOINT
,
EditorContext.OTHER_THREAD_ANNOTATION_TYPE
EditorContext
; made by: mentlicher; issues:
#103934
In order to implement annotation of method breakpoints in Editor, we need to be able to locate individual methods in Editor, based on their names and signature. Also we need annotation types for fields and methods.
Added methods:
EditorContext.getMethodLineNumber()
,
EditorContext.getCurrentMethodDeclaration()
,
Added fields:
EditorContext.FIELD_BREAKPOINT_ANNOTATION_TYPE
,
EditorContext.DISABLED_FIELD_BREAKPOINT_ANNOTATION_TYPE
,
EditorContext.METHOD_BREAKPOINT_ANNOTATION_TYPE
EditorContext.DISABLED_METHOD_BREAKPOINT_ANNOTATION_TYPE
ExceptionBreakpoint
FieldBreakpoint
JPDABreakpoint
LineBreakpoint
MethodBreakpoint
; made by: mentlicher; issues:
#103936
To catch-up with JDI capabilities and be able to implement new enhancements,
we need to add support for new breakpoint properties into the debugger JPDA API.
These are mainly class and thread filters and hit counts.
Added methods:
ExceptionBreakpoint.getClassFilters()
,
ExceptionBreakpoint.setClassFilters()
,
ExceptionBreakpoint.getClassExclusionFilters()
,
ExceptionBreakpoint.setClassExclusionFilters()
,
FieldBreakpoint.getInstanceFilters()
,
FieldBreakpoint.setInstanceFilters()
,
FieldBreakpoint.getThreadFilters()
,
FieldBreakpoint.setThreadFilters()
,
JPDABreakpoint.getHitCountFilter()
,
JPDABreakpoint.getHitCountFilteringStyle()
,
JPDABreakpoint.setHitCountFilter()
,
LineBreakpoint.getInstanceFilters()
,
LineBreakpoint.setInstanceFilters()
,
LineBreakpoint.getThreadFilters()
,
LineBreakpoint.setThreadFilters()
,
MethodBreakpoint.getMethodSignature()
,
MethodBreakpoint.setMethodSignature()
,
MethodBreakpoint.getInstanceFilters()
,
MethodBreakpoint.setInstanceFilters()
,
MethodBreakpoint.getThreadFilters()
,
MethodBreakpoint.setThreadFilters()
.
Added fields:
ExceptionBreakpoint.PROP_CLASS_FILTERS
,
ExceptionBreakpoint.PROP_CLASS_EXCLUSION_FILTERS
,
FieldBreakpoint.PROP_INSTANCE_FILTERS
,
FieldBreakpoint.PROP_THREAD_FILTERS
,
JPDABreakpoint.PROP_HIT_COUNT_FILTER
,
JPDABreakpoint.HIT_COUNT_FILTERING_STYLE
,
LineBreakpoint.PROP_INSTANCE_FILTERS
,
LineBreakpoint.PROP_THREAD_FILTERS
,
MethodBreakpoint.PROP_METHOD_SIGNATURE
,
MethodBreakpoint.PROP_INSTANCE_FILTERS
,
MethodBreakpoint.PROP_THREAD_FILTERS
.
JPDADebugger
JPDAClassType
ObjectVariable
VariableType
JPDAArrayType
; made by: mentlicher; issues:
#100047
In order to be able to provide heap walking functionality, we need methods for retrieval of class instances and back references.
Added methods:
Field.getDeclaringClass()
,
JPDAClassType.getClassLoader()
,
JPDAClassType.getSuperClass()
,
JPDAClassType.getInstanceCount()
,
JPDAClassType.getInstances()
,
JPDADebugger.canGetInstanceInfo()
,
JPDADebugger.getAllClasses()
,
JPDADebugger.getClassesByName()
,
JPDADebugger.getInstanceCounts()
,
ObjectVariable.getReferringObjects()
,
ObjectVariable.getClassType()
,
ObjectVariable.getUniqueID()
.
Added classes:
VariableType
,
JPDAArrayType
.
EditorContext
; made by: mentlicher; issues:
#99257
An access to method arguments in source code is necessary for cases where we do not have full debug information.
Added methods:
EditorContext.getArguments()
Added classes:
EditorContext.MethodArgument
JPDAStep
CallStackFrame
JPDAThread
EditorContext
; made by: mentlicher; issues:
#93842
In order to be able to provide stepping over operations, we need a representation of an operation and some way how to retrieve the operation(s) from a Thread and a CallStackFrame.
Added fields:
JPDAStep.STEP_OPERATION
,
EditorContext.CURRENT_LAST_OPERATION_ANNOTATION_TYPE
,
EditorContext.CURRENT_EXPRESSION_SECONDARY_LINE_ANNOTATION_TYPE
,
EditorContext.CURRENT_EXPRESSION_CURRENT_LINE_ANNOTATION_TYPE
Added methods:
CallStackFrame.getCurrentOperation()
,
JPDAThread.getCurrentOperation()
,
JPDAThread.getLastOperations()
,
EditorContext.createMethodOperation()
,
EditorContext.addNextOperationTo()
,
EditorContext.createPosition()
,
EditorContext.getOperations()
Added classes:
EditorContext.BytecodeProvider
,
EditorContext.Operation
,
EditorContext.Position
LineBreakpoint
; made by: mentlicher; issues:
#83188
In order to be able to provide the class name for which the breakpoint should be submitted. This is necessary for JSP.
JPDAClassType
ClassVariable
ReturnVariable
; made by: mentlicher; issues:
#80090
In order to be able to provide static context information and return value of methods, three new classes were added.
SourcePathProvider
; made by: mentlicher; issues:
#52180
Retrieves a source root for a given URL. This is necessary to
match breakpoint locations with the sources selected fopr debugging.
It returns null
by default.
JPDADebugger
; made by: mentlicher; issues:
#67046
A possibility to detect whether the debuggee is read-only is added.
This check works fine on JDK 1.5 and higher, on JDK 1.4 it returns
true
by default.
JPDAThread
; made by: mentlicher; issues:
#59072
A possibility to interrupt a debuggee thread is added.
JPDA API represents JDI functionality. Since JDI interfaces evolve from one version to another, it's necessary to declare that interfaces in org.netbeans.api.debugger.jpda package should not be implemented, since new methods can be added to these interfaces at any time to keep up with the JDI functionality.
Also JPDABreakpointEvent and JPDABreakpointListener are moved to newly created org.netbeans.api.debugger.jpda.event package.
JPDAStep allows to create a step request to JDI with no UI interference. It was designed for new RunIntoMethod action. New method JPDADebugger.createJPDAStep creates a new instance of JPDAStep.
LineBreakpoint
; made by: lkotouc
A line breakpoint does not contain the information about the source path where it is set. There is no way how to differ between breakpoints in the case when - several JSPs have the same name AND - these JSPs are statically included into one JSP page.
This parameter has been added to distinguish between finding sources for smart stepping feature, and for all other features like douuble click on stack trace..
This method is needed to correctly implement fix & continue action.
This method is needed to correctly implement line breakpoint in secondary classes.
ContextProvider.getImports () method added to support better evaluation of expressions. ContextProvider.getLineNumber (annotaion) method added to fix stepping through modified files.
ContextProvider and EngineContextProvider has been changed from interfaces to abstract classes. This was done to support future changes in these classes.
Mew constructor added (InvalidExpressionException(java.lang.Throwable)), and InvalidExpressionException.getTargetException() method added to support firing of nested exceptions.
ContextProvider.getFieldLineNumber() method added.
InvalidExpressionException is fired from folowing methods now:
JPDADebugger.SESSION_ID constant has been added.
We have added several new methods to fix issues in smart stepping implementation:
We have added several new properties to JPDABreakpointEvent:
We have changed ClassLoadUnloadBreakpoint to support class exclusion filters, and more than one class filter. The same change was done for MethodBreakpoints too.
Support for Fix Action improved. Support for Pop Frame action added. Support for static and inherited fields added. New methods:
JPDABreakpointEvent and JPDABreakpointListener classes added. JPDABreakpoint.addJPDABreakpointListener (...) and JPDABreakpoint.removeJPDABreakpointListener (...) methods added.
Methods starting debugger has been modified to support synchronous start of debugging.