[aspectc-user] weaving twice

Francisco Afonso afonsofc at hotmail.com
Thu Jan 24 15:19:01 CET 2008


Hi.

This message follows an October/2007 thread:

http://p15111082.pureserver.info/pipermail/aspectc-user/2007-October/001175.html

I am still receiving a "segmentation fault" from ac++ when weaving for the second time. 

To check if the problem belongs to my code, I wrote a very simple example.
The first weaving is supposed to affect the following files:

//---------------classA.h-----------
#ifndef __classA_h_
#define __classA_h_

class A {
public:
   void doSomething1(); 
   void doSomething2(); 
};
#endif

//---------------classA.cc-----------

#include <stdio.h>
#include "classA.h"

void A::doSomething1() {
  printf("in myClass1::doSomething1\n");
}

void A::doSomething2() {
  printf("in myClass1::doSomething2\n");
}

//---------------exec.ah-----------


#ifndef __exec_ah__
#define __exec_ah__
#include <stdio.h>

aspect myAspect {
  advice execution("% A::doSomething%(...)") : before()  {
     printf("advice before(exec) %s\n", JoinPoint::signature());

  }
};
#endif
//-----------------------------------

This code is in folder named "lib". The woven include files are generated by the following command line executed in the parent directory:

ac++ -v1 --config puma.config -I lib  -p lib  -d lib-inc -i

So, the folder lib-inc is created by ac++ with the woven files classA.h and exec.ah.

For the application, I have the following main.cc file in the "app" folder.

//------------- main.cc --------------
#include <stdio.h>
#include "classA.h"

int main() {
  A a1;
  a1.doSomething1();
  a1.doSomething2();
}
//-------------------------------------

The folder structrure is now:
- test (where ac++ is always called)
---- lib
---- lib-inc
---- app

In the app I have no aspects yet. Sill I try to use ac++ with the following command line from the "test" folder.

ac++ -v9 --config puma.config -I lib-inc  -p app  -d app-out

The result is:

[fafonso at pc-fca-at-g weavetwice]$ ./weave2b
* Running ac++ 1.0pre3
* Simple Dependency Check
* Handling Translation Unit `main.cc'.
  - Path "app/main.cc"
  - Inserting namespace AC
  - Parsing ...
./weave2b: line 1:  4364 Segmentation fault      

Considering that is possible to weave more than one time in AspectC++. I suppose that either there is a bug or I am doing something wrong.

Any help?

Francisco Afonso









_________________________________________________________________
Climb to the top of the charts! Play the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20080124/8681a984/attachment.html>


More information about the aspectc-user mailing list