[Soot-list] How to view generated Jimple code?

John Dean jdean4 at kc.rr.com
Sat Nov 24 12:13:38 EST 2012


Eric (or anyone else),

Unfortunately, I've been super busy with other work for the past month, and
it's not until today that I've found the time to try your suggestion in the
email below this one. In that email, you suggested that I view the Jimple
code that my program is generating. I ran my usual ANT file and added the
options as you suggested below, but I got the error message "unknown
argument -soot". I looked for a user guide of some sort to help with soot
options, but with a 10-minute cursory glance at
http://www.sable.mcgill.ca/publications/, I couldn't find anything. I've
perused the 2008 paper "A Survivor's Guide to Java Program Analysis with
Soot" and found some options, but nothing helped with my specific problem.

Here is the command I entered at the command prompt:

C:\000parallelLoops\parallelLoops\abc-1.3.0-transcut-4.0\abc-ja-exts>ant
run-looppar-test > \junk\run-looppar-test4.txt +soot -f J -soot

Without "+soot -f J -soot" at the very end, that command allows me to run my
abc-based compiler. But with those options, I get the message:

Unknown argument: -soot

Suggestions?

Thanks,
John

-----Original Message-----
From: abc-users-bounces at sable.mcgill.ca
[mailto:abc-users-bounces at sable.mcgill.ca] On Behalf Of Eric Bodden
Sent: Monday, October 22, 2012 1:02 AM
To: john.dean at park.edu
Cc: abc-users at sable.mcgill.ca
Subject: Re: [Abc-users] How to get my args pointcut to match?

Hi John.

It may be useful to take a look at the code that gets generated, for
instance using the command-line options "+soot -f J -soot". This will emit
Jimple files.

The matching happens inside the method matchesAt(..). That may also be
worthwhile looking at. I cannot see anything wrong with your code - it looks
ok to me. So I guess we both must be missing something.

Eric

On 21 October 2012 02:33, John Dean <jdean4 at kc.rr.com> wrote:
> Hi Eric,
>
> As you suggested, I implemented a method getArgsContextValues() in my 
> RegionShadowMatch class.
> As you said, I have verified that that method is indeed called 
> automatically. My problem is that my args pointcut is causing my 
> advice to not match.
> I have tried to pinpoint the problem by simplifying 
> getArgsContextValues() to just the following (it is patterned after 
> eaj's getArgsContextValues()
> methods):
>
> public List getArgsContextValues()
> {
>   System.out.println("@@ top of getArgsContextValues");
>   ArrayList<JimpleValue> al = new ArrayList<JimpleValue>();
>   al.add(new JimpleValue((Immediate) IntConstant.v(1)));
>   return al;
> }
>
> Here is my advice:
>
> void around(int testArg):
> loopPar() && args(testArg))
> {
>   etc.
>
> And here is my simple loop that I'm trying to match:
>
> for (int a=0; a<2; a++)
> {
>   System.out.println("a = " + a);
> }
>
> I compile successfully. When I run, I get a warning saying that the 
> advice doesn't have any matches. Thus, the for loop runs without the 
> around doing anything.
> If I remove the args(testArg), then my loopPar pointcut does match 
> successfully and the around works correctly.
>
> 1. Do I have to register args(int) somewhere so abc can recognize it?
>
> 2. Since args can be associated with other pointcuts (like a method 
> call), how are loopPar and my new args(int) associated with each other?
>
> 3. Is there anything else I need to do to get the args to match?
>
> Thanks,
> John
>
> -----Original Message-----
> From: eric.bodden at gmail.com [mailto:eric.bodden at gmail.com] On Behalf 
> Of Eric Bodden
> Sent: Saturday, October 20, 2012 3:49 AM
> To: john.dean at park.edu
> Cc: abc-users at sable.mcgill.ca
> Subject: Re: [Abc-users] How to add an args pointcut?
>
> Hi John.
>
> The class abc.weaving.matching.ShadowMatch implements the method 
> getArgsContextValues(). Your compiler extension most likely implements 
> the loop pointcut through a custom subclass of ShadowMatch. Inside 
> this class, all you need to do is implement getArgsContextValues() 
> such that it returns references to the right values. The method is called
automatically by abc.
>
> Eric
>
> On 19 October 2012 14:41, John Dean <jdean4 at kc.rr.com> wrote:
>> Eric,
>>
>> Thanks for your reply from yesterday.
>> I think I understand what you're saying, but I'm having trouble 
>> following through on something. I'm hesitant to ask it because I feel 
>> like I should be able to figure it out on my own, but I've spent 
>> several hours and no luck yet. Anyway....
>>
>> As you imply (?), I think I need to call 
>> abc.weaving.aspectinfo.Args.matchesAt(MatchingContext)and pass in my 
>> own version of MatchingContext as an argument. Before I write that 
>> code, I'd like to see an example of someone else calling that method.
>> I've searched in every file in eaj that contains "matchesAt" and I 
>> can't find any calls to the Args version of matchesAt.
>>
>> Can you tell me where I can find an example of calling
>> abc.weaving.aspectinfo.Args.matchesAt(MatchingContext) so I can use 
>> it as a pattern for my call?
>> Or if you think I'm barking up the wrong tree, please tell me.
>>
>> Thanks,
>> John
>>
>> -----Original Message-----
>> From: eric.bodden at gmail.com [mailto:eric.bodden at gmail.com] On Behalf 
>> Of Eric Bodden
>> Sent: Thursday, October 18, 2012 11:42 AM
>> To: john.dean at park.edu
>> Cc: abc-users at sable.mcgill.ca; Hossein Sadat-Mohtasham
>> Subject: Re: [Abc-users] How to add an args pointcut?
>>
>> Hi John.
>>
>> Did you have a look at the following method?
>> abc.weaving.aspectinfo.Args.matchesAt(MatchingContext)
>>
>> This method binds "context values" by dispatching to:
>> abc.weaving.aspectinfo.ArgVar.matchesAt(WeavingEnv, ContextValue)
>>
>> ... which creates a Bind residue.
>>
>> I think that for your pointcut you just need to create the "right"
>> context values in your shadow-match class. For an example, look at:
>> abc.eaj.weaving.matching.ArrayGetShadowMatch.getTargetContextValue()
>>
>> Eric
>>
>> On 18 October 2012 18:28, John Dean <jdean4 at kc.rr.com> wrote:
>>> abc user's group,
>>>
>>> For my Ph.D. dissertation, I am attempting to implement a 
>>> parallelizable loop pointcut. I am using Hossein Sadat-Mohtasham's
>> "transcut"
>>> aspect-oriented compiler as a starting point (thanks, Hossein!), and 
>>> his compiler is built on top of abc. I've implemented the code which 
>>> identifies loops as parallelizable, and my next step is to add an 
>>> args pointcut that will work in conjunction with my new looppar 
>>> pointcut (specifically, my new args pointcut needs to match min, 
>>> max, and stride values for a loop). I've read the article "abc : An 
>>> extensible AspectJ compiler" and I've skimmed abc's Args.java and 
>>> other source code files with "Args" in their names, but I can't find 
>>> anything specific yet that tells me how to add a new args pointcut.
>>>
>>> Does anyone have any suggestions for how I should proceed to add an 
>>> args pointcut that will work in conjunction with my new looppar
pointcut?
>>>
>>> Thanks,
>>> John
>>>
>>>
>>>
>>> _______________________________________________
>>> Abc-users mailing list
>>> Abc-users at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/abc-users
>>
>>
>>
>> --
>> Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/ Head 
>> of Secure Software Engineering Group at EC SPRIDE
>> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
>> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>>
>
>
>
> --
> Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/ Head of 
> Secure Software Engineering Group at EC SPRIDE
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>



--
Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/ Head of
Secure Software Engineering Group at EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
_______________________________________________
Abc-users mailing list
Abc-users at sable.mcgill.ca
http://mailman.cs.mcgill.ca/mailman/listinfo/abc-users



More information about the Soot-list mailing list