Skip to content
Tcl Source Code History Of Ticket 3612021fffffffffffffffffffffffffffffffff
Login

History Of Ticket 3612021fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 3612021fffffffffffffffffffffffffffffffff

  1. Ticket change [6546b7e1f6] (rid 102513) by jerrylipeng on 2013-04-27 09:27:43:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      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'?
      
      
    4. foundin initialized to: "None"
    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: "jerrylipeng"
    10. subsystem initialized to: "None"
    11. title initialized to:
      info frame gives mismatching line number with info body
      
    12. type initialized to: "Bug"
  2. Ticket change [2b3d945df9] (rid 118708) by dgp on 2013-04-29 20:51:46:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      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.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  3. Ticket change [630ff35e9b] (rid 92511) by dkf on 2013-04-29 21:05:36:

    1. foundin changed to: "current: 8.5.14"
    2. icomment:
      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.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. subsystem changed to: "17. Commands I-L"
    6. username: "dkf"
  4. Ticket change [da58d82d91] (rid 107763) by jerrylipeng on 2013-04-29 21:41:37:

    1. icomment:
      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.
      
      
    2. login: "jerrylipeng"
    3. mimetype: "text/plain"
    4. username: "jerrylipeng"
  5. Ticket change [80bed6bef8] (rid 116918) by andreas_kupries on 2013-04-30 00:31:14:

    1. icomment:
      [I seem to repeat things others have said in previous comments].
      
      Your wish is complementary to the work work of 2009-08-25 (see changelog).
      
      Basically, before the ref'd change info frame behaved as you wanted, matching the info body, but then the line number was not matching to the actual location in the _file_ the code came from. After the change the line number points to the correct line in the file, but is now not matching info body.
      
      The issue is indeed that some stage of the parsing process of Tcl eliminates continuation lines and joining lines, and making this visible. At which point external script (in the file), and internal representation (as shown by info body) differ.
      
      There is no way to satisfy both with regard to line numbers. [info frame], as a debugging tool sides to match with the external representation, that which you have open in your editor.
      
      I would stay with that, as the more common use case.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. resolution changed to: "Wont Fix"
    5. username: "andreas_kupries"