[Soot-list] About reaching definitions analysis in soot

Steven Lee Elderry at outlook.com
Mon Mar 31 22:25:38 EDT 2014


Hello Modhi,

 

1.      getLocals() works well, your info is really helpful, thanks.

2.      Could you please be more specific about how to set an option in phase jb? I’m running the RunLiveAnalysis example and use soot.jar as an external lib of my project, so when I searched here(http://www.sable.mcgill.ca/soot/tutorial/phase/index.html), I found it only mentioned how to add options while calling soot.Main(), but I don’t need to call that. In my understanding here is my entry to soot:

> args = new String[] { "analysis_framework.testers.LiveVarsClass" };

> SootClass sClass = Scene.v().loadClassAndSupport(args[0]);

> sClass.setApplicationClass();

Then I do my analysis directly on sClass, so where should I add those options, for now, the use-original-names option and keep line number option?

 

From: Modhi Alsobiehy [mailto:m99m20 at hotmail.com] 
Sent: Saturday, March 29, 2014 09:00
To: soot-list at CS.McGill.CA; 'Steven Lee'
Subject: Re: [Soot-list] About reaching definitions analysis in soot

 

Hi Steven,

 

1. If I am really getting what you mean, I have done similar work in which we  retrieved all the locals from the unit graph using  unitGraph.getBody().getLocals(), iterated over them, iterated over units and checked whether there was a reaching definition using sld.hasDefsAt(localVar, unit) and if so, we retrieved that def.

 

2. for this part, as Marc said, you should set the use-original-names to true. I a not sure whether there is some sort of jimple mapping list, however, when we needed that in our work we relied on the keep line number option  to associate between the code in source and jimple.

 

Hope that helps!

-modhi

 

Sent from Windows Mail

 

From: Marc-Andre Laverdiere-Papineau <mailto:marc-andre.laverdiere-papineau at polymtl.ca> 
Sent: ‎Friday‎, ‎March‎ ‎28‎, ‎2014 ‎8‎:‎46‎ ‎AM
To: soot-list at CS.McGill.CA <mailto:soot-list at CS.McGill.CA> 

 

Hello,

By the way, have a look at the Soot options and phase options. There is 
an option to keep the variable names that mostly works (some edge cases 
are there, but hopefully you'll be fine). You can set an option in phase 
jb: use-original-names:true.

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

On 2014-03-28 02:52, Steven Lee wrote:
> Hello M Alsob:
>
> 1.I have also found SimpleLocalDefs, which seems indeed a solution of my
> problem, I think the method getDefsOfAt(Local l, Unit s) may be helpful.
> But now I’m wondering how to obtain some Locals in a Unit? The Unit
> class only offers methods like getUseBoxes() which gives me the
> ValueBox, then the Value of those Locals, not a Local class instance.
>
> 2.What I really want to do is mark something in the source code
> directly, for example, find one variable, then all the places where the
> value of this variable is being changed. If the work of my first problem
> above goes well, I can do this in a jimple file, then how do I know one
> Local in jimple file is corresponding to which one variable in source
> file? And the definition sites also? So the line number option is
> necessary, except this, I also need to know the source variables’ and
> the jimple Locals’ mapping list(or something else similar). Now I’m
> reading the annotation part of soot, am I on the correct direction?
>
> Thanks for your help! J
>
> *From:* M Alsob [mailto:m99m20 at hotmail.com]
> *Sent:* Thursday, March 27, 2014 22:14
> *To:* Steven Arzt; 'Steven Lee'; soot-list at sable.mcgill.ca <mailto:soot-list at sable.mcgill.ca> 
> *Subject:* Re: [Soot-list] About reaching definitions analysis in soot
>
> Hi Steven,
>
>  1. you can use SimpleLocalDefs, simply create an instance from the
>     class and then pass the unit graph : SimpleLocalDefs sld = new
>     SimpleLocalDefs(unitGraph);
>
>  2. do you mean how to relate the jimple file to the source code? if so,
>     use the keep line number option, this way you know what line in the
>     source generated a certain part of the jimple code!
>
> -modhi
>
> Sent from Windows Mail
>
> *From:*Steven Arzt <mailto:Steven.Arzt at cased.de>
> *Sent:* ‎Thursday‎, ‎March‎ ‎27‎, ‎2014 ‎4‎:‎45‎ ‎AM
> *To:* 'Steven Lee' <mailto:Elderry at outlook.com>,
> soot-list at sable.mcgill.ca <mailto:soot-list at sable.mcgill.ca>  <mailto:soot-list at sable.mcgill.ca>
>
> Hi Steven,
>
> Soot implements an interprocedural reaching definitions analysis based
> on the Heros IFDS/IDE framework. Actually, this is one of the example
> problem implementations we ship with Soot to show how Heros is used with
> Soot. You can find the implementation in class
> ”soot.jimple.toolkits.ide.exampleproblems. IFDSReachingDefinitions”.
> What you need to do to use it, is fairly simple: Create an instance of
> the IFDSSolver class, give it an instance of the problem class above,
> call “solve” and fetch the results using “resultsAt”.
>
> Best regards,
>
>    Steven
>
> PS: It’s funny to  reply to someone who has the same first name ^^
>
> M.Sc. M.Sc. Steven Arzt
>
> Secure Software Engineering Group (SSE)
>
> European Center for Security and Privacy by Design (EC SPRIDE)
>
> Mornewegstraße 32
>
> D-64293 Darmstadt
>
> Phone: +49 61 51 16-75426
>
> Fax: +49 61 51 16-72118
>
> eMail: steven.arzt at ec-spride.de <mailto:steven.arzt at ec-spride.de>  <mailto:steven.arzt at ec-spride.de>
>
> Web: http://sse.ec-spride.de <http://sse.ec-spride.de/>
>
> *Von:*soot-list-bounces at sable.mcgill.ca
> <mailto:soot-list-bounces at sable.mcgill.ca>
> [mailto:soot-list-bounces at sable.mcgill.ca] *Im Auftrag von *Steven Lee
> *Gesendet:* Donnerstag, 27. März 2014 08:00
> *An:* Soot Group
> *Betreff:* [Soot-list] About reaching definitions analysis in soot
>
> Hello everyone, would anyone can help me with some questions?
>
> 1.How to do reaching definitions analysis with soot? Does soot already
> implement it, or I need to implement it myself with the data-flow
> framework?
>
> 2.I want to do this analysis for some java source code and then mark
> each variables potential definitions, but I find that soot does its main
> analysis on the corresponding jimple file. So my question is: if I
> finished the analysis on a jimple file, how to I transform these results
> to my java source file?
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA <mailto:Soot-list at CS.McGill.CA> 
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>
_______________________________________________
Soot-list mailing list
Soot-list at CS.McGill.CA <mailto:Soot-list at CS.McGill.CA> 
https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20140401/b82c37f5/attachment.html 


More information about the Soot-list mailing list