[Soot-list] Soot-list Digest, Vol 53, Issue 16

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Tue Nov 3 08:32:01 EST 2009


Hi Cristiane.

This should be easy with Soot. For any method body, Soot gives you a
list of "traps". (see
http://www.sable.mcgill.ca/soot/doc/soot/Body.html#getTraps%28%29)
Each trap basically models the "try" part of a try/catch. Using
Trap.getHandlerUnit(), you can access the target of the trap, i.e.,
the beginning of the "catch" part. Getting the end of the "catch" is
more tricky. It should be possible to find this end through a
dominator analysis, though: If I am not mistaken, then the first
statement after the catch block should always post-dominate the end of
the "try" part. You can find post-dominators using:
http://www.sable.mcgill.ca/soot/doc/soot/toolkits/graph/MHGPostDominatorsFinder.html

Eric

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



2009/11/3 Cristiane Queiroz <criscq at gmail.com>:
> Hi,
> I'm developing a tool to extract Java exception handling to AspectJ aspects,
> and I need to analyze information that is contained within a catch, such as
> if the catch block contains references to class methods, variables,
> parameters of methods.
>
> Could you help me and tell me if there is any way to do this?
>
> []'s Cristiane Queiroz
>
> _______________________________________________
> 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