[Soot-list] Different variable names produced in soot console and eclipse soot plugin

Eric Bodden eric.bodden at mail.mcgill.ca
Thu Jul 24 10:18:16 EDT 2008


Yes, it has. The argument you are looking for is -keep-line-number.

Eric

2008/7/24 Gerald Sit <Gerald.Sit at student.cityu.edu.hk>:
> Hi all,
>
> I'm using soot to get all the local variables and fields used in a method call. It produced the variable name under IR scheme when I run the code in Eclipse with soot plugin without any additional arguments. This is what I expected as it would help listing reaching definitions. However, when I run the code in soot console it produces the original variable name of the source files instead.
>
> Below is the relevant code snippet:
>
> Body b = currentMethod.retrieveActiveBody();
> Iterator ui = b.getUnits().iterator();
> while (ui.hasNext()) {
>        Stmt s = (Stmt) ui.next();
>        String className = currentMethod.getDeclaringClass().getName();
>        int line = getLineNumber(s);
>        Iterator ubi = s.getDefBoxes().iterator();
>        while (ubi.hasNext()) {
>                Object o = ubi.next();
>                Value v = ((ValueBox) o).getValue();
>                if (v instanceof Local || v instanceof FieldRef) { // accept local vars and field only
>                        System.out.println(v.toString());
>                }
>        }
> }
>
>
> I'd like to know if the soot plugin in Eclipse has some hidden default arguments? And could we list both the variable name under IR scheme and its original variable name by soot console?
>
> Thanks.
>
> Gerald
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>



-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list