JDK-8022659 : ClassDump should dump all class attributes.
Type:Enhancement
Component:hotspot
Sub-Component:svc-agent
Affected Version:hs25
Priority:P5
Status:Closed
Resolution:Duplicate
Submitted:2013-08-08
Updated:2024-07-11
Resolved:2024-07-11
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
In SA, ClassDump does not dump all class information, such as StackMap etc.
Comments
Closing as a dup of JDK-8311103, which I believe has addressed the concerns of this CR.
11-07-2024
The lack of StackMaps exists with both the buildreplayjars and dumpclass commands, which both rely on ClassWriter.java. I noticed this a while back and filed JDK-8242152.
05-08-2021
The generated classfile currently is processable by javap.
28-02-2017
I don't know if that was the intent, but at a minimum I expect the generated classfiles must be processable by tools like javap.
28-02-2017
True, wondering if being able to execute these classes was ever the intent.
28-02-2017
We need to decide what level of functionality and support the SA should have going forward. If the ClassDump functionality is intended to try and reconstitute the classfile from the runtime representation of the class, as-if it were the original class file generated by javac then there is a lot of work to do to bring the ClassWriter up to JDK 9 (and then JDK 10) levels.
28-02-2017
Issue exists:
[ jini-VirtualBox hs ] $ /home/jini/jhist_mod/hs/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java HelloAndLoop
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 25
Exception Details:
Location:
HelloAndLoop.main([Ljava/lang/String;)V @16: ldc2_w
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: b200 0212 03b6 0004 bb00 0559 b700 064c
0000010: 1400 07b8 0009 a700 0b4d b200 022c b600
0000020: 0bb1
Exception Handler Table:
bci [16, 22] => handler: 25
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3113)
at java.base/java.lang.Class.getMethodsRecursive(Class.java:3254)
at java.base/java.lang.Class.getMethod0(Class.java:3240)
at java.base/java.lang.Class.getMethod(Class.java:2058)
at java.base/sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:685)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:543)