[Soot-list] Try unrepresented in jimple?

Patrick Lam plam at sable.mcgill.ca
Wed Oct 7 18:02:15 EDT 2009


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

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.

pat
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrND+cACgkQNTVxnNGEyOhOcwCfbuCAEpbRp1PhpcnLG+J8sLmd
KQcAoINX94vl2P4ECyNLUbgUxuYl6Aqf
=Tipn
-----END PGP SIGNATURE-----


More information about the Soot-list mailing list