[Soot-list] recognize catch and finally blocks

Marc-André Laverdière-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Fri May 24 12:26:15 EDT 2013


Hello,

Sorry for the delay, that is not something I have been dealing with often.

I am looking at ExceptionalUnitGraph. The docs say:
For every ThrowInst or ThrowStmt Unit which may explicitly throw an
exception that would be caught by a Trap in the Body, there will be an
edge from the throw Unit to the Trap handler's first Unit.

getExceptionalSuccsOf will refer you to to the catch, so that deals with
your problem.

I am not sure of how the finally handler works out. I would guess that
you'd have to look for gotos in the catch handler.

I hope that helps a bit.

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 20/05/13 09:23 PM, Haipeng Cai at ND wrote:
> Hello all,
> 
> Trying to instrument in the catch block and finally block, if there is
> any, I am not sure if some handy routines are available for (1) telling
> if there is any such blocks in a given method or not, esp., catch and
> finally block separately since there might be catch blocks without a
> finally block; and (2) if (1) is true, locating or retrieving the blocks
> so that manipulation in them can be performed such as instrumenting
> probes as I am asking for. 
> 
> I found there are utility classes like ExceptionalBlockGraph
>  ExceptionalUnitGraph, both of which can be instantiated with the active
> body of a given SootMethod, do the instance member "getTails" provide
> direct helps in this regard? The code comments say that it will return
> exit points of the graphs, do that tell the catch and finally blocks?
> But still this would not tell a catch block from a finally one.
> 
> Any advice is appreciated a lot.
> 
> -haipeng
> 
> 
> _______________________________________________
> 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