JDK-4448968 : JDI cannot create WatchpointRequest's on local data
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-04-20
  • Updated: 2001-04-20
  • Resolved: 2001-04-20
Related Reports
Duplicate :  
Description

Name: tb29552			Date: 04/20/2001


java version "1.3.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)

This is a JDI problem.

com.sun.jdi.request.EventRequestManager only allows the creation of
WatchpointRequest's on a Field; that is, WatchpointRequest's can only watch
members of a class, not variables which are local to methods.

For instance, say I have the following methods:

class Foo {
   Bar getBar( ) {
      Bar bar;
      tinkerWithBar( bar );
      return( bar );
   }

   void tinkerWithBar( /* in-out */ Bar bar ) {
      bar = new BarChildClass( ); // a class that extends Bar
   }
}

Now, say I want to place a WatchpointRequest on the local variable "bar" within
method Foo.getBar .... There is no apparent way to do this, and yet it is a
standard feature of MOST languages and debuggers.
(Review ID: 121046) 
======================================================================

Comments
WORK AROUND Name: tb29552 Date: 04/20/2001 There is no workaround known. The following methods should be added to the com.sun.jdi.request.EventRequestManager interface: AccessWatchpointRequest createAccessWatchpointRequest( ObjectReference instance, LocalVariable local ) & ModificationWatchpointRequest createModificationWatchpointRequest( ObjectReference instance, LocalVariable local ) where ObjectReference instance is the object containing a method which contains the LocalVariable local. The inclusion of the ObjectReference relates to feature request 121045 (internal number). This is a standard feature permitted by Microsoft's C# language, as well as all other C and C++ implementations. ======================================================================
11-06-2004

EVALUATION Duplicate of 4228507 robert.field@Eng 2001-04-20
20-04-2001