Skip to content
Tcl Source Code History Of Ticket 281138
Login

History Of Ticket 281138

Artifacts Associated With Ticket 281138

  1. Ticket change [e8f12d7eac] (rid 104728) by quantifier on 2009-06-24 08:48:13:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      trace manpage says:
      For leave and leavestep operations: command command-string code result op
      [...] result [gives] the result string.
      When multiple traces are set on name, then [...] for leave and leavestep operations, the traced commands are invoked in the original order of creation.
      
      However, it doesn't say that the 'result' is taken from original command only for first trace. Each following trace takes 'result' from previous traced command. This is not completely unwanted, but rather unexpected. For multiple traces, each of them has to return it's 'result' argument, in other case next trace might fail. Manual should be clearer on that.
      
      Example:
      % proc traced {} {return hello}
      % proc trace_1st {cmdstr code result op} {puts "first: $result"; return first}
      % trace add execution traced leave trace_1st
      % traced
      first: hello
      hello
      % proc trace_2nd {cmdstr code result op} {puts "second: $result"; return second}
      % trace add execution traced leave trace_2nd
      % traced
      first: hello
      second: first
      hello
      %
      
    4. foundin initialized to: "obsolete: 8.5.7"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "quantifier"
    10. subsystem initialized to: "46. Traces"
    11. title initialized to: "unexpected 'result' in trace execution leave"
    12. type initialized to: "Bug"
  2. Ticket change [6d7ed4afad] (rid 140021) by anonymous on 2014-09-23 11:07:39:

    1. closer changed to: "nobody"
    2. comment changed to:
      trace manpage says:
      For leave and leavestep operations: command command-string code result op
      [...] result [gives] the result string.
      When multiple traces are set on name, then [...] for leave and leavestep operations, the traced commands are invoked in the original order of creation.
      
      However, it doesn't say that the 'result' is taken from original command only for first trace. Each following trace takes 'result' from previous traced command. This is not completely unwanted, but rather unexpected. For multiple traces, each of them has to return it's 'result' argument, in other case next trace might fail. Manual should be clearer on that.
      
      Example:
      % proc traced {} {return hello}
      % proc trace_1st {cmdstr code result op} {puts "first: $result"; return first}
      % trace add execution traced leave trace_1st
      % traced
      first: hello
      hello
      % proc trace_2nd {cmdstr code result op} {puts "second: $result"; return second}
      % trace add execution traced leave trace_2nd
      % traced
      first: hello
      second: first
      hello
      %
      
    3. foundin changed to: "8.6.2"
    4. login: "anonymous"
    5. mimetype: "text/plain"
    6. severity changed to: "Minor"
  3. Ticket change [b52a03a3b4] (rid 258408) by serhiy.storchaka on 2026-10-17 06:59:46:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      8.4 passed the result of the traced command to every leave trace; since 8.5 TclCheckExecutionTraces() and TclCheckInterpTraces() restore the saved result only after the last trace, so each trace gets the result of the previous one. The documentation describes the 8.4 behaviour.
      Proposed fix in branch [/timeline?r=leave-trace-own-result|leave-trace-own-result]: restore the result after each trace. Test trace-40.2.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"