[Soot-list] Inconsistent Line Number

Bodden, Eric eric.bodden at sit.fraunhofer.de
Fri Apr 10 03:55:25 EDT 2015


Hi all.

> These lines are occasions on which a single Java line was split into multiple Jimple lines. If condition in your Java code accesses a field which is not directly possible in Jimple. Therefore, Soot creates two lines from it: We first read the field value and then compare it. Apparently, only the first line gets the corresponding line number tag, whereas the second one does not. This in turn is quite strange as we have code that propagates on line numbers (see lines 425ff in class soot.dexpler.DexBody. My guess therefore is that some transformer kills the line number tag for some reason.

This is generally a known problem in Soot. There are many transformers that might optimize and clean up the Jimple before it gets exposed to the client. Not all of them preserve line numbers faithfully. Usually, the best thing to do is to traverse Stmts backwards, searching for appropriate line numbers there. We could update getJavaSourceStartLineNumber() to do that automatically but that would cause it to have unpredictable runtimes, which I kind of dislike.

The best way to deal with this, of course, would be to fix the built-in transformers. If you can help us in figuring out which ones are the culprits then we can probably look into this. The -dump-body option should help with this if -print-tags is enabled as well.

Cheers,
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150410/84a9e116/attachment.bin 


More information about the Soot-list mailing list