Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1bad585959e5e3a7c4464201ebb3b5716da2729e
Ticket: 1049413fffffffffffffffffffffffffffffffff
namespace imported command isn't traced
User & Date: vincentdarley on 2004-10-18 16:21:40
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    If I create a command in a namespace, set an execution
    trace on it, and then import it into a different
    namespace, on calling the command, no execution traces
    fire.
    
    # Set things up
    namespace eval A {
       proc foo {a} { puts $a }
       namespace export foo
    }
    proc report {args} { puts stderr $args }
    trace add execution A::foo \
      {enter leave enterstep leavestep} { report }
    namespace import A::foo
    
    # This triggers execution traces
    A::foo hello
    # This doesn't
    foo hello
    
    --
    
    This is rather surprising given the imported command is
    just a link to the original command.  In fact the
    following works
    
    interp alias {} bar {} A::foo
    # This does trigger execution traces
    bar
    
    --
    
    Therefore it appears the bug is that execution of
    namespace imported commands doesn't trigger execution
    traces on those commands.
    
    
  4. foundin changed to: "obsolete: 8.5a2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "vincentdarley"
  9. subsystem changed to: "45. Parsing and Eval"
  10. title changed to: "namespace imported command isn't traced"
  11. type changed to: "Bug"