Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e8f12d7eac071e188a86ee5f5fae7264ad158cd2
Ticket: 2811381fffffffffffffffffffffffffffffffff
unexpected 'result' in trace execution leave
User & Date: quantifier on 2009-06-24 08:48:13
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. 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
    %
    
  4. foundin changed to: "obsolete: 8.5.7"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "quantifier"
  10. subsystem changed to: "46. Traces"
  11. title changed to: "unexpected 'result' in trace execution leave"
  12. type changed to: "Bug"