Tcl Source Code

Artifact [6cb54e4679]
Login

Artifact 6cb54e46798cee0e61f0fbc5cd94b19f86406807:

Attachment "traceExecBug.tcl" to ticket [615043ffff] added by vincentdarley 2002-09-26 23:29:25.

proc msg {txt} {
    set a [::msgcat::mc $txt]
    update idletasks
}

proc foo {} {
    msg "hi"
    set a 1
}

proc log {args} {
    puts [string range $args 0 40]
}

trace add execution foo {enter leave enterstep leavestep} log

puts stderr "tracing without any idletasks"
puts stderr "notice how there is a line '{msg hi} 0 {} leavestep'"
update
foo

puts stderr "tracing with idletask"
after idle {puts idle} ; foo

puts stderr "Notice how in the second run, the following lines"
puts stderr "are missing {
    {msg hi} 0 {} leavestep
    {set a 1} enterstep
    {set a 1} 0 1 leavestep
}"

catch {console show}