From: SourceForge.net <no...@so...> - 2013-04-29 14:41:37
|
Bugs item #3612021, was opened at 2013-04-27 02:27 Message generated for change (Comment added) made by jerrylipeng You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3612021&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 17. Commands I-L Group: current: 8.5.14 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jerry Li (jerrylipeng) Assigned to: Andreas Kupries (andreas_kupries) Summary: info frame gives mismatching line number with info body Initial Comment: See the following example: ----------------------------------------------------------------- $tclsh % proc test {} { puts "line 2: [info frame 0]" # line 3 \ line 4 puts "line 5: [info frame 0]" } % test line 2: type proc line 2 cmd {info frame 0} proc ::test level 0 line 5: type proc line 5 cmd {info frame 0} proc ::test level 0 % info body test puts "line 2: [info frame 0]" # line 3 line 4 puts "line 5: [info frame 0]" % ----------------------------------------------------------------- The second 'info frame' gives line 5 which is reasonable. But it is in line 4 of the string returned by 'info body' (because '\' is removed and line 3 and line 4 are joined together.) Is it possible make the line numbers consistent between 'info frame' and 'info body'? ---------------------------------------------------------------------- >Comment By: Jerry Li (jerrylipeng) Date: 2013-04-29 07:41 Message: Thanks for your replies:) I was just trying to write a script for debugging general tcl scripts in command line mode. I use trace, info frame and info body. I expect that user can debug a proc (stop at the proc entry, step in/out/over, run to a specified line number..) Actually my script works well except that the proc body contains '\' at the end of a line. In this scenario, info body gives a line number that doesn't match info body, then my script tells the user an 'incorrect' line number. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2013-04-29 07:05 Message: I'm not convinced it is a bug at all at the moment. Put the code into a file to [source] and the line numbers can easily stop matching at all. (That's because they are line numbers *within the file* and not [info body].) IMO, [info frame] is pretty strange. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2013-04-29 06:51 Message: passing to the [info frame] maintainer. My comment: Since Tcl eliminates the escaped newlines, you have to make a choice. Have the reported line number agree with the lines as stored in the file, or agree with the value reported from [info body]. I think the existing choice is a reasonable guess about which is more useful. The other way out would be changes deep in the parser to make Tcl stop stripping out the escaped newlines. This is on the list of things to consider for Tcl 9, but is likely too disruptive to consider before then. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3612021&group_id=10894 |