Overview
| Artifact ID: | 4f7fa77a07f4983c6cd9eb24e9ecb1294c963e17 |
|---|---|
| Ticket: | 523900ffffffffffffffffffffffffffffffffff
Substituted error stacks |
| User & Date: | nobody on 2002-02-28 16:16:13 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
(summary of previous discussions with Jeff, Miguel et al) Idea: errorInfo gives only static source-level info (line numbers and source excerpts), but not the actual arguments gotten by the functions on the stack. (1) This proposal is about creating a second global variable, ::errorStack, which would be primarily a Tcl list (until somebody asks for its string rep of course), into which we'd stick all the dynamic info we miss in errorInfo. The starting point is to store there references to the substituted commands-and-args list of the calling stack, which are available even at Tcl level as [info level $n]. It is easy to do so while respecting the current control flow of error stack: at each level we store the info pertaining to the current level, then we pop back. So this amounts to (in Tcl pseudocode): lappend ::errorStack [info level 0] at the point where errorInfo is currently being built. (2) Possible extension to this proposal: faster reimplementation of errorInfo, leading to a much faster [catch] in the negative (error) case. Principle: - extend the above mechanism with file and line number info from TIP#86, and store them alongside the [info level]s in errorStack. - remove all current errorInfo-construction code (especially the line-counting loop !) and reimplement errorInfo with a read trace, reproducing exactly today's syntax but based on the data in errorStack, and only if errorInfo is used (which is not the case of all [catch]es, hence the speed gain !). I have posted a first step towards this in pure Tcl on comp.lang.tcl. But clearly it suffers from all the limitations of the current errorInfo construction mechanism, which badly interacts with reentrant [eval] of the Tcl code in any write trace on errorInfo ! Hence this proposal as a core patch, which would be IMHO much more elegant (and simple, and efficient...) than this pure-Tcl simulation
- foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "07. Variables"
- title changed to: "Substituted error stacks"
- type changed to: "RFE"