Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4932038

JDI: please add heap walking API in Java Debugger Interface

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • core-svc
    • generic
    • generic

      Currently, Java Debugger Interface (JDI) does not have a way to get java objects from heap.

      While one can local variables and follow links from local objects, sometimes we want to get all heap objects of a specific type.

      In particular, read-only JDI subset aimed at coredumps could have heap access API.

      While debugging java core dumps, we may want to get java objects of a specific type or objects of all types. There can be a capability API that tells whether a given JDI implementation supports heap access or not.

      The API proposed are as below:


      Heap Walking API introduces facility to walk java walk from core files/process snapshots.
      The heap walking API addes only 4 methods to VirtualMachine class

      1) canWalkHeap

          boolean canWalkHeap();

          capability check method. returns true if a jdi implementation can walk heap. else returns false.

      2) allObjects
          List/*&ltObjectReference>*/ allObjects();

          Returns list of all heap objects.

      3) objectsByType
          List/*<ObjectReference>*/ objectsByType(ReferenceType type, boolean includeSubtypes)

          Returns list of all objects of given type. If 'includeSubtypes' is true all objects of subtype of given type are included in result. If 'includeSubtypes' is false, only the objects of type exactly equal to given type are included in the result

      4) objectsByType
          List/*<ObjectReference>*/ objectsByType(ReferenceType type);

          Returns list of all objects of given type or subtype of given type. This is equivalent to objectsByType(type, true);


      ###@###.### 2003-10-03

            Unassigned Unassigned
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: