[Xotcl] full trace support for XOTcl methods/procs

Gustaf Neumann neumann at wu-wien.ac.at
Sat Jan 5 09:24:09 CET 2008


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
>   



More information about the Xotcl mailing list