[aspectc-user] error: Bad argument(s) for the `cpp_move' manipulator
Olaf Spinczyk
Olaf.Spinczyk at informatik.uni-erlangen.de
Mon Sep 12 09:38:42 CEST 2005
Hi Dmitry,
the problem is that ac++ can't weave in macro-generated code, yet. As
you can see in the output, the call to 'print' is matched, but then the
code manipulation fails.
This problem is already on our TODO list and you can also find it on the
roadmap for version 1.0 at aspectc.org.
As a workaround you can only exclude 'call("% print(const char*)") &&
within ("% main(...)")' from your pointcut :-(.
Best regards,
Olaf
Dmitry Ratnikov wrote:
> Hi,
> I am trying to use aspectc in conjunction with mysql. While doing
> that, I have run into the error mentioned in the subject.
> Here is the code for a simpler example that reproduces the error:
>
> main.c:
>
> #include <stdio.h>
>
> void print(const char* str) {
>
> printf("%s\n", str);
>
> }
>
> #define MACRO(a) print(a);
>
> int main() {
>
> MACRO("Hello world!");
>
> return 0;
> }
>
> debug.ah:
>
> #include <stdio.h>
>
>
> aspect DebugAspect {
>
> advice
> call("% %(...)")
> : around() {
>
> printf("am before %s\n", JoinPoint::signature());
>
> tjp->proceed();
>
> printf("am after %s\n", JoinPoint::signature());
>
> }
> };
>
>
>
> Output (it's pretty long):
>
> <...>/aspectc/mysql-5.0.12-beta/dev > ls
> <...>/aspectc/mysql-5.0.12-beta/dev/test
> debug.ah main.c
> <...>/aspectc/mysql-5.0.12-beta/dev > make
> cd <...>/aspectc/mysql-5.0.12-beta/dev/test; <...>/aspectc/ac-0.9.3/ac++
> -v1 --gnu --config <...>/aspectc/ac-0.9.3/puma.config -e c -I.
> -I/usr/kerberos/include -I<...>/aspectc/mysql-5.0.12-beta/include -p .
> -d <...>/aspectc/mysql-5.0.12-beta/test
> * Running ac++ 0.9.3
> * Simple Dependency Check
> - new or modified: ./debug.ah
> * Handling Translation Unit `main.c'.
> - Path "./main.c"
> - Inserting namespace AC
> - Parsing ...
> - Setting Aspect Access Priviledges ...
> - Weaving Introductions ...
> - intros for DebugAspect
> - Aspect ordering ...
> - Final checks before weaving introductions
> - Class Join Points
> - Weaving Advice Declarations ...
> DebugAspect::%a0_around
> - Weaving Singleton Aspects ...
> - Aspect Includes ...
> - Commiting
> - Parsing again ...
> - Weaving Join Points ...
> Advicecode manipulation
> Collecting Advice
> Setting up thisJoinPoint for aspectof
> Supplying aspectof() with JoinPoint and tjp if needed
> DebugAspect: __a0_around
> Evaluate Pointcut
> Aspect ordering ...
> Final checks before weaving code join points
> Type Check Functions
> Call Join Points
> int printf(const char *,...)
> int printf(const char *,...)
> int printf(const char *,...)
> void print(const char *)
> Execution Join Points
> Construction Join Points
> Destruction Join Points
> - Aspect Includes ...
> - Final cleanup
> - Commiting
> error: Bad argument(s) for the `cpp_move' manipulator (Args: <anonymous
> unit>:1, <anonymous unit>:1).
> <<<<<<<<--------------------- (The error)
> * Handling include files
> - Handling Translation Unit `ac_gen.c'.
> Path "./ac_gen.c"
> Inserting namespace AC
> Parsing ...
> Setting Aspect Access Priviledges ...
> Weaving Introductions ...
> intros for DebugAspect
> Aspect ordering ...
> Final checks before weaving introductions
> Class Join Points
> Weaving Advice Declarations ...
> DebugAspect::%a0_around
> Weaving Singleton Aspects ...
> Aspect Includes ...
> Commiting
> Parsing again ...
> Weaving Join Points ...
> Advicecode manipulation
> Collecting Advice
> Setting up thisJoinPoint for aspectof
> Supplying aspectof() with JoinPoint and tjp if needed
> DebugAspect: __a0_around
> Evaluate Pointcut
> Aspect ordering ...
> Final checks before weaving code join points
> Type Check Functions
> Call Join Points
> int printf(const char *,...)
> int printf(const char *,...)
> Execution Join Points
> Construction Join Points
> Destruction Join Points
> Aspect Includes ...
> Final cleanup
> Commiting
> * Saving
> - Project tree
> * Done
> <...>/aspectc/mysql-5.0.12-beta/dev >
>
> Any ideas what causes it?
>
> Thanks,
> Dmitry
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
More information about the aspectc-user
mailing list