[Soot-list] Try unrepresented in jimple?

David Mohr dmohr at cs.unm.edu
Thu Oct 8 13:27:13 EDT 2009


On Wed, Oct 7, 2009 at 4:02 PM, Patrick Lam <plam at sable.mcgill.ca> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> David Mohr wrote:
>> Hi,
>> seems like I'm flooding the list with questions, but oh well, here I go:
>>
>> Am I correct that the try statement (the exception table in byte code)
>> is not represented in Jimple? It seems to me that neither does the
>> grammar include any statements for it, nor do .jimple files in
>> practice.
>>
>> I think I can in practice work my way around that limitation, but it
>> seems unfortunate that I have to use workarounds. Of course Soot as a
>> whole is pretty nice, and does maintain the exception tables, I just
>> can't see or manipulate them properly in the Jimple representation. I
>> had thought that all of Java mapped to Jimple, is that not really the
>> case?
>
> getTraps() will give you the traps in a JimpleBody. (Yes, this is sort
> of unintuitive). You can manipulate the list of traps as you wish.

Ah, ok! Thanks for the hint.

> There are issues with creating unit graphs in the presence of traps, but
> if you're lucky you won't need to worry about those. For inserting code
> before the try, you can definitely manipulate the Trap.

Seems to be working Ok so far. :-)

~David


More information about the Soot-list mailing list