[Soot-list] Soot-list Digest, Vol 53, Issue 10

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Wed Sep 9 03:18:40 EDT 2009


> I have tried to extend MyTag from soot.tagkit.JasminAttribute and
> soot.tagkit.CodeAttribute respectively. Unfortunately, none works
> in sense that no self-defined tags are kept in the final instrumented
> class files.

Where do you attach the tags to? To units or to the body itself?

JasminClass lines 288 and following read:

	    Iterator it =  body.getTags().iterator();
	    while(it.hasNext()) {
		Tag t = (Tag) it.next();
		if(t instanceof JasminAttribute) {
		    emit(".code_attribute " + t.getName() +" \"" +
((JasminAttribute) t).getJasminValue(unitToLabel) +"\"");
		}		
	    }

Note that tags are retrieved from the body, not the individual units.

So my guess is that you would have to aggregate all the tags at
individual units to tags (or one single tag?) attached to the body.
There are comments in class JasminAttribute that tell you how to
encode within the tag the code location that the tag belongs to.

(I think the problem is that in Java bytecode individual instructions
cannot have tags - only the method body can, through its constant
pool.)

Eric

> Do we have any way to change the output directories of several
> instrumented class files with one
> statement please?

Oh I see. No Soot only allows you to specify one single output
directory. You are right, if for some reason you want to write the
outputs to different directories then you have to call Soot multiple
times.


-- 
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list