Feature #4067
closedEnhanced stack trace after dynamic errors: show values of variables
100%
Description
In my own debugging I have found it would be very useful in the stack trace that occurs on dynamic errors to be able to see the values of variables on the stack frame. This information is available and it's not difficult to add it to the output.
The main question is whether this should be enabled/disabled by default and how/whether it should be possible to switch it on or off.
Updated by Michael Kay over 5 years ago
Here is an example of the output:
Error evaluating ((attr{name=...}, ...)) on line 1497 column 77 of XSLT-SEF-compiler.xsl:
XTDE0700: No value supplied for required parameter $uniform-namespaces. A value is
required because the default value is not a valid instance of the required type
at xsl:apply-templates (file:/Users/mike/repo/src/xslt/constructs/select-sequence.xsl#16)
processing xsl:stylesheet/xsl:param[1]/@select
Local parameters
$attr = ()
Tunnel parameters
$options = map{}
$exclude-prefixes = ("X", "#all", "xsl")
$expand-text = true()
$static-context = map{"backward-compatibility":false(), "namespace-aliases":map{"X":"xsl", }, "exclude-prefixes":("X", "#all", "xsl"), "location":@module, "xsl-version":3}
$location = @module
$backward-compatibility = false()
$namespace-aliases = map{"X":"xsl", }
$named-template-signatures = map{(:size 24:)}
$defined-attribute-sets = ()
$ns = "xml=~ xsl=~ xs=http://www.w3.org/20..."
Local variables
$xpath-default-namespace = ()
$default-collation = ()
$backward-compatibility = false()
$uniform-namespaces = (*null*)
$role = (*null*)
$attr = (*null*)
$type = (*null*)
$surroundFunction = (*null*)
$errorCode = (*null*)
$node = (*null*)
at xsl:apply-templates (file:/Users/mike/repo/src/xslt/XSLT-SEF-compiler.xsl#1373)
processing xsl:stylesheet/xsl:param[1]
Tunnel parameters
$options = map{}
$exclude-prefixes = ("X", "#all", "xsl")
$expand-text = true()
$static-context = map{"backward-compatibility":false(), "namespace-aliases":map{"X":"xsl", }, "exclude-prefixes":("X", "#all", "xsl"), "location":@module, "xsl-version":3}
$location = @module
$backward-compatibility = false()
$namespace-aliases = map{"X":"xsl", }
$named-template-signatures = map{(:size 24:)}
$defined-attribute-sets = ()
$ns = "xml=~ xsl=~ xs=http://www.w3.org/20..."
Local variables
$attr = ()
at xsl:apply-templates (file:/Users/mike/repo/src/xslt/XSLT-SEF-compiler.xsl#833)
processing xsl:stylesheet/xsl:param[1]
Tunnel parameters
$options = map{}
$exclude-prefixes = ("X", "#all", "xsl")
$expand-text = true()
$static-context = map{"backward-compatibility":false(), "namespace-aliases":map{"X":"xsl", }, "exclude-prefixes":("X", "#all", "xsl"), "location":@module, "xsl-version":3}
$location = @module
$backward-compatibility = false()
$namespace-aliases = map{"X":"xsl", }
$named-template-signatures = map{(:size 24:)}
$defined-attribute-sets = ()
Local variables
$attr = (*null*)
at xsl:apply-templates (file:/Users/mike/repo/src/xslt/XSLT-SEF-compiler.xsl#374)
processing xsl:stylesheet
Tunnel parameters
$options = map{}
Local variables
$attr = (*null*)
$exclude-prefixes = (*null*)
at xsl:apply-templates (file:/Users/mike/repo/src/xslt/XSLT-SEF-compiler.xsl#269)
processing /xsl:stylesheet
Tunnel parameters
$options = map{}
Local variables
$stylesheet-base-uri = "file:/Users/mike/repo/src/xslt/XSLT..."
$options = map{}
$static-processed = <xsl:stylesheet>
$temp = (*null*)
$normalized = <xsl:stylesheet>
Updated by Michael Kay over 5 years ago
I decided to make this Saxon-EE only. It is enabled by default, and the level of stack frame detail can be reduced from the default by a setter method on the StandardErrorListener (or the StandardErrorListener can be subclassed).
Updated by Michael Kay over 5 years ago
This is implemented and working reasonably well. The output is a little misleading in cases where tail-call recursion has been used and stack frames are therefore reused.
Updated by Michael Kay about 5 years ago
- Status changed from In Progress to Resolved
- Applies to branch 9.9, trunk added
- Fix Committed on Branch 9.9, trunk added
- Fixed in Maintenance Release 9.9.1.1 added
Implemented and shipped in the 9.9.1.1 release.
Updated by O'Neil Delpratt almost 5 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
Please register to edit this issue