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
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
- relates to
-
JDK-4159747 JVMDI spec: needs inner class functions
-
- Closed
-
-
JDK-4921247 RFE: JDI&JDWP: Use InnerClass attribute to get the true inner class information
-
- Closed
-