Skip to content
Tcl Source Code View Ticket
Login

View Ticket

namespace imported command isn't traced

Closed / Duplicate1049413fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-10-18 16:21:40
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.
msoferplain2004-10-18 23:26:52
Logged In: YES 
user_id=148712

Duplicate of Bug #582506
Log in (anonymous is fine) to add a comment.