[Soot-list] annotation bug? (was: Java 1.5 annotations)
Dave King
dhking at cse.psu.edu
Wed Apr 30 11:38:11 EDT 2008
On Wed, 2008-04-30 at 09:48 -0400, Eric Bodden wrote:
> > Is there a place that Soot stores information about which local
> > variables might correspond to which Jimple locals? I haven't been
> > successful in using javac -g combined with -p jb.use-original-names to
> > get at this. (I think this is because the local variable names don't
> > show up in the Java bytecode when I do a javap -c, so Jimple can't get
> > at them)
>
> No there isn't. This would be really hard to impossible to do because
> not even the compiler has to guarantee to structure stack operations
> in such a way that one *could* at all reconstruct the same variables,
> even if one wanted to. use-original-names often helps (given your
> bytecode has debug info) but might still not give you a 1:1 mapping.
>
> An alternative you could do is have a special block within which you
> then track variables. That way you could add tags to everything
> contained in the block. This would require an extension of the
> frontend, though.
Thanks for the response, Eric. I don't need an exact 1:1 mapping, but I
would like to know when a Jimple/Shimple variable that's being assigned
to corresponds to a given local variable. It looks like
use-original-names gets me partially there, but you're right -- from a
compiler's perspective this is an unreasonable restriction during IR
generation.
I will look into adding a special block to the frontend in the case that
I run into some major problems with a basic use-original-names
implementation. Thanks!
Dave
--
Graduate Student
Penn State University
http://www.cse.psu.edu/~dhking/
More information about the Soot-list
mailing list