[Soot-list] How to access/dump the content of a object reference from def box

mbatch at cs.mcgill.ca mbatch at cs.mcgill.ca
Wed Apr 9 12:22:58 EDT 2008


Jimmy,

If you want information about the class type of $r0, you need to get the
SootClass object using information from the type you retrieve:

> Type type = var.getType();

This SootClass will represent your "MyClass" within soot, and has methods
for accessing the list of all methods, super types, interfaces, class
fields, etc.

>From the type's fully qualified path name, you can create the SootClass
using the SootResolver method:

public SootClass resolveClassAndSupportClasses(String className)

Hope this helps.

Michael

On Wed, April 9, 2008 11:46 am, Jimmy wrote:
> Hello,
>
>
> I wanted to check the content of a reference in def
> box, for example, I wanted to dump the content of $r0 in the following
> jimple code. -----------
> java.net.URL $r0;
>
> $r0 = new MyClass;
> specialinvoke $r0.<MyClass: void <init>()>(); -----------
>
>
> Currently, I can check the limited information using the following code
> on the above assignment statement.
>
> List<ValueBox> def_list = st.getDefBoxes();
> if(def_list.size() != 0){ ValueBox vb = def_list.get(0);
> Value var = vb.getValue();
> Type type = var.getType();
> System.out.println("type = " + type);
> }
>
>
>
> Can any one help me to dig into $r0 and access all fields in MyClass ?
>
>
> Thanks.
>
>
>
> Jimmy
> _________________________________________________________________
> Get in touch in an instant. Get Windows Live Messenger now.
> http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refre
> sh_getintouch_042008_______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>




More information about the Soot-list mailing list