eclipse.platform.releng.aggregator
eclipse.platform.releng.aggregator copied to clipboard
Enhance class file comparator diff report
As reported here:
Are the class files themselves readily accessible ? The textual diff is not completely informative. For example the local variable table is missing.
For the class file comparator checks (like in https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1686) it would be nice to:
- generate not only textual file diffs but also attach both versions of actual class files that are compared
- Provide line number table in ASM-generated bytecode text diff (right now it is omitted)
For the later, I have no idea which code generates textual bytecode diffs, however, that one should not omit call to org.objectweb.asm.util.Textifier.visitMaxs(int, int) which is currently the case looking on the diff.
As reported here:
Are the class files themselves readily accessible ? The textual diff is not completely informative. For example the local variable table is missing.
For the class file comparator checks (like in #1686) it would be nice to:
- generate not only textual file diffs but also attach both versions of actual class files that are compared
That would also allow one to use their favorite tool (javap in my case)
- Provide line number table in ASM-generated bytecode text diff (right now it is omitted)
For the later, I have no idea which code generates textual bytecode diffs, however, that one should not omit call to
org.objectweb.asm.util.Textifier.visitMaxs(int, int)which is currently the case looking on the diff.
For the later, I have no idea which code generates textual bytecode diffs
It is done here: https://github.com/eclipse-tycho/tycho/blob/main/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java
any improvements are welcome, I have no particular knowledge about the details of class compare beside that is is done at this place.
For the later, I have no idea which code generates textual bytecode diffs
It is done here: https://github.com/eclipse-tycho/tycho/blob/main/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java
any improvements are welcome, I have no particular knowledge about the details of class compare beside that is is done at this place.
@laeubi : in this line
https://github.com/eclipse-tycho/tycho/blob/3cfab28b0c382d0b7f24bc208bc82787d91f7030/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java#L60
change
reader.accept(clazz, Opcodes.ASM9 | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
to
reader.accept(clazz, Opcodes.ASM9 | ClassReader.SKIP_FRAMES);
so one can see also local variables info generated by compiler.
See
- https://github.com/eclipse-tycho/tycho/pull/3299
See
Thanks!
Please check if that would not create unexpected class file diffs before deploying this tycho version. While it should not, I can't guarantee it and I will be not available for fixing unstable SDK builds from 24.12 till 04.01 as I will have no access to any PC in that time.
Please check if that would not create unexpected class file diffs before deploying this tycho version.
I have added some comments in the PR probably its better to continue discussion there. From my side there is no problem to hold this back until next year when everyone is back in the office, I'll mark the PR as draft to accommodate this, alternatively I can make the change of disassembly a different PR...