[Soot-list] try-catch-finally duplicate problem

Martin Schäf martinschaef at gmail.com
Mon Sep 1 11:28:53 EDT 2014


Hi Daniel,
not sure if it helps, but I hacked my way around this by just looking for
subprograms that have the same type of statements and same line numbers but
are not directly connected. Its not bullet proof but works for most cases.
Its a bit tricky because the finally blocks are not exact duplicates.
Variable names are different and sometimes a return turn into a goto.
My code is here:
https://github.com/martinschaef/jar2bpl/blob/master/jar2bpl/src/org/joogie/soot/SootBodyTransformer.java
and the procedure you need is "
detectDuplicatedFinallyBlocksAndCheckForSynchronizedStuff"
Hope that helps,
M


On Sun, Aug 31, 2014 at 11:27 PM, Steven Arzt <Steven.Arzt at cased.de> wrote:

> Hi Daniel,
>
> This happens because we get "duplicate" code from the various front-ends
> (ASM, Dexlib). In more detail, the following is generated:
>
> * Run the code inside the try
> * If an exception is caught inside the try, run the exception handler and
> then the finally stuff
> * If an exception is caught inside the exception handler, run the finally
> code nevertheless
> * If everything went alright, run the finally code
>
> Instead of producing copies of the finally code, we could also try to
> identify such cases and always jump to the same label for the finally code.
> This would then be a new features inside Soot.
>
> Best regards,
> Steven
>
> Danijel Mlinarić <Danijel.Mlinaric at fer.hr> wrote:
>
>  Hello,
>
>  I'm trying to analyze try-catch-finally blocks using jimple and graphs,
> problem is duplicated finally code after try and catch block.
> Is there any way to get one finally block per try-catch-finally or soot
> support some methods to determine equal duplicated blocks in jimple?
>
>  Any help is appreciated a lot.
>
>  Regards,
> Daniel
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140901/c575450d/attachment.html 


More information about the Soot-list mailing list