| Ticket UUID: | 3484621 | ||
| Title: | Epoch does not increase when adding a trace | ||
| Type: | Bug | Created on: | 2012-02-05 12:44:01 |
| Submitter: | johannes-kuhn | Assigned to: | msofer |
| Subsystem: | 47. Bytecode Compiler | Severity: | |
| Priority: | 8 | Last modified: | 2012-02-06 23:47:03 |
| Status: | Closed | Closed by: | msofer |
| Resolution: | Fixed | Closed on: | 2012-02-06 16:47:03 |
| Version: | obsolete: 8.5.11 | ||
| Description: | ||||
Different bytecode depending if there is a trace execution on a (bytecode) inlined command.
Testcase:
proc putargs {args} {puts $args}
proc test1 {t} {if {[string equal $t "test"]} {puts "foo"}}
test1 -; #compile
trace add execution ::string enter putargs
proc test2 {t} [info body test1]; # create a second proc with the same body
test2 -; # compile
tcl::unsupported::disassemble proc test1
tcl::unsupported::disassemble proc test2
| ||||
| User Comments: | ||||
johannes-kuhn added on 2012-02-05 20:08:59:
<schelte> Johannes13, I would think the most important issue is that command tracing doesn't work if the trace is defined after the code has been executed before. You don't seem to mention that very clearly. dkf added on 2012-02-06 21:37:27:
Ugh, tracing a compiled command should indeed cause the epoch to bump. Yuck (as that causes a lot of cost) but probably unavoidable. msofer added on 2012-02-06 22:26:42:
Is this a bug in the trace, or a bug in unsupported::disassemble? I do not see a trace malfunction:
% proc putargs {args} {puts $args}
% proc test1 {t} {if {[string equal $t "test"]} {puts "foo"}}
% test1 -; #compile
% test1 test
foo
% trace add execution ::string enter putargs
% test1 test
{string trim {test1 test}} enter
foo
sebres added on 2012-02-06 22:44:43:
to Miguel:
the bug is probably by "epoch", cause the trace "string equal" should be displayed.
The output "{string trim {test1 test}} enter" you see, it's an another trace (possible from "history" command of tclsh).
Just create after trace "test2" like this:
% proc test2 {t} {if {[string equal $t "test"]} {puts "foo"}}
% test2 -
{string trim {test2 -}} enter
!!!!!!!!!!!!
{string equal - test} enter
!!!!!!!!!!!!
msofer added on 2012-02-06 22:52:24:
Indeed - thanks. Upping prio msofer added on 2012-02-06 23:47:03:
allow_comments - 1 Fixed in core-8-5-branch and trunk | ||||
