[Soot-list] how to get the self object

Cheng Zhang cheng.zhang.stap at gmail.com
Sun Mar 27 12:19:48 EDT 2011


Hi,

If you are sure that the InvokeExpr is an instance of
InstanceInvokeExpr, like in your example.
I think you can cast the InvokeExpr to InstanceInvokeExpr and get the
receiver object via getBase().

Best,

Cheng

On Sun, Mar 27, 2011 at 11:09 PM, daniela antonova
<daniela.antonova at gmail.com> wrote:
> Hi all,
>
> Could anyone please tell me how to get the object on which a method is invoked?
> For example,
>
> if(cur.getCount() > 0)
>    .....
>
> InvokeExpr.getArgs() only returns an empty list, since there are no
> arguments to the method.
> What I need is to somehow find out that it was the cur object on which
> the method getCount() is invoked.
>
> Please help! I looked at a few tutorials and the soot list, but I was
> unable to find the answer!
>
> Thanks for your help!!!
> Daniela
> _______________________________________________
> 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