[Soot-list] Instrument Class to print HashCode

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Tue Nov 25 09:51:28 EST 2014


Hi Utkarsh,

I am not sure I understand your question precisely, but I'm going to
give my best shot.

If you want to find all the objects that receive assignments, you just
have to iterate and find all the AssignStmt instances, cast it, and
return the left object.

In Scala, it'd be something like this: sm.units.collect { case a :
AssignStmt => a.getLeftOp}

Then you can do whatever you want with those, like calculating a hash code.

Same principle in Java, just way more verbose ;-)

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 11/25/2014 08:47 AM, Utkarsh Gupta wrote:
> Hi everyone,
> 
> We are trying to retrieve the hashcodes of all objects on the left hand
> sides of assignment statements and print them using instrumentation. We
> are following this
> <https://github.com/Sable/soot/wiki/Adding-profiling-instructions-to-applications>
> tutorial.
> In the tutorial, the code to increment the counter is 
> /AssignStmt toAdd1 = Jimple.v().newAssignStmt(tmpLong,/
> /                           
> Jimple.v().newStaticFieldRef(gotoCounter.makeRef()));/
> How do we invoke the hashcode function in a similar way?
> 
> Thank you,
> Utkarsh Gupta
> 
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list