[Soot-list] Counting exits in a loop - understanding Jimple "goto [?= nop]"

Eric Bodden eric.bodden at ec-spride.de
Mon Jul 16 23:10:16 EDT 2012


Hi John.

This is all just an issue of pretty printing. When you print an entire
body, then all stmts that gotos jump to are labeled ,so that you can
properly distinguish all the targets of a goto. When you print an
individual goto statement, however, things are more tricky. After all,
without numbering each and every statement, how would you denote the
target of a goto statement? Currently Soot just prints the textual
representation of that target statement but that may be ambiguous if
there are multiple statements that look alike. Currently the best way
to figure out such targets is to use a debugger, I am afraid.

Eric

On 16 July 2012 21:27, John Dean <jdean4 at kc.rr.com> wrote:
> Phil,
> You say "When you operating at runtime, the targets of the goto instructions
> will be two disctinct Units." So for the "goto nop" that shows up in my list
> of statements, what are the "targets," that are "two distinct Units"?
> Likewise, for the "goto [?= nop]" statement: What are the "targets," that
> are "two distinct Units"?
>
> Pardon my ignorance - I'm obviously not grasping something significant about
> goto statements.
>
> Thanks,
> John
>
> -----Original Message-----
> From: phil.pratt.szeliga at gmail.com [mailto:phil.pratt.szeliga at gmail.com] On
> Behalf Of Phil Pratt-Szeliga
> Sent: Monday, July 16, 2012 6:12 PM
> To: john.dean at park.edu
> Cc: soot-list at sable.mcgill.ca
> Subject: Re: [Soot-list] Counting exits in a loop - understanding Jimple
> "goto [?= nop]"
>
> Hi John,
>
>> 1. I thought goto statements normally cause execution to jump to an
>> address, such that the address is sometimes represented by a label.
>> But what do "goto nop" and "goto [?= nop]" jump to? If nop is a label
>> (and I doubt that's the case), then isn't it a problem that there are
>> more than one statement
>> (label?) with the nop label?
>
> nop is an instruction. When you operating at runtime, the targets of the
> goto instructions will be two disctinct Units. When jimple is written out to
> disk, they place unique labels in the file.
>
>> 2. Any advice on Jimple documentation that might help me to understand
>> things better?
>
> Feel free to email the list with questions as they come up. I have a bunch
> of experience with Jimple.
>
> Some important classes/interfaces
> Unit
> Value
> Stmt
> Expr
>
> Each line of code is a Unit. The individual parts of Units are usually
> Values or Units. You can go here [1] and lookup those classes/interfaces and
> see the hierarchy of classes to get a better understanding of how things
> work.
>
> Phil Pratt-Szeliga
> Syracuse University
>
> [1] http://www.sable.mcgill.ca/soot/doc/
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list