Re: A tcl command logger?
From: George Petasis (petasis_at_iit.demokritos.gr)
Date: 03/24/05
- Next message: Bruce Hartweg: "Re: How to emulate the Expect WAIT command in pure TCL"
- Previous message: Earl Grieda: "How to emulate the Expect WAIT command in pure TCL"
- In reply to: Helmut Giese: "Re: A tcl command logger?"
- Next in thread: Don Porter: "Re: A tcl command logger?"
- Reply: Don Porter: "Re: A tcl command logger?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Mar 2005 22:54:28 +0200
Helmut Giese wrote:
> On Thu, 24 Mar 2005 17:56:26 +0200, "Georgios Petasis"
> <petasis@iit.demokritos.gr> wrote:
>
>
>>Hi all,
>>
>>As I am facing a problem of Tcl/Tk crashing without
>>having access to the machine of the crash or the possibility
>>of debugging it, I want to write a small script that will
>>log each command in the global namespace in a log file.
>>
>>I plan to move all commands from the :: namespace into
>>another namespace, and substitute each command with a
>>new one that will log the command & its arguments into a file,
>>and then call the original command. As this is very similar to
>>what a debugger does, I was wondering if such a facility is
>>already available that I can use, before I code it my self.
>>Any ideas?
>
> HI George,
> newer versions of Tcl allow you to set traces on command execution,
> and even fine-graining this whether you want to trace 'enter' or
> 'leave' - I forgot what I knew about them but the man pages should
> provide all necessary details.
> HTH
> Helmut Giese
Thank you both for your answers. However, as it has to run to
tcl 8.4, I finally write a small script to do the task. What was
surprising though was to find that the 'if' command calls
'expr' to make the evaluation. While it makes some sense,
I would have expected 'if' to call the C API that
'expr' uses directly. This means that:
a) 'expr' is a more important command than I have always thought. I
always regarded 'expr' as a tool for doing some math. But it turns out that
its efficency is vital for the efficiency of tcl in general.
(Well, I am a little biased from the long thread "So slow Tcl :(")
b) If anybody messes with 'expr', also 'if' (and possibly 'while',
'for', etc) will be affected. Is this something expected? I know
that tcl is such a dynamic language, but I always had the impression
that 'if', 'for', 'while', etc will continue to work as expected
as long as I don't touch them. But removing 'expr' will
also render useless all these functions. Is this a feature or a bug?
George
- Next message: Bruce Hartweg: "Re: How to emulate the Expect WAIT command in pure TCL"
- Previous message: Earl Grieda: "How to emulate the Expect WAIT command in pure TCL"
- In reply to: Helmut Giese: "Re: A tcl command logger?"
- Next in thread: Don Porter: "Re: A tcl command logger?"
- Reply: Don Porter: "Re: A tcl command logger?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|