Re: [abc-users] Determine a basic block

From: Amjad Nusayr <anusayr_at_cs.nmsu.edu>
Date: Thu, 17 Apr 2008 16:37:19 -0600

Hi Eric,
OK, I have missed around with the jimple code generated and used soot to
convert it to .class files like you told me. here is what I done.

public void <init>()
    {
        Hello this;
       // org.aspectj.lang.JoinPoint thisJoinPoint$101;
        //org.aspectj.lang.JoinPoint$StaticPart pointcutlocal$102;
        java.lang.Object[] argsvals$109;
        java.lang.Integer pointcutlocal$111;
        World theAspect$World;

        //pointcutlocal$102 = <Hello:
org.aspectj.lang.JoinPoint$StaticPart SJP7$BasicBlock$IinitI>;
        argsvals$109 = newarray (java.lang.Object)[1];
        pointcutlocal$111 = new java.lang.Integer;
        specialinvoke pointcutlocal$111.<java.lang.Integer: void
<init>(int)>(0);
        argsvals$109[0] = pointcutlocal$111;
       // thisJoinPoint$101 = staticinvoke
<org.aspectbench.runtime.reflect.Factory: org.aspectj.lang.JoinPoint
makeJP(org.aspectj.lang.JoinPoint$StaticPart,java.lang.Object,java.lang.Object,java.lang.Object[])>(pointcutlocal$102,
null, null, argsvals$109);
        theAspect$World = staticinvoke <World: World aspectOf()>();
       // virtualinvoke theAspect$World.<World: void
before$0(int,org.aspectj.lang.JoinPoint)>(0, thisJoinPoint$101);
        this := @this: Hello;
        specialinvoke this.<java.lang.Object: void <init>()>();
        return;
    }

Basically, I just commented out the declaration of thisJoinPoint$101 and
pointcutlocal$102. I did the same for any statement that referenced to
them. there are a total of 5 lines that are commented now. (2
declarations and 3 stmts).

My test program will run without any exceptions if this is done, I'm not
getting the java.lang.VerifyError any more. (but I'm not getting any
reflective information).

I'm new to jimple, I dont know what do these lines exactly represent.

Can you make any sense out of this?

Thanks again
Amjad

Eric Bodden wrote:
> Hi.
>
> You should just state "Hello" on the command line, not "Hello.jimple".
>
> Eric
>
> On 17/04/2008, Amjad Nusayr <anusayr_at_cs.nmsu.edu> wrote:
>
>> Hi Eric
>> I'm trying to generate the .class files as you told me but I'm getting an
>> error. I dont know if its a class-path error. (Should I set an environment
>> variable for Soot? if yes, how should it look like?). anyways here is what I
>> get:
>>
>> F:\helloworld\p1>java -cp f:\bbs\lib\abc-complete.jar;. soot.Main
>> Hello.jimple World.jimple
>> Soot started on Thu Apr 17 12:59:00 MDT 2008
>> Exception in thread "main" java.lang.RuntimeException: couldn't find class:
>> Hello.jimple (is your soot-class-path set properly?)
>> at
>> soot.SootResolver.bringToHierarchy(SootResolver.java:139)
>> at
>> soot.SootResolver.bringToSignatures(SootResolver.java:172)
>> at
>> soot.SootResolver.processResolveWorklist(SootResolver.java:104)
>> at
>> soot.SootResolver.resolveClass(SootResolver.java:89)
>> at soot.Scene.loadClass(Scene.java:335)
>> at soot.Scene.loadClassAndSupport(Scene.java:320)
>> at soot.Scene.loadNecessaryClass(Scene.java:867)
>> at soot.Scene.loadNecessaryClasses(Scene.java:886)
>> at soot.Main.run(Main.java:170)
>> at soot.Main.main(Main.java:146)
>>
>> I know that I have Hello.jimple nad World.jimple in my current directory.
>> and I tried the following command.
>>
>> java -cp f:\bbs\lib\abc-complete.jar;. soot.Main
>> f:\helloworld\p1\Hello.jimple F:\helloworld\p1\World.jimple
>>
>> and I got the same exception!
>>
>> What did I do wrong this time?
>>
>> Amjad
>>
>>
>>
>> Eric Bodden wrote:
>>
>>
>>> Hi again.
>>>
>>> I cannot quite see what's wrong with your Jimple code but I suspect
>>> that you are weaving into positions for which it is not advisable to
>>> weave into. (Bytecode has certain constraints on the code layout that
>>> needs to be adhered to.)
>>>
>>> You should be able to debug this easier by playing with the generated
>>> Jimple code. You can actually feed back the .jimple files to Soot:
>>>
>>> java -cp abc-complete.jar soot.Main Hello.jimple World.jimple. This
>>> generates .class files which you can then try to run. Try to modify
>>> the two jimple files (e.g. by removing statements) until the code
>>> verifies. This should give you an idea of what could be the problem.
>>>
>>> Hope that helps.
>>>
>>> Eric
>>>
>>>
>>>
>>>
>>
>>
>
>
>
Received on Thu Apr 17 2008 - 23:37:26 BST

This archive was generated by hypermail 2.2.0 : Fri Apr 18 2008 - 00:50:11 BST