Skip to content
Tcl Source Code View Ticket
Login

View Ticket

imported cmds do not fire exec traces

Open582506ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 18 years ago
Descriptionplain2002-07-16 21:28:05
% info patch
8.4b2
% namespace eval export {
        namespace export foo
        proc foo {} {}
}
% trace add execution export::foo enter {puts FOO ;# }
% namespace eval import namespace import ::export::foo
% export::foo
FOO
% import::foo
%

The problem arises apparently because
InvokeImportedCmd() directly runs the
command procedure, rather than calling
on TclEvalObjvInternal() where the
execution tracing is handled.

If TclEvalObjvInternal() has become the
one central place where command
evaluation occurs, then imported
commands should go through there as well.
dgpplain2002-07-17 04:47:46
Logged In: YES 
user_id=80530


The inverse is also a problem:

% namespace eval export {
namespace export foo
proc foo {} {}
} 
% namespace eval import namespace import ::export::foo
% trace add execution import::foo enter {put FOO ;#}
% import::foo
FOO
% export::foo
% 


As discussed on TCLCORE, execution traces should
attach to the command procedure (or equivalently,
the original name ([namespace origin]) of a command),
while rename and delete traces attach to the name only.
msoferplain2004-07-13 22:05:02
Logged In: YES 
user_id=148712

Invocation of hidden commands should also go through TEOVI.
Actually, every command invocation should go thorugh TEOVI.
msoferplain2004-10-18 23:27:24
Logged In: YES 
user_id=148712

Reported again as Bug #1049413
martinlemburgplain2007-04-02 20:57:04
Logged In: YES 
user_id=802134
Originator: NO

I got in touch with this problem while using a selfmade command logging and runtime measurement package and found it very disattracting, that I have to care about this.

Since the problem is still alive, even in tcl 8.5a4, ... is there a chance to help to get rid of this, to close this bug in the next 8.4 and 8.5 releases?
dgpplain2008-07-14 23:32:34
Logged In: YES 
user_id=80530
Originator: YES


If the massive NRE/drop an
asteroid on TEOVI changes
haven't fixed this one, perhaps
they should?
msoferplain2008-07-21 23:29:53
Logged In: YES 
user_id=148712
Originator: NO

Fix committed to HEAD (I think). Please verify and add tests.

No simple backport is possible, implementation uses NRE.
dgpplain2008-12-07 22:28:15
this bug is fixed.  Report
is still open only as a reminder
to supply missing tests.

Missing tests isn't a blocker
for 8.6b1
Log in (anonymous is fine) to add a comment.