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

Gerald Sit Gerald.Sit at student.cityu.edu.hk
Thu Jul 24 03:09:07 EDT 2008


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


More information about the Soot-list mailing list