Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Unable to debug my aspects when using iajc build task

Andy Clement wrote:
Hi Chris,

On 01/11/2007, Chris Rose <chris.rose@xxxxxxxxxxxxxxxxxxx> wrote:
I'm now working through debugging aspect advice, and I've got a problem:

First, for some reason (I've submitted a bug against the aspectJ IDE on
this) I cannot use the aspectJ project nature on our large development
project; rebuilds of the project wedge and require between 20 and
forever minutes to proceed.  If debugging aspects requires the aspectJ
nature in the IDE, I'm hosed.  I think it shouldn't, however.

No, you are right, debugging doesn't require AJ nature in the IDE.
20mins sounds unusual for compiling an AJ project though, do you
definetly have a high enough Xmx for the eclipse instance? 768M?
1024M?

Yeah, there's enough memory. I strace-d the Eclipse process and saw a LOT of filesystem polling, but I don't know for sure what was going on there. It'd be great to get rid of.

I'm building the code using the aspectJ ant task 'iajc', in an aspectJ
1.5.3 distribution, using the following options:

       <iajc
          destdir="${destdir}"
          source="1.5"
          debug="on"
          deprecation="on"
          verbose="false"
          showWeaveInfo="false"
          Xlintwarnings="true"
          fork="false">

The compiler is compiling _all_ of our source code, not just aspects.
It is replacing the <javac/> task in this case.

However, when I try to walk the code in my debugger (attach to remote
JBoss instance, breakpoints on the aspect and inside the first method it
calls) I cannot get the debugger to 'see' the aspect advice.

The aspect is written using annotations, if that makes a difference,
instead of the aspectj language, mainly because of the problem I
mentioned above about being unable to configure the project as an
aspectj project.

So, how can I make the required debug information make it into the class
and into my IDE?

I haven't done much remote debugging ...  but the use of 'debug=on' is
all that should be required for debug to work.  Are you by any chance
debugging around advice?  The only thing that springs to mind that
might be impacting you is that around advice can be inlined at the
locations where it applies - and then breakpoints wont be picked up if
you have set them into around advice.  You can compile with -XnoInline
and we won't inline it and then we'll respect your breakpoints.  The
fact that you use annotations shouldn't really make any difference but
if it is a small aspect, you could quickly swap it to code style to
check if that is the problem?

Well, yes, I _am_ doing around advice; not because I have to, per se, but because it's convenient to do it that way (since I'm hooking functionality before and after the same class of function).

What are the other effects of -XnoInline? Will it make the code in there work any differently, otherwise?

Andy
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

--
Chris Rose
Developer    Planet Consulting Group
(780) 577-8433
crose@xxxxxxxxxxxx


Back to the top