View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] full trace support for XOTcl methods/procs

From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Sat, 05 Jan 2008 09:25:01 +0100

Kristoffer Lawson schrieb:
> I understand that requirement. That is why I am suggesting you use a
> combination of XOTcl filters and [trace]. It might be that even
> [trace] is enough, if it catches all Tcl command calls (I haven't
> looked at it). If not, have XOTcl filters for the XOTcl stuff and
> [trace] for the rest?
>

one can set enterstep calls on next

   proc CALL args {puts "CALL $args"}
   proc EXIT args {puts "EXIT $args"}
   trace add execution next enterstep CALL
   trace add execution next leavestep EXIT

and maybe add these two traces in the filter once on the first call (e.g.
controlled via a global variable).

Alternatively, one could define a "proc n args {next}", register the traces
on it and use in the filter "set r [n]" instead of "set r [next]". In
this case multiple
filter registrations are not a problem.

It is as well possible to register enterstep on the object/class names,
   trace add execution b1 enterstep CALL
   trace add execution b1 leavestep EXIT
but there you might get as well too much output.

-gustaf neumann
> / http://www.scred.com/
> / http://www.fishpool.com/~setok/
>
>
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
>