JDK-4242717 : JDI/JDWP Spec: Add watchpoints for local variables and array elements
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.2.0,9
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 1999-05-31
  • Updated: 2016-11-03
  • Resolved: 2016-11-03
Related Reports
Relates :  
Relates :  
Description
Name: krT82822			Date: 05/31/99


[not clear why this was filed against JDK 1.2beta4 -- am assuming user is referring to beta of JDI  --kevinr@eng, 5/31/99]

JDI method:

EventRequestManager.createModificationWatchpointRequest( Field f )

The resulting event is triggered whenever that field is modified in *any* object instance.  This is not the most useful behaviour.  What is really needed is a way to break when a field in a *specific* object instance is modified.  I would suggest the following additional versions of createModificationWatchpointRequest() be added to the API.

createModWatchReq( ArrayReference a, int index )
- breakpoint when an array element is modified

createModWatchReq( ObjectReference o, Field f )
- break when a field in a specific object is modified

createModWatchReq( LocalVariable l, StackFrame f )
- break when a local variable is modified.
- This request disables itself when StackFrame goes out of scope.

Ditto for EventManager.createAccessWatchpointRequest()
(Review ID: 83370) 
======================================================================

Comments
This is not on our list of current priorities, if this changes please re-open this issue.
03-11-2016

EVALUATION The functionality provided is base functionality. Per-object watchpoints can be achieved today by further filtering in the JDI client. Future JDI versions will have a more generalized form of back-end filtering involving expression evaluation which will cover this request, among others. gordon.hirsch@eng 1999-05-31 begin - robert.field@Eng 2001-04-03 As of Merlin object filters are provided which give the field in object functionality. Array element watchpoints would still be important. Over and above stepping, local variable watchpoint are probably not worth the work. I am thus lowering the priority, robert.field@Eng 2001-04-03
03-04-2001