[aspectc-user] Re: execution capture inside a given method
os at aspectc.org
Fri Feb 6 10:00:51 CET 2009
Meriam Kallel wrote:
> I want to capture the execution of a method /m1()/ only when it is
> executed inside a given method /m2()/:
> void m2()
> knowing that /m1()/ is executed in other functions of the code.
> I don’t know if this is possible with aspectc++ or not.
> Thank you for your help.
yes, this is possible. You can use the following pointcut expression:
call("% m1()") && within("% m2()")
If you also want your advice to be executed in cases where the control
flow indirectly reaches m1() from m2(), e.g. m2 calls m3, m3 calls m1,
execution("% m1()") && cflow(execution("% m2()")
The latter method is more robust, but is a little less efficient.
PS: If you want to post on aspectc-user at aspectc.org, you have to be
More information about the aspectc-user