[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Debugging and AspectJ

Hi all,

I'm new to the list so apologies if this has already been covered. I'm
using AspectJ 1.5.1a with AJDT 1.2.2 in Eclipse 3

I'm using compile time around aspects to inject logic as follows:

pointcut methodToInject(Object arg1):execution(boolean
MyClass.myMethod(Object)) && args(arg1);

boolean around(Object arg1): methodToInject(arg1)
{
        System.out.println("Injecting here");
        return proceed(arg1);
}

I compile the jar file using the iajc task as follows

<iajc sourceroots="${src.dir}:${src.aspects.dir}"
	destdir="${classes}"
	fork="true"
	debug="on">
	<classpath refid="compile.classpath"/>
</iajc>

This creates the jar file fine. I've even decompiled the classes which
are getting instrumented by the around advice and I can see the around
advice getting applied. Even when I run the application I get the
System.Out call being printed to the console. So, I know for definite
the code is actually getting executed.

However, when I go to debug the application and I put a breakpoint at
the System.Out call, the debugger never hits the breakpoint. I've a
feeling this might have something to do with the "No inline" flag which
you can set in the IDE as I've heard around aspects can play tricks with
the debugger. However, as I have to use ant to build the jar file, I
need to be able to set the "No inline" flag somewhere in the iajc task

I see this in the developer's guide, but I'm not too sure how to use it:
Set experimental option(s), using comma-separated list of accepted
options Options should not contain the leading X. Some commonly-used
experimental options have their own entries. The other permitted ones
(currently) are serializableAspects, incrementalFile, lazyTjp,
reweavable, notReweavable, noInline, terminateAfterCompilation,
ajruntimelevel:1.2, and ajruntimelevel:1.5. Of these, some were
deprecated in AspectJ 5 (reweavable, terminateAfterCompilation, etc.). 

Has anyone used the noInline option in a iajc task before.

All help would be greatly appreciated

Thanks

Sean