<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi.<br><br>This message follows an October/2007 thread:<br><br>http://p15111082.pureserver.info/pipermail/aspectc-user/2007-October/001175.html<br><br>I am still receiving a "segmentation fault" from ac++ when weaving for the second time. <br><br>To check if the problem belongs to my code, I wrote a very simple example.<br>The first weaving is supposed to affect the following files:<br><br>//---------------classA.h-----------<br>#ifndef __classA_h_<br>#define __classA_h_<br><br>class A {<br>public:<br> void doSomething1(); <br> void doSomething2(); <br>};<br>#endif<br><br>//---------------classA.cc-----------<br>
#include <stdio.h><br>#include "classA.h"<br><br>void A::doSomething1() {<br> printf("in myClass1::doSomething1\n");<br>}<br><br>void A::doSomething2() {<br> printf("in myClass1::doSomething2\n");<br>}<br><br>//---------------exec.ah-----------<br>
#ifndef __exec_ah__<br>#define __exec_ah__<br>#include <stdio.h><br><br>aspect myAspect {<br> advice execution("% A::doSomething%(...)") : before() {<br> printf("advice before(exec) %s\n", JoinPoint::signature());<br><br> }<br>};<br>#endif<br>//-----------------------------------<br><br>This code is in folder named "lib". The woven include files are generated by the following command line executed in the parent directory:<br><br>ac++ -v1 --config puma.config -I lib -p lib -d lib-inc -i<br><br>So, the folder lib-inc is created by ac++ with the woven files classA.h and exec.ah.<br><br>For the application, I have the following main.cc file in the "app" folder.<br><br>//------------- main.cc --------------<br>#include <stdio.h><br>#include "classA.h"<br><br>int main() {<br> A a1;<br> a1.doSomething1();<br> a1.doSomething2();<br>}<br>//-------------------------------------<br><br>The folder structrure is now:<br>- test (where ac++ is always called)<br>---- lib<br>---- lib-inc<br>---- app<br><br>In the app I have no aspects yet. Sill I try to use ac++ with the following command line from the "test" folder.<br><br>ac++ -v9 --config puma.config -I lib-inc -p app -d app-out<br><br>The result is:<br><br>[fafonso@pc-fca-at-g weavetwice]$ ./weave2b<br>* Running ac++ 1.0pre3<br>* Simple Dependency Check<br>* Handling Translation Unit `main.cc'.<br> - Path "app/main.cc"<br> - Inserting namespace AC<br> - Parsing ...<br>./weave2b: line 1: 4364 Segmentation fault <br><br>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.<br><br>Any help?<br><br>Francisco Afonso<br><br><br><br><br><br><br><br><br><br /><hr />Climb to the top of the charts! Play the word scramble challenge with star power. <a href='http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan' target='_new'>Play now!</a></body>
</html>