#1967 imported cmds do not fire exec traces

obsolete: 8.4b2
open
7
2008-12-07
2002-07-16
Don Porter
No

% 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.

Discussion

  • Don Porter

    Don Porter - 2002-07-16

    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.

     
  • miguel sofer

    miguel sofer - 2004-07-13

    Logged In: YES
    user_id=148712

    Invocation of hidden commands should also go through TEOVI.
    Actually, every command invocation should go thorugh TEOVI.

     
  • miguel sofer

    miguel sofer - 2004-10-18

    Logged In: YES
    user_id=148712

    Reported again as Bug #1049413

     
  • Martin Lemburg

    Martin Lemburg - 2007-04-02

    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?

     
  • Don Porter

    Don Porter - 2008-07-14

    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?

     
  • Don Porter

    Don Porter - 2008-07-14
    • priority: 5 --> 9
     
  • miguel sofer

    miguel sofer - 2008-07-21

    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.

     
  • miguel sofer

    miguel sofer - 2008-07-21
    • assigned_to: msofer --> dgp
     
  • Don Porter

    Don Porter - 2008-12-07
    • priority: 9 --> 7
     
  • Don Porter

    Don Porter - 2008-12-07

    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