Skip to content
Tcl Source Code History Of Ticket 1695203
Login

History Of Ticket 1695203

Artifacts Associated With Ticket 1695203

  1. Ticket change [9f36212cec] (rid 96598) by dgp on 2007-04-05 19:16:10:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      With this script:
      
      $ cat ~/tip280.tcl
      puts "this
      is
      [info frame 0]
      a test"
      
      I see the [info frame] command
      on line 3 of the script file.
      But running the script reports:
      
      $ ./tclsh ~/tip280.tcl
      this
      is
      type source line 1 file /home/dgp/tip280.tcl cmd {info frame 0} level 0
      a test
      
      Instead of reporting the line
      of the command, as documented,
      [info frame] is reporting the
      line on which the word containing
      the command begins.  Those are
      not always the same.
      
      
      
    4. foundin initialized to: "obsolete: 8.5a6"
    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: "dgp"
    10. subsystem initialized to: "45. Parsing and Eval"
    11. title initialized to: "[info frame] reports wrong line"
    12. type initialized to: "Bug"
  2. Ticket change [3786b3431f] (rid 107297) by mercurio on 2007-06-28 06:07:01:

    1. icomment:
      Logged In: YES 
      user_id=44475
      Originator: NO
      
      The same thing happens with continued lines.  Try this in tclsh85:
      
      proc printStack {} {
          for {set i [info frame]} {$i >= 1} {incr i -1} {
              set d [info frame $i]
              switch [dict get $d type] {
                  source {lappend stack "[dict get $d file] [dict get $d line]"}
                  proc {lappend stack "[dict get $d proc] [dict get $d line]"}
              }
          }
          puts stderr [join $stack \n]
      }
      
      proc test {} {
              set x  \
                      1
      
              printStack
      }
      
      test
      
      % tclsh85 test1.tcl
      test1.tcl 3
      test1.tcl 20
      test1.tcl 24
      
      The line where printStack is invoked is 21, not 20.  Remove the
      continued line at the beginning of test{} and the output is correct.
      
      I'm also seeing a lot of "proc" frames that have incorrect
      positive line numbers (probably due to the same line counting problem)
      or line numbers that are -1.  I haven't been able to come up with a
      short example that demonstrates this, but it shows up repeatably in
      a debugger I'm trying to implement (using trace add exec .. enterstep).
      
      
    2. login: "mercurio"
    3. mimetype: "text/plain"
    4. username: "mercurio"