Artifacts Associated With Ticket 1695203
Ticket change [9f36212cec] (rid 96598) by dgp on 2007-04-05 19:16:10:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- 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. - foundin initialized to: "obsolete: 8.5a6"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "[info frame] reports wrong line"
- type initialized to: "Bug"
Ticket change [3786b3431f] (rid 107297) by mercurio on 2007-06-28 06:07:01:
- 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). - login: "mercurio"
- mimetype: "text/plain"
- username: "mercurio"
- icomment: