[prev in list] [next in list] [prev in thread] [next in thread] 

List:       soot-list
Subject:    Re: [Soot-list] Retaining debug information through Soot?
From:       "Bodden, Eric" <eric.bodden () sit ! fraunhofer ! de>
Date:       2013-11-23 8:59:06
Message-ID: C053EAD5-5C19-4AD8-9E62-FD5E8556AC2B () sit ! fraunhofer ! de
[Download RAW message or body]

Hi Nate.

In the package soot.coffi you will find several references to LocalVariableTable. \
This is where Soot parses the original table from the bytecode and applies the \
local-variable aggregation and naming.

To generate such attributes again, you should create a class implementing \
soot.tagkit.Tag. The getValue() method in this interface generates the attribute \
bytecode value for this tag. Look at other implementers of this interface to see what \
this can look like.

Then one would best add a transform to the pack "jap" in PackManager, line 278. These \
are all transforms that apply some kind of tagging. The BodyTransformer you insert \
there is passed a Body for every method in the Scene. Simply attach the tag to the \
Body (or its owning SootMethod?) and you should be good to go.

Once this works for you I would appreciate if you could share the code through a pull \
request against the "develop" branch of Soot.

Best wishes,
Eric




On 23.11.2013, at 01:50, Nate Deisinger <ndeisinger@wisc.edu> wrote:

> That sounds like it would be the best option.  I'm not familiar with how Soot \
> writes out to bytecode, so pointers on how to get started modifying that behavior \
> (as well as how to add an appropriate Tag for variable names) would be appreciated. \
>  Thanks,
> Nathan
> 
> On 11/22/2013 02:18 AM, Bodden, Eric wrote:
> > Hi Nathan.
> > 
> > > Ah, my mistake for not mentioning I had tried that option. I know that gets me \
> > > Jimple with the names intact, but Soot doesn't seem to translate that into \
> > > actual Java debug information when exporting a class. Thanks for the response, \
> > > though!
> > While this is probably true (I would need to check) this should be not too hard \
> > to implement. Essentially, Soot initially parses the attributes to generate the \
> > variable names but then the original attribute is probably not actually converted \
> > into a Tag (which is Soot's internal representation of attributes). I think all \
> > one would need to do is extend Soot to create an appropriate Tag. Then in the \
> > end, this tag would automatically be written out into a bytecode attribute again \
> > by Soot. (each Tag class implements a method that defines how the tag is \
> > converted into an attribute) 
> > One thing to keep in mind is that you might want to create these tags in the end \
> > of Soot's computation such that the tags reflect renamings/additions etc. that \
> > Soot might have made. 
> > If you would like to work on such an extension let me know and I can give you \
> > some more pointers. 
> > Cheers,
> > Eric
> 

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.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 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJSkG5ZAAoJEBflvf1oEO7RnwoP/0Pft9ZbU1U66K4bL46LIXrS
O0HK0ut2dfolgrYzZNQWun1NgxjKpjIC7zg3hyfTqprjUWpHJ9B4ABBTqo+AuvtZ
LJDI1WoMfzmfhNRdgD3uhy8yzR/Omhjdrv6Uo1lr7ijcjQybDsCObJkGuL4NTvtV
88vGG80urh28bZgVyJsQyAn0n55DLFxffeENYRud6vFlPUwqcYvOcJAX7hTa7p4l
cVU/60hkvZ3LoCt5IcC6fGNvMGX1vnqO5U+lZuu51yg5EdirXIFRM2XekUn0r7jV
CfdfzBdmCL+ONHIHNbLQUNKeOz/2ZDMDGldZ5fvBaiLywvJmMkwio5q+HG8wOi1M
4VWUihRbLODpS3NMUFYIFZ+orB9GDBkZ5SG/N98hIvQkizPh95693aPVUjD0TjsQ
YS0E4ih0rYCPM69L4Km03AIP/S4IbTpFJKfqRvxrtVvLx7eJedtQ00BaOdSROdGH
wAx0sUHDdKgFHwFqe5J5tEpWSgoonJhJQuvD2jQYwkU7X0+j0pBsKM0GEdQC8iK3
KKEYn/+QkGDzw12SDCgcZ2QG5ZXTMvkePNoo1QexxUEgnnXllb6Rl2npUcTZFZ36
GKMHIZ9nr0+YlkteJddfnDE+glKOJT7KTPuaGKBVWI1Oe8yoEKkEnXu9bc+brjFd
NUaTcg4wVHW7ViNGd+UX
=/w4/
-----END PGP SIGNATURE-----


_______________________________________________
Soot-list mailing list
Soot-list@sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

--===============4404189904425649830==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic