Skip to content
Tcl Source Code History Of Ticket 2868499
Login

History Of Ticket 2868499

Artifacts Associated With Ticket 2868499

  1. Ticket change [35b8947a8a] (rid 106989) by ferrieux on 2009-09-27 23:57:21:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Here is a crude but functional implementation of TIP #348.
      The variable ::errorStack, comes to life when defined (which is not the case by default, to avoid any performance hit).
      While unwinding, it is populated by substituted argslists as described in the TIP.
      It is automatically reset (to the empty list)  whenever ::errorInfo is. (But this leaves it enabled. To disable it, unset it.)
      
      (Among crudities: uses ::errorStack instead of ::tcl::errorStack, doesn't pay attention to code style, no test cases.
      Also, it inserts two fields in the private interp structure, right in the middle, not at the end. ABI hazard, don't forget to 'make clean' after applying  ;-)
      
      
      
    4. foundin initialized to: "TIP Implementation"
    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: "ferrieux"
    10. subsystem initialized to: "None"
    11. title initialized to: "TIP #348: Substituted errorStack"
    12. type initialized to: "Patch"
  2. Ticket change [f359738d82] (rid 129691) by ferrieux on 2009-09-28 06:57:24:

    1. icomment:
      
      
      File Added - 344544: errorstack.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [83f9e360ec] (rid 117469) by ferrieux on 2009-09-29 05:48:07:

    1. icomment:
      
      
      File Added - 344684: errorstack.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [1e1b792821] (rid 90922) by ferrieux on 2009-09-29 05:48:21:

    1. icomment:
      
      
      File Deleted - 344544: 
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [cbbff9ad72] (rid 95574) by ferrieux on 2009-09-29 06:00:27:

    1. icomment:
      First slight improvement: explicitly skip iPtr->rootFramePtr, like in [info level $n], since the root frame will always have argc==0. This removes the parasitic {} always found at the end of ::errorStack, and also an extra one generated by [tailcall] and [coroutine].
      
      Next improvements planned:
      
      (1) make the on/off switch more efficient by using a linked boolean var rather than the existence of ::errorStack which costs a hash lookup when negative.
      
      (2) make the list building slightly more efficient by using a backbone of Tcl_Obj as Cons'es (linked list), and turning it into a Tcl list only in a read trace attached to ::errorStack (instead of directly lappending as is currently the case. This construction is wasted in caught, expected exception handling where the errorStack is not used).
      
      (3) proper ::tcl namespace + test cases.
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [cba1bb95d8] (rid 95552) by ferrieux on 2009-10-05 07:40:46:

    1. icomment:
      
      
      File Added - 345341: errorstack.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  7. Ticket change [07de58fa25] (rid 89478) by ferrieux on 2009-10-05 07:41:09:

    1. icomment:
      
      
      File Deleted - 344684: 
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  8. Ticket change [e50ad78712] (rid 88062) by ferrieux on 2009-10-05 07:46:02:

    1. icomment:
      Mostly done.
      - now the var is ::tcl::errorStack and the flag is ::tcl::useErrorStack
      - zero overhead when ::tcl::useErrorStack is 0 (default)
      - uses a read trace to postpone var machinery until real use
      - uses an optimized in-place lappend/reset to keep the list intrep as much as possible (just as fast as the linked list approach IMO)
      TBD: test cases.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  9. Ticket change [f0dbc2dc00] (rid 109269) by ferrieux on 2009-10-05 15:11:33:

    1. icomment:
      
      
      File Added - 345369: errorstack.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  10. Ticket change [e00a9951b2] (rid 115122) by ferrieux on 2009-10-05 15:11:43:

    1. icomment:
      
      
      File Deleted - 345341: 
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  11. Ticket change [0c69681eb1] (rid 114171) by ferrieux on 2009-10-05 15:12:36:

    1. icomment:
      Complete with test cases now.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  12. Add attachment "errorstack.patch" [61322c985b] (rid 92204) by ferrieux on 2009-10-07 14:04:27.

  13. Ticket change [31812654cd] (rid 93438) by ferrieux on 2009-10-07 14:04:27:

    1. icomment:
      
      
      File Added - 345590: errorstack.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  14. Ticket change [4e8bd71357] (rid 125663) by ferrieux on 2009-10-07 14:04:37:

    1. icomment:
      
      
      File Deleted - 345369: 
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  15. Ticket change [41e5b92b90] (rid 116273) by ferrieux on 2009-10-20 23:12:30:

    1. icomment:
      
      
      File Added - 347441: errorstack2.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  16. Add attachment "errorstack2.patch" [b42788ec90] (rid 124979) by ferrieux on 2009-10-20 23:12:30.

  17. Ticket change [cdb0ad937f] (rid 95935) by ferrieux on 2009-10-20 23:17:22:

    1. icomment:
      Attaching a new patch, errorstack2.patch, fulfilling Joe's request of [info errostack ?interp?] and [dict get $d -errostack].
      I left the ::tcl::useErrorStack control variable for perf measurements:
          0 --> pristine HEAD
          1 --> just [info errorstack]
          2 ---> adds options dict entry -errorstack
      
      Note the implementation still uses ckalloc-based Tcl_NewListObj for argslist, pending proof that optimization is needed.
      Here are the figures:
      
      Case: Ten-fold catch ladder  use=0 ->    74.7924 microseconds per iteration
      Case: Ten-fold catch ladder  use=1 ->    76.7888 microseconds per iteration
      Case: Ten-fold catch ladder  use=2 ->    77.1977 microseconds per iteration
      Case: Single Catch with opt dict  use=0 ->    19.2613 microseconds per iteration
      Case: Single Catch with opt dict  use=1 ->    19.7608 microseconds per iteration
      Case: Single Catch with opt dict  use=2 ->    20.2815 microseconds per iteration
      
      with code:
      
      for {set i 1} {$i<10} {incr i} {
      proc f$i x "f[expr {$i+1}] \$x"
      }
      proc f10 x {error F10:$x}
      
      proc boo {} {error BOO}
      
      proc catchloop {} {
      for {set i 0} {$i<100000} {incr i} {
      if {[catch boo m d]} continue
      }
      }
      
      foreach {mm ss} {
      "Ten-fold catch ladder" {catch {f1 12}}
      "Single Catch with opt dict" {catch boo m d}
      } {
      
      foreach v {0 1 2} {
      set ::tcl::useErrorStack $v
      puts "Case: $mm  use=$v ->    [time $ss 10000]"
      }
      }
      
             
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  18. Add attachment "errorstack3.patch" [911f8ee6e4] (rid 120576) by ferrieux on 2009-10-23 07:56:29.

  19. Ticket change [1b092ac426] (rid 123077) by ferrieux on 2009-10-23 07:56:29:

    1. icomment:
      
      
      File Added - 347809: errorstack3.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  20. Ticket change [1b89364d0f] (rid 123168) by ferrieux on 2009-10-23 08:03:15:

    1. icomment:
      Extended patch adds bit value 4 as "flat list", ie errorstack is built as
       2 foo bar 1 baz 2 gnu gnats
      instead of
       {foo bar} baz {gnu gnats}
      Hence:
         use=0 : pristine
         use=1 : info errorstack
         use=2 : + dict
         use=5 : 1 + flatlist
         use=6 : 2 + flatlist
      
      Timings below:
      Case: Ten-fold catch ladder use=0 -> 101.3854 microseconds per iteration
      Case: Ten-fold catch ladder use=1 -> 106.2653 microseconds per iteration
      Case: Ten-fold catch ladder use=2 -> 106.8439 microseconds per iteration
      Case: Ten-fold catch ladder use=5 -> 103.5229 microseconds per iteration
      Case: Ten-fold catch ladder use=6 -> 103.7669 microseconds per iteration
      Case: Single Catch with opt dict use=0 -> 25.814 microseconds per iteration
      Case: Single Catch with opt dict use=1 -> 26.2905 microseconds per iteration
      Case: Single Catch with opt dict use=2 -> 27.0002 microseconds per iteration
      Case: Single Catch with opt dict use=5 -> 26.0665 microseconds per iteration
      Case: Single Catch with opt dict use=6 -> 26.783 microseconds per iteration
      
      Conclusion: while the gain for a tight catch loop is negligible, for a ten-fold  catch ladder building a long errorstack it is substantial: the flatlist roughly divides the overhead by three.
      
      However, the flatlist is a bit less convenient for the programmer.
      It could be postprocessed into a nested list in [info errorstack] but not int the options dict...
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  21. Ticket change [32325c613e] (rid 93571) by ferrieux on 2009-10-31 22:59:31:

    1. icomment:
      
      
      File Added - 348989: errorstack4.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  22. Add attachment "errorstack4.patch" [69be186b6b] (rid 103303) by ferrieux on 2009-10-31 22:59:31.

  23. Ticket change [934f76953a] (rid 105791) by ferrieux on 2009-10-31 23:01:39:

    1. icomment:
      Patch now restricted as per Joe's recommendations on tclcore:
       - always on
       - non-flat list
       - with options dict
      Test suite now needs fixes wherever the options dict was checked in extenso...
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  24. Ticket change [7e18e481ce] (rid 97350) by ferrieux on 2009-10-31 23:36:43:

    1. icomment:
      
      
      File Added - 348992: errorstack5.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  25. Add attachment "errorstack5.patch" [375a04c653] (rid 107255) by ferrieux on 2009-10-31 23:36:43.

  26. Ticket change [f93cccae73] (rid 91673) by ferrieux on 2009-10-31 23:37:42:

    1. icomment:
      Test suite now fixed. Thanks to -match glob :)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  27. Add attachment "errorstack6.patch" [9aea29eec5] (rid 111033) by ferrieux on 2009-11-04 00:20:26.

  28. Ticket change [517ef17f94] (rid 126149) by ferrieux on 2009-11-04 00:20:26:

    1. icomment:
      
      
      File Added - 349392: errorstack6.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  29. Ticket change [eeb53d5d71] (rid 108862) by ferrieux on 2009-11-09 20:26:18:

    1. icomment:
      
      
      File Added - 350135: errorstack7.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  30. Add attachment "errorstack7.patch" [39679faea9] (rid 112381) by ferrieux on 2009-11-09 20:26:18.

  31. Ticket change [c43e10b3f3] (rid 111812) by ferrieux on 2009-11-09 20:26:40:

    1. icomment:
      Added documentatoin in catch.n and info.n.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  32. Ticket change [ce74a21506] (rid 96058) by dgp on 2009-12-16 00:42:39:

    1. assignee changed to: "dgp"
    2. priority changed to: "9 Immediate"
  33. Add attachment "errorstack8.patch" [fac3342a29] (rid 91936) by ferrieux on 2010-02-08 17:08:22.

  34. Ticket change [b771eb5900] (rid 125600) by ferrieux on 2010-02-08 17:08:22:

    1. icomment:
      
      
      File Added - 362053: errorstack8.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  35. Ticket change [64d94d6132] (rid 92841) by ferrieux on 2010-02-08 17:08:38:

    1. icomment:
      Patch updated to HEAD.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  36. Add attachment "errorstack9.patch" [010489cc34] (rid 119407) by ferrieux on 2010-03-17 07:57:34.

  37. Ticket change [2c0a06a175] (rid 118838) by ferrieux on 2010-03-17 07:57:35:

    1. icomment:
      
      
      File Added - 367044: errorstack9.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  38. Ticket change [e32cdd97e2] (rid 87748) by ferrieux on 2010-03-17 07:59:06:

    1. icomment:
      Patch re-updated to HEAD, and now includes two updates suggested by dgp:
      (a) restriction of -errorstack dict option to TCL_ERROR cases
      (b) simplification of the internal [lappend] used
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  39. Ticket change [00fc057a88] (rid 119402) by dgp on 2010-03-17 21:01:29:

    1. icomment:
      
      -errorstack is like -errorcode in that
      it wants a list argument.  This patch
      suffers from the same bug as 2383005.
      Both bugs should be fixed.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  40. Ticket change [2cd0927865] (rid 118975) by dgp on 2010-03-17 21:03:44:

    1. icomment:
      
      Need to examine whether
      Tcl_SaveInterpState and friends
      need to give the -errorstack dict
      entry any special treatment like
      errorInfo and errorCode receive,
      or whether it's fully covered by
      the returnOpts dict.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  41. Ticket change [412979783c] (rid 116142) by dgp on 2010-03-17 21:50:59:

    1. icomment:
      
      TclProcessReturn() does not appear
      to have anything in it to pull a -errorstack
      value out of the options dict to be stored
      in the iPtr->errorstack field.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  42. Ticket change [a6f605c41c] (rid 98701) by ferrieux on 2010-03-18 00:46:11:

    1. icomment:
      No, -errorstack is just a readonly optsDict member. Even Joe, who asked for it in the first place, didn't ask for a [return -errorstack]. Personally I believe(d) that restricting ourselves to [info/interp errorstack] is(was) even better, but I yielded.
      
      Question1: do you think that a read-only optsDict member is out of question ?
      Question2: where's your preference between:
          (a) a read-write opt
          (b) no opt, just [info/interp errorstack]
      ?
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  43. Ticket change [5579a5ec4f] (rid 94140) by dgp on 2010-03-18 00:52:21:

    1. icomment:
      
      um, that's novel. :)
      
      I might be convinced to make this
      one special, but in that case I don't
      think the right thing to do with
      [return -errorstack] is to just let it
      silently fail.  If we are to disallow it,
      raise an error.
      
      I was wondering myself about
      whether [info errostack] would be
      sufficient.  The issue appears to
      come down to whether or not
      the value of -errorstack ought to
      be considered part of the "state"
      of the interp -- those values saved
      and restored by Tcl_*InterpState()
      and cable to be [catch]-ed and
      re-raised by [return -options].  Since
      you call -errorstack a sister of -errorinfo,
      my first assumption is that it is part of
      that state, and needs to be part of that
      save/restore capability, and for that reason
      needs to be writable via the [return] command.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  44. Ticket change [1c79b2a9b5] (rid 90611) by ferrieux on 2010-03-18 03:47:03:

    1. icomment:
      Ah, OK. Just noticed that [return -foo bar something] just populates the dict with key -foo and value bar. I had wrongly assumed that only the meaningful ones were passed, erroring on others.
      
      Anyway I accept the argument of symmetry with errorinfo. Will shortly upload an update including the r/w option.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  45. Ticket change [1148a911da] (rid 95113) by ferrieux on 2010-03-18 05:30:17:

    1. icomment:
      
      
      File Added - 367176: errorstack10.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  46. Add attachment "errorstack10.patch" [66cd1b82ab] (rid 102786) by ferrieux on 2010-03-18 05:30:17.

  47. Ticket change [4f0647f217] (rid 125753) by ferrieux on 2010-03-18 05:39:45:

    1. icomment:
      Attached patch doing as promised, [return -errorstack], and a new test case checking that this affects [info errorstack] on subsequent [catch] as expected.
      
      Note that it also includes the fix for 2383005.
      
      Note however, that in both cases if a non-list like "{}a" is passed to [return -errorstack/errorcode], the resulting error message remains the final arg of [return -code error ...] instead of 'list element in braces followed by "a" instead of space'.
      
      I suspect this is the work of Tcl_TransferResult but I'm not familiar with that part, I'd appreciate help (ipso facto solving 2383005).
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  48. Ticket change [7ea7ffd7ee] (rid 97453) by ferrieux on 2010-03-18 05:57:58:

    1. icomment:
      Let's handle that tiny issue in the bug 2383005 itself.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  49. Ticket change [80b8965b40] (rid 116915) by ferrieux on 2010-03-19 06:07:50:

    1. icomment:
      
      
      File Added - 367319: errorstack11.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  50. Add attachment "errorstack11.patch" [6d4297d91c] (rid 128663) by ferrieux on 2010-03-19 06:07:50.

  51. Ticket change [9c3fda5586] (rid 96117) by ferrieux on 2010-03-19 06:08:43:

    1. icomment:
      Patch updated to include the cleaner MergeRetOpts-based check for listness of -errorstack values, and a test case.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  52. Add attachment "errorstack12.patch" [f8eb684bda] (rid 91617) by ferrieux on 2010-03-24 04:24:04.

  53. Ticket change [cfd1556dbd] (rid 113052) by ferrieux on 2010-03-24 04:24:04:

    1. icomment:
      
      
      File Added - 367943: errorstack12.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  54. Ticket change [f3d01a20c8] (rid 129785) by ferrieux on 2010-03-24 04:25:07:

    1. icomment:
      Thanks to Miguel for the hint: varFramePtr != framePtr is the simple check for [uplevel] spurious echoes. Patch updated.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  55. Ticket change [1197d5b194] (rid 95173) by ferrieux on 2010-03-24 22:55:23:

    1. icomment:
      Attaching patch displaying the uplevel slots as {uplevel $relativelevel}.
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  56. Add attachment "errorstack13.patch" [366f1c1eca] (rid 107101) by ferrieux on 2010-03-24 22:58:05.

  57. Ticket change [09cbe55da0] (rid 113715) by ferrieux on 2010-03-24 22:58:05:

    1. icomment:
      
      
      File Added - 368071: errorstack13.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  58. Ticket change [3556713450] (rid 106907) by dgp on 2010-03-25 02:35:05:

    1. icomment:
      
      In the latest patch the uplevel entries don't
      appear to happen at the toplevel.  Contrast:
      
      % proc foo {} {uplevel 1 bar}
      % proc bar {} {error baz}
      % catch foo m o
      1
      % dict get $o -errorstack
      bar foo
      %
      % proc wrap {} {foo}
      % catch wrap m o
      1
      % dict get $o -errorstack
      bar {uplevel 1} foo wrap
      
      
      The uplevel entry between bar and foo
      doesn't get inserted when foo is called
      from level #0.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  59. Ticket change [0a3ecf9405] (rid 113784) by dgp on 2010-03-25 03:21:06:

    1. icomment:
      
      
      File Added - 368110: 2868499.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  60. Ticket change [ea959940f2] (rid 103402) by dgp on 2010-03-25 03:22:51:

    1. icomment:
      
      ok, that logic wasn't hard to correct. see new patch.
      
      Not a huge deal, but I notice that the constructed uplevel
      entries always reports the relative level difference, even
      when it was a command using an absolute level, like
      [uplevel #0] that caused the branch in the tree of CallFrames.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  61. Ticket change [178294e829] (rid 122507) by dgp on 2010-03-25 03:24:44:

    1. icomment:
      
      oops, uploaded that patch before learning
      that result-6.4 needs an update to match it.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  62. Ticket change [5ec0f4af87] (rid 115680) by dgp on 2010-03-25 03:45:34:

    1. icomment:
      
      There remains an offset in the timing of appends
      to -errorinfo and -errorstack:
      
      proc myEval script {
          if {[catch {uplevel 1 $script} m o] == 1}  {
              puts EI:[dict get $o -errorinfo]\n
              puts ES:[dict get $o -errorstack]
          }
      }
      proc foo {} {error bar}
      myEval foo
      
      OUTPUT:
      EI:bar
          while executing
      "error bar"
          (procedure "foo" line 1)
          invoked from within
      "foo"
          ("uplevel" body line 1)
          invoked from within
      "uplevel 1 $script"
      
      ES:foo {uplevel 1} {myEval foo}
      
      It is clear that the each Tcl_LogCommandInfo
      call is appending to -errorinfo text related to
      the commands that have completed their
      evaluation, while it appends to -errorstack
      information about the current context which
      has not yet been terminated.  Parallel appends
      would be less confusing.
      
      If -errorstack construction could be changed to
      match -errorinfo, then the [control::eval] command
      would already handle -errorstack correctly as written.
      
      With the current patch, the [control::eval] command
      needs to have code added to strip a final {uplevel 1}
      from the -errorstack to fully disguise the wrapping replacement.
      The analogous issue would impact [control::ascaller] too.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  63. Ticket change [3075b76c87] (rid 93260) by ferrieux on 2010-03-25 04:40:14:

    1. icomment:
      Re the relative levels: this is both intentional and hard to avoid.
      
      - Intentional, because only a relative level allows unambiguous interpretation  of the scopes when the error stack is not taken from toplevel (eg in a deep [catch]), hence the lat item is not at level 1. {uplevel N} simply means you need to skip N (non-uplevel) items on the right to find the scope.
      
      - Hard to avoid, because the exact nature of the scope-shifting operation can be very varied, and distinguishing absolute and relative uplevels would imply re-parsing the text or just-run bytecode (eeek).
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  64. Ticket change [5afd0409ba] (rid 118239) by ferrieux on 2010-03-25 05:02:58:

    1. icomment:
      Re syncing errorinfo and errorstack, I believe you're asking too much for little gain. The current approach is to record the (valuable) dynamic objv[] when it's available *and* we manage to be called. We manage to be called by the T_LCI "vehicle", which is nicer than the duplicated code that was in place before, but any higher frequency would be much more complex. Delaying the recording of the objv[] after its initial availability amounts to shifting the list at the end, I don't see the point.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  65. Ticket change [b0d2129227] (rid 98045) by ferrieux on 2010-03-26 04:45:09:

    1. icomment:
      
      
      File Added - 368223: errorstack14.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  66. Add attachment "errorstack14.patch" [4f3edfaa7e] (rid 125794) by ferrieux on 2010-03-26 04:45:09.

  67. Ticket change [714d259bf8] (rid 100648) by ferrieux on 2010-03-26 04:46:50:

    1. icomment:
      Uploaded errorstack14.patch implementing solution "fast, flat, out-of-band".
      
         CALL {foo x y} UP 1 CALL {bar z} CALL {gnu t}
      
      Docs and minimal tests updated accordingly.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  68. Ticket change [7ba5e967ae] (rid 96945) by dgp on 2010-03-30 01:45:14:

    1. icomment:
      
      Several of the results in the new/revised tests are
      checking for {UP 1} as the last element of the errorstack.
      This is exposing details of the tcltest framework.  This is
      likely only a theoretical problem, but more robust tests
      won't do this as protection again possible coding changes
      in future versions of the tcltest package.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  69. Ticket change [f7e027b77c] (rid 91447) by ferrieux on 2010-03-30 01:47:32:

    1. icomment:
      Yes. Will shortly replace them by a glob match with a trailing star.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  70. Ticket change [3f4d1caaea] (rid 121435) by dgp on 2010-03-30 01:52:14:

    1. icomment:
      
      Since the revised structure of the -errorstack
      value demands that it be a list with an even number
      of elements, that check should be added to 
      [return -errorstack $value].
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  71. Ticket change [b584fe9d63] (rid 125260) by dgp on 2010-03-31 01:56:09:

    1. icomment:
      Attached a demo script that puts
      the new feature through its paces
      with many commands that push
      CallFrames.  Could be a starting
      point for coverage tests for the
      test suite.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  72. Ticket change [38298bd5c9] (rid 112157) by dgp on 2010-03-31 01:57:32:

    1. icomment:
      
      
      File Added - 368850: stack.tcl
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  73. Add attachment "stack.tcl" [5c02c19efc] (rid 118423) by dgp on 2010-03-31 01:57:32.

  74. Add attachment "errorstack15.patch" [98b3ff1731] (rid 110655) by ferrieux on 2010-03-31 21:16:26.

  75. Ticket change [2698483782] (rid 88373) by ferrieux on 2010-03-31 21:16:27:

    1. icomment:
      
      
      File Added - 368958: errorstack15.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  76. Ticket change [e7bef8fa0f] (rid 104521) by ferrieux on 2010-03-31 21:18:03:

    1. icomment:
      Thanks, will look at these in detail when polishing the tests.
      Just updated the patch to handle interp state Save/Restore/Discard and end-of-interp-life, and also the check for even-sized -errorstack value.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  77. Ticket change [7854af2219] (rid 89944) by dgp on 2010-03-31 22:45:33:

    1. icomment:
      
      
      File Deleted - 368110: 
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  78. Ticket change [52fc2f09bf] (rid 126407) by dgp on 2010-03-31 22:51:08:

    1. icomment:
      
      
      File Added - 368969: 2868499.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  79. Add attachment "2868499.patch" [6cd4e1d8e5] (rid 128591) by dgp on 2010-03-31 22:51:08.

  80. Ticket change [29c70171ea] (rid 118447) by dgp on 2010-03-31 22:53:11:

    1. icomment:
      
      Updated patch makes tiny improvement
      to T_LCI.
      
      FWIW, I'd make some different choices
      in the -errorcode values, but I'll defer to
      whatever scheme dkf has been building.
      
      Still want to do something of an audit of
      places where -errorinfo gets tinkered with
      to check whether -errorstack needs parallel
      treatment.  That can happen post-commit.
      To the extent that more fixes are needed they
      will be fixes of fairly obsure bugs.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  81. Ticket change [dcbe51dd08] (rid 114539) by ferrieux on 2010-04-01 00:11:59:

    1. icomment:
      Summary from talk on the chat:
      To get to the "inner context" (ie the just-executed command/instruction when the error first bursts, in the first T_LCI call in a row), two families of cases exist:
       
          - error generated by a bytecode instruction: based on a stack arity table (+ special casing of INST_EXPAND_*) we can reconstruct the objv[] out of the stack contents (not yet popped). What's nice is that TEBC has a single call site of T_LCI.
      
        - error generated in one of the many non-compiled error cases from tclBasic.c. These are trickier since there is no uniform way of reaching the objv[]. In some cases we might fall back to just displaying the static source.
      
      I believe the compiled case is top priority, because it applies to most code anyway.
      (would have _loved_ the arity suffix like INST_LOAD_SCALAR1 to be generalized...)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  82. Ticket change [76ee7ae1c5] (rid 105677) by dgp on 2010-04-01 00:48:08:

    1. icomment:
      
      I scanned the Tcl sources for errorinfo/errorInfo
      and only found one thing to mention:
      
      dgpI think we can and should demand that any background error handler wishing to make use of [info errorstack]....
      dgp... must be one created using the [interp bgerror] interface.
      dgpso while we continue to offer legacy support by setting ::errorInfo and ::errorCode before invoking ::bgerror ....
      dgp... we do not go to the trouble of making [info errorstack] follow suit.
      
      Otherwise, most return options relevant code
      in Tcl itseld is using utility routines like
      Tcl_Get|SetReturnOptions() and
      Tcl_Save|RestoreInterpState() so they
      end up working with the new -errorstack
      automatically.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  83. Ticket change [afb070fbc8] (rid 97856) by ferrieux on 2010-04-06 02:51:27:

    1. icomment:
      Committed to HEAD.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  84. Ticket change [9b568887df] (rid 111103) by dgp on 2010-04-06 05:14:29:

    1. closedate changed to: "2010-04-05T22:14:29"
    2. closer changed to: "dgp"
    3. icomment:
      
      
      allow_comments - 1
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "dgp"
  85. Ticket change [dab091366b] (rid 107834) by ferrieux on 2010-05-03 06:26:40:

    1. icomment:
      Note that patch 2995655 now has the proposed "inner contexts" extension.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  86. Ticket change [f63a3621bc] (rid 130264) by ferrieux on 2010-05-03 06:26:41:

    1. icomment:
      
      
      allow_comments - 0
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"