I find bytecode VerifyErrors
notoriously hard to debug. The JVM gives very little feedback, typically just the current class and sometimes the method.
Some examples of errors I typically encounter when manually engineering bytecode through ASM or Jasmin:
Stack size too large
Unable to pop operand off an empty stack
Falling off the end of the code
Expecting to find object/array on stack
Incompatible object argument for function call
Inconsistent stack height 4 != 2
(To be clear; I know what all of these mean, I'm interested in tools or techniques to debug the cause of them.)
My Question: Is there any tool out there that gives detailed feedback on these types of errors? I would for instance appreciate information such as
javap
-like output- references to line-numbers (or opcode byte offsets)
- operand stack information (types / depth) on each line
- more descriptive error messages