Soot version of Jasmin failing to assemble Jasmin assembly files
I have both the version of Jasmin 2.4 from the Jasmin SourceForge and the version of Jasmin 2.4 from the Soot project (at sable.mcgill.ca, labeled "jasminclasses"), and the Soot version (which I need) does not seem to be working properly.
I have made a simple compiler which compiles initially to Jasmin JVM assembly then uses Jasmin to assemble into JVM class files. I used to use the normal version of Jasmin from Jasmin's SourceForge site, and it was working great; everything compiled and ran correctly. Now I have started doing optimization using the Soot framework, and all that works great as long as I don't try to convert the optimized code back into a class file.
Since I'm using Soot now, I have to use Soot's version of Jasmin, which supports the JasminOutputStream that Soot us开发者_JAVA百科es. Soot's version of Jasmin does appear as though it's still supposed to be able to handle processing Jasmin files the "old fashioned" way, reading in a ".j" file instead of taking an input stream, but when I try (for the initial assemble before the optimization), the Soot version fails.
If I do
java -cp jasmin.jar jasmin.Main MyClass.j
I get output "Generated: MyClass.class" as expected.
If I do (where jasminclasses is the Soot version of Jasmin)
java -cp jasminclasses-2.4.0.jar jasmin.Main MyClass.j
I get output
MyClass.j:5: Warning - Syntax error.
.field public n
^
MyClass.j:5: Error - Couldn't repair and continue parse.
.field public n
^
MyClass.j: Found 2 errors`
Line 5 is just .field public n I Nothing incorrect about it, and as shown above, it compiles fine with the normal version of Jasmin.
For completeness, here's some more code around that point:
.source MyClass.j
.class public MyClass
.super AnotherClass
.field public n I
.method public <init>()V
aload_0
invokenonvirtual AnotherClass/<init>()V
return
.end method
Everything there is fine and assembles fine with normal Jasmin.
Does anyone know if the Soot version of Jasmin expects a different syntax? As with most stuff concerning Soot and Jasmin, there's not much on the web at all in the first place, let alone much on what I'm searching for, so my Googling isn't coming up with much.
Thank you in advance for any assistance offered, I'm really getting frustrated here. My next step is going to be to debug Soot's Jasmin package and see what it's doing in there and why it's failing, but I'm hoping I don't have to go that far for now just for this.
精彩评论