Re: [abc-users] Tracematch trace output

From: Pavel Avgustinov <pavel.avgustinov_at_magd.ox.ac.uk>
Date: Mon, 25 Feb 2008 00:12:08 +0000

While indeed the example in the paper is theoretical and intended to
illustrate the chosen semantics, the natural way of obtaining such a
trace from an actual program execution is with standard AspectJ: For
each joinpoint of interest, write a piece of before() advice to print
the "enter: ..." line and a piece of after() advice to print the
"exit:..." line. The event numbering is trivial to do with a counter in
aspect field. You won't be able to print the names of local variables
(v, w in the example), but you can print the actual runtime objects,
which is of course what the tracematch semantics makes reference to.

HTH,
- Pavel

Alan Teoh wrote:
> Hi again,
>
> Is it possible for me to produce a trace output(perhaps via an
> argument on the abc compiler) via tracematches like the one in the
> paper(Adding Trace Matching with Free Variables to AspectJ)?
> I'm talking about the one produced in page 10:
>
> Given tracematch
> tracematch (X x) {
> sym f before:
> call (* f(..)) && target(x);
> sym g after:
> call (* g(..)) && target(x);
> f g
> {
> System.out.println("fg!");
> }
> }
>
> And the following method calls
> v.f(); v.h(); w.g(); w.f(); v.g();
>
> The trace is then as follows:
>
> e1 enter: call(void FG.f()) on v
> e2 enter: execution(void FG.f()) on v
> e3 exit: execution(void FG.f()) on v
> e4 exit: call(void FG.f()) on v
> e5 enter: call(void FG.h()) on v
> e6 enter: execution(void FG.h()) on v
> e7 exit: execution(void FG.h()) on v
> e8 exit: call(void FG.h()) on v
> e9 enter: call(void FG.g()) on v
> e10 enter: execution(void FG.g()) on w
> e11 exit: execution(void FG.g()) on w
> e12 exit: call(void FG.g()) on w
> e13 enter: call(void FG.f()) on w
> e14 enter: execution(void FG.f()) on w
> e15 exit: execution(void FG.f()) on w
> e16 exit: call(void FG.f()) on w
> e17 enter: call(void FG.g()) on v
> e18 enter: execution(void FG.g()) on v
> e19 exit: execution(void FG.g()) on v
> e20 exit: call(void FG.g()) on v
>
> Or was that just a theoretical trace?
> Thanks.
>
Received on Mon Feb 25 2008 - 00:14:04 GMT

This archive was generated by hypermail 2.2.0 : Wed Feb 27 2008 - 16:50:10 GMT