I am using BCEL for ByteCode generation, I just want to print out (println) before every line in the static methods of the input class. I tried instrumentation using BCEL but it result in different form of errors. It says
Exception in thread "main" java.lang.VerifyError: StackMapTable error: bad offset in method C.max(Ljava/lang/String;II)I
Sometimes it start working if I place some static method call on any instruction and sometime it not. Any help would be really appreciated...
Update: I fixed it. It was not something with the BCEL library, it was JDK version (1.7) which is not verifying my instrumented classes. So if someone encounter such problem either use JDK 1.6 or use the JVM option "-XX:-UseSplitVerifier".
Cheers