[Soot-list] Output of source line annotations in jimple JasminClass

Hal Hildebrand hal.hildebrand at gmail.com
Sun Aug 15 22:32:16 EDT 2010


I'm finding that the recently discussed modification to the baf JasminClass to output source line attributes is not sufficient in all scenarios.  The problem comes about from these lines in the PackManager:


            case Options.output_format_class :
            case Options.output_format_jasmin :
                if (c.containsBafBody())
                    new soot.baf.JasminClass(c).print(writerOut);
                else
                    new soot.jimple.JasminClass(c).print(writerOut);
                break;

As you can see, it's only if the class has a baf body will the baf.JasminClass patch actually work.  In my case, I'm doing transformations in the JTP phase which produce classes with jimple bodies for the methods.  Consequently, the classfile output takes the else branch and completely by passes the patch to output source line annotations.

Thus, my question is how to go about patching jimple.JasminClass in the same fashion such that source line annotations are emitted correctly...

Thanks,

Hal



More information about the Soot-list mailing list