[Soot-list] Adding an attribute to a line of code

Arie Zilberstein arie.zilberstein at gmail.com
Fri May 21 12:49:59 EDT 2010


Hi Eric,

Thanks for your help. From what I've seen, Unit-level tags are aggregated
into a method-level attribute. This attribute contains a "map" from labels
to each tag's byte array representation. But how may an outside consumer
make use of those labels? In my example, I require that ASM processes the
produced classfile.

The problem is that, I could not find the correspondence between the label
number and the bytecode offset... It would've been perfect if the tag
contained the bytecode offset of the instruction, but I think that this data
is not available in Jasmin at the moment of code emission.

Here's an example label that Soot produced:

%label0%AAA=%label1%AAA=%label2%AAA=

Thanks,
Arie

-----Original Message-----
From: eric.bodden at googlemail.com [mailto:eric.bodden at googlemail.com] On
Behalf Of Eric Bodden
Sent: Friday, May 21, 2010 8:23 AM
To: Arie Zilberstein
Cc: soot-list at sable.mcgill.ca
Subject: Re: [Soot-list] Adding an attribute to a line of code

Hi Arie.

If I remember correctly then there is o such thing as a unit-level
attribute in bytecode. There are only method-level attributes that can
refer to units via instruction offsets. I believe that this is what
the aggregaters are meant for: convert a list of unit-level tags to a
single method-level tag that encodes the unit-to-attribute relation
correctly. I think there should be some code in Soot that already does
that for certain attributes.

If you have suggestions on how to make this any easier, please let us
know. This is definitely one of the areas of Soot that I think may
still benefit from improvements.

Happy tagging,
Eric

--
Dr. 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



On 21 May 2010 02:33, Arie Zilberstein <arie.zilberstein at gmail.com> wrote:
> Hi,
> I'm having a lot of trouble adding an attribute to a line of code.
> I attach my own custom Tag to a (Jimple) Unit but that tag never gets
> translated into a Java attribute.
> It seems that Soot only outputs field, class or method-level attributes. A
> tag on a Unit will at best get aggregated by a TagAggregator and will be
> lost; instead a method-level attribute will be created.
> Am I doing something wrong? I analyzed the code thoroughly and could not
> find the way.
> I even found a tutorial
> (http://www.sable.mcgill.ca/soot/tutorial/tagclass/index.html) but it
failed
> in the same way. I'm using the SVN trunk version of soot.
> Thanks,
> Arie
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



More information about the Soot-list mailing list