[aspectc-user] pointers

Jamal Siadat siadat at cpsc.ucalgary.ca
Thu Jul 14 12:04:00 CEST 2005


Hi,

haha, yes they do start at 0 :) but I was trying to capture the second
argument for ("% A::a(...)") .. but this one gives out the argument for
the dummy method. I actually tried:
cout << "in the advice b is "<<*static_cast<float*>(tjp->arg(1))  <<endl;

as shown in trace.ah ( that I previously attached). But it seems that its
only capturing the dummy parameters :(. I also tried args and it wouldn't
work.

Thanks




> Hi,
>
> Jamal Siadat wrote:
>> And for the Bug:
>>
>> I may have acciedently discovered a bug! I have attached a couple of
>> files
>> that you may look at. The interesting thing is that if you change the
>> before advice to an after advice in the aspect you'll get a segmentation
>> fault when you run it!!!!!
>> Oh and can anyone tell me how I can get away with using the after advice
>> and being able to capture the arguments. As you can see I've tried
>> *tjp->arg<1>() as well but it doesn't seem to work.
>>
>>
>> Thanks in advance,
>
> computers start counting at 0 ;-).
>
> This modified aspect works for me:
>
> ---
> aspect Cache  {
> pointcut calls()=  call("float dummy(...) ") && within ("% A::a(...)") ;
> advice calls() :after (){
>
> // cout << "b is "<< *tjp->arg<1>() <<endl;
> cout << "in the advice b is "<< *tjp->arg<0>()  <<endl;
> }
> };
> ---
>
> I suppose the problem was that you used the unsafe dynamic join point
> API to access an argument that did not exist. The result is
> undeterministic behavior.
>
> Best regards,
>
> Olaf
>





More information about the aspectc-user mailing list