[Soot-list] instrumenting with soot class by class
Eric Bodden
eric.bodden at mail.mcgill.ca
Wed Apr 16 22:45:50 EDT 2008
> I need to instrument almost every jimple instruction and I was assuming
> AspectJ only allows instrumentation around method entry and exit points.
> Am I mistaken about that?
It also allows you to instrument field accesses and some other stuff
but for example no local variable assignments or similar things.
> The problem with the current approach that soot is taking is that for a
> large codebase the instrumentation takes really long since there does
> not seem to be a built in mechanism that would allow for soot to detect
> that a class is already instrumented.
> I was also considering whether it would be possible to change the behavior
> of 'internalTransform' method so that I can bail out of that method in case
> I do not need to instrument the class again. Unfortunately, if I just
> return out of the internalTransform method without changing the byte code,
> soot overwrites the
> previously instrumented class with an un-instrumented version of the class.
I am not quite sure where from and when internalTransform is called in
your setting. I would not actually suspect this to be the crux of the
problem.
> Do you think it would be possible (even for me) to modify the core soot
> code to allow for that kind of behavior?
To me it sounds like you want to instrument stuff as it gets loaded
into Soot. This could be possible but I have never tried it nor do I
know of anybody who has. Generally preventing Soot from
(re-)instrumenting a class should not be a big problem though: Just
keep around a cache of instrumented classes.
Eric
--
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada
More information about the Soot-list
mailing list