Tcl Source Code

View Ticket
Login
Ticket UUID: 1065378
Title: cannot delete trace
Type: Bug Version: obsolete: 8.4.7
Submitter: keithv Created on: 2004-11-12 19:00:52
Subsystem: 46. Traces Assigned To: dgp
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-11-16 04:39:06
Resolution: Fixed Closed By: dgp
    Closed on: 2004-11-15 21:10:10
Description:
I'm using 8.4.7 and I find that I cannot delete a trace 
using "trace remove variable" while I can with the soon-
to-be-obsolete "trace vdelete".

Example script:
proc Trace {var1 var2 op} {puts "in 
Trace: '$var1' '$var2' '$op'"}
trace variable myVar w Trace
trace info variable myVar                       ;# There it is

trace remove variable myVar w Trace             ;# error 
must be "write"
trace remove variable myVar write Trace
trace info variable myVar                       ;# Still there

trace vdelete myVar w Trace                     ;# works
trace info variable myVar                       ;# gone

Keith
User Comments: dgp added on 2004-11-16 04:39:06:
Logged In: YES 
user_id=80530

fixed for 8.4.8 and 8.5a2.

dgp added on 2004-11-16 04:10:13:

File Added - 108897: 1065378.patch

dgp added on 2004-11-16 04:10:10:
Logged In: YES 
user_id=80530

Here's a patch.

dgp added on 2004-11-16 03:17:49:
Logged In: YES 
user_id=80530

oops.  spoke too soon.  Got a fix
coming after all.

dgp added on 2004-11-16 03:00:52:
Logged In: YES 
user_id=80530


after looking into this, it seems that
because the [trace] syntax changed
at the same time that the acceptable
values for variable trace operations
changed (rwua -> read write unset array),
the consequence is the two forms of
variable traces are not interchangeable.
(They differ notably in the ops arguments
passed to the trace itself).  So, the only
viable workaround it to just be consistent.
Either stick with the old form, or convert
fully to the new form.  Don't try to mix and
match.

dgp added on 2004-11-13 07:33:47:
Logged In: YES 
user_id=80530


confirmed on the core-8.4
tip of development and on
the HEAD.

This likely traces back to
a mistaken implementation
choice that kept support for
the old subcommands in place
with a separate set of code from
the new subcommands, rather
than doing it wrapper style
with the old name ultimately 
invoking the new implementation.

Thanks for the bug report.
Until a fix shows up, work around
it by balancing [trace variable] with
[trace vdelete] and [trace add] with
[trace remove].

Attachments: