[Soot-list] Adding new code attributes

Manas Thakur manasthakur17 at gmail.com
Fri Nov 14 04:27:17 EST 2014


Hi Eric

I went inside the code and found that the newly created tag aggregator needs to be added as a transform (this information was missing in the tutorials). Thanks for the insight.

For later reference, I am adding the way tag aggregator is added as a transform before calling soot.Main:
PackManager.v().getPack(“tag”).add(new Transform(“tag.name”, new NewTagAggregator()));

Regards,
Manas


> On 14-Nov-2014, at 2:32 pm, Bodden, Eric <eric.bodden at sit.fraunhofer.de> wrote:
> 
> Hmmm, sorry it has been a long time since I looked into this. It might help looking at where Soot calls getValue and see whether it is called in your case.
> 
> Eric
> 
> --
> Sent from my mobile
> 
> On Nov 14, 2014 9:23 AM, Manas Thakur <manasthakur17 at gmail.com> wrote:
> Hi Eric
> 
> Yes, I’ve implemented the getValue() method. One thing which I doubt is that I read in some related document that we need to register our tag aggregator to the CodeAttributeGenerator. But I don’t know what that means.
> 
> To describe more, I have done the following:
> 1. Extend Tag with a class having an integer field
> 2. Extended TagAggregator (with wantTag and considerTag methods)
> 3. Attached the tag to some units
> 
> I found one resource (soot wiki on github), which says we have to convert the Jimple body to Baf and call the transform method. When I did it, it throws an exception saying “BafBody cannot be cast to JimpleStmtBody”.
> 
> Regards,
> Manas
> 
> 
> On 14-Nov-2014, at 1:44 pm, Bodden, Eric <eric.bodden at sit.fraunhofer.de <mailto:eric.bodden at sit.fraunhofer.de>> wrote:
> 
> Hi Manas.
> 
> Did you implement the public byte[] getValue() method?
> 
> That's important to convert the tag in to the bytecode representation.
> 
> Cheers,
> Eric
> 
> On 13.11.2014, at 11:13, Manas Thakur <manasthakur17 at gmail.com <mailto:manasthakur17 at gmail.com>> wrote:
> 
> Hi
> 
> I am trying to add a new integer code attribute to some of the units in my whole program analysis. But the output class file doesn’t seem to contain them. I tried “-print-tags” as well, but it too didn’t give any additional outputs.
> I am following the procedure given in the “Array Bounds Check Example” athttp://www.sable.mcgill.ca/soot/tutorial/addattributes/ <http://www.sable.mcgill.ca/soot/tutorial/addattributes/>
> 
> Regards,
> Manas
> 
> 
> 
> 
> 
> 
> --
> Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ <http://sse.ec-spride.de/> http://bodden.de/ <http://bodden.de/>
> Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
> Tel: +49 6151 16-75422    Fax: +49 6151 869-127
> Room B5.11, Fraunhofer SIT, Rheinstraße 75, 64295 Darmstadt
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20141114/43eeee2f/attachment-0001.html 


More information about the Soot-list mailing list