[Soot-list] Creating Traps
Alessio Gambi
alessio.gambi at uni-passau.de
Wed Jul 22 13:45:49 EDT 2020
Dear SOOT-ers,
this is a newbie question but I cannot find any relevant answer around.
The problem:
Instrument an Android application such that all the methods of the application are wrapped in a “big” try/catch-all-exceptions.
The catch block traps Throwable and simply rethrows whatever was trapped
I need this to be able to observe/monitor at runtime what exceptions are thrown by the various methods, as part of a larger project.
I understand that I need to add create a new Trap and add it to the method body by providing four inputs: the exception, the start unit, the end unit, and the first unit of the handler.
So far I managed to provide three of the four inputs, namely, exception, start unit and handler units, but I cannot wrap my mind how I can find out the end unit as that would be excluded
from the trap scope. I suspect might simply be the last unit of the method (i.e., return/throw).
Also, adding the trap to the body is a two-step process: adding the body of the trap (handlerStmt and followingStmts) and “declaring” the trap via addTrap(). Would that be correct?
Thanks
— Alessio
More information about the Soot-list
mailing list