Re: Re: Re: Re: byte code transformation checking
Rémi Forax <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
No. You don't generate a proper sequence of instruction label when you create your try/finally. The best is to create a Java code of what you want and use the ASMifier to get the snippet of the correspnding code using ASM. You will be able to compare the code generated by the ASMifier and your code to see where you're wrong. Rémi Le 13/10/2010 10:22, luc peuvrier at home a écrit : > You should check wich class loader is invoked, or check class path > Regards > Luc > > ----- Original Message ----- > *From:* Rajaraman Santhanam <mailto:[email protected]> > *To:* luc peuvrier at home <mailto:[email protected]> > *Cc:* Eugene Kuleshov <mailto:[email protected]> ; [email protected] > <mailto:[email protected]> > *Sent:* Wednesday, October 13, 2010 9:53 AM > *Subject:* Re: [asm] Re: Re: byte code transformation checking > > When I try CheckClassAdaptor, the verify method returns an error > with "ClassNotFoundException" in the target bytecode. I get these > exception only in the classes I transform. > > the trace here - > http://www.pasteme.org/e1b37225f568d1103da4ef84615b4726 > > Any clue here? > > regards, > ramanr > > ---- On Wed, 13 Oct 2010 12:44:12 +0530 *luc peuvrier at home > <[email protected] <mailto:[email protected]>>* wrote ---- > > I integrated CheckClassAdapter in my bytecode transformer as > preconized in CheckClassAdapter javadoc class header. > The "CheckClassAdapter./verify/(*new* ClassReader(code), > *false*, pw);" invokation gives: > > java.lang.ArrayIndexOutOfBoundsException > > : 65 > at > net.sf.joafip.asm.ClassReader.readLabel(_ClassReader.java:1744_) > at > net.sf.joafip.asm.ClassReader.readFrameType(_ClassReader.java:1724_) > at net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:1237_) > at net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:436_) > at > net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:207_) > at > net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:253_) > at > net.sf.joafip.store.service.bytecode.agent.PersistableCodeGenerator.generate(_PersistableCodeGenerator.java:216_) > at > net.sf.joafip.store.service.bytecode.agent.PersistableTransformer.transform(_PersistableTransformer.java:89_) > at > net.sf.joafip.store.service.bytecode.agent.MainTransformerTest.run(_MainTransformerTest.java:77_) > at > net.sf.joafip.store.service.bytecode.agent.MainTransformerTest.main(_MainTransformerTest.java:49_) > > That is the same error when check the class reading bytecode > in file. The file is not corrupted. > I dicovered that I must set the class writer option flag with > "ClassWriter./COMPUTE_FRAMES/" because I add surronding try {} > finally{} to the mehods code. > Unfortunately, the class reader does not explicity complains > about a frame structure error. > Regards > Luc > ----- Original Message ----- > From: "Eugene Kuleshov" <[email protected] > <mailto:[email protected]>> > To: <[email protected] <mailto:[email protected]>> > Sent: Wednesday, October 13, 2010 4:58 AM > Subject: [asm] Re: byte code transformation checking > > > > > First of all, ASM isn't designed to work with broken bytecode > > structures. In other words, the bytecode must be readable > and I suspect > > you may have an incompletely saved file. > > > > But if you are certain that file is intact, in this case it > haven't > > got to the CheckClassAdapter, because of the broken bytecode > structures. > > To deal with that you need to put the CheckClassAdapter into > your > > visitors chain before the ClassWriter and make sure it > passes trough. > > > > regards, > > Eugene > > > > > > luc peuvrier at home wrote: > >> Hi, > >> > >> I run CheckClassAdapter main with > >> > "logs/classes/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.class" > > >> as argument. > >> And I have the here below error: > >> > >> > >> Exception in thread "main" > >> _java.lang.ArrayIndexOutOfBoundsException_: 2 > >> at > >> > net.sf.joafip.asm.ClassReader.readFrameType(_ClassReader.java:1699_) > >> at > net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:1237_) > >> at > net.sf.joafip.asm.ClassReader.accept(_ClassReader.java:436_) > >> at > >> > net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:207_) > >> at > >> > net.sf.joafip.asm.util.CheckClassAdapter.verify(_CheckClassAdapter.java:253_) > >> at > >> > net.sf.joafip.asm.util.CheckClassAdapter.main(_CheckClassAdapter.java:185_) > >> > >> > >> I expect CheckClassAdapter say to me that is wrong in > RemoteTestRunner > >> class. > >> > >> Best regards > >> Luc > > > > > ------------------------------------------------------------------------ > > > > -- > > You receive this message as a subscriber of the [email protected] > <mailto:[email protected]> mailing list. > > To unsubscribe: mailto:[email protected] > > For general help: mailto:[email protected]?subject=help > > OW2 mailing lists service home page: http://www.ow2.org/wws > > > >
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws