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

JVMTI access to InnerClass and EnclosingClass Attributes

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 10
    • 5.0
    • hotspot
    • None
    • generic
    • generic

      The debugger backend should access Inner Class and Enclosing Class
      information from the class file attributes, not be guessing about
      the Inner classes from the names of the classes.

      The EnclosingMethod attribute in 1.5 will be for local
      and anonymous classes only.

      So ideally we will need both InnerClasses and EnclosingMethod
      to fully support local classes fully.

      For InnerClasses, we need access via JVMTI of the InnerClasses attribute.

      Something like:

       GetInnerClasses(jvmtiEnv* env,
                    jclass klass,
                    jint* count_ptr,
                    jvmtiInnerClass** ptr)
       
       typedef struct jvmtiInnerClass {
            char *signature; /* NULL maybe? The VM spec isn't clear */
            char *outer_signature; /* NULL for local/anon classes */
            char *name; /* NULL if anonymous */
            jint modifiers;
       } jvmtiInnerClass;

      (outer_signature could be a jclass, but I'm not sure the outerclass is
      required to be loaded if a static inner class is being asked about).

      Then a new JDWP nestedTypes4jdi using the above,
      and then change JDI to use the JDWP nestedTypes2jdi if available.

      For local classes we would need something similar in JVMTI to access
      the EnclosingMethod attribute, plus completely new JDWP and JDI interfaces.

      See bugid 4921247.
      ###@###.### 2003-09-12

            Unassigned Unassigned
            ohair Kelly Ohair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: