Tcl Source Code

Artifact [8f2521c7e3]
Login

Artifact 8f2521c7e39b6b5707b1578aa41b0a295dc2cc65:

Attachment "errorstack8.patch" to ticket [2868499fff] added by ferrieux 2010-02-08 17:08:22.
Index: doc/catch.n
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/catch.n,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 catch.n
--- doc/catch.n	13 Jan 2010 12:08:30 -0000	1.23
+++ doc/catch.n	8 Feb 2010 10:07:03 -0000
@@ -54,22 +54,33 @@ Only when the return code is \fBTCL_RETU
 the \fB\-level\fR and \fB\-code\fR entries be something else, as
 further described in the documentation for the \fBreturn\fR command.
 .PP
-When the return code from evaluation of \fIscript\fR is \fBTCL_ERROR\fR,
-three additional entries are defined in the dictionary of return options
-stored in \fIoptionsVarName\fR: \fB\-errorinfo\fR, \fB\-errorcode\fR, 
-and \fB\-errorline\fR.  The value of the \fB\-errorinfo\fR entry
-is a formatted stack trace containing more information about
-the context in which the error happened.  The formatted stack
-trace is meant to be read by a person.  The value of
-the \fB\-errorcode\fR entry is additional information about the
-error stored as a list.  The \fB\-errorcode\fR value is meant to
-be further processed by programs, and may not be particularly
-readable by people.  The value of the \fB\-errorline\fR entry
-is an integer indicating which line of \fIscript\fR was being
-evaluated when the error occurred.  The values of the \fB\-errorinfo\fR
-and \fB\-errorcode\fR entries of the most recent error are also
-available as values of the global variables \fB::errorInfo\fR
-and \fB::errorCode\fR respectively.
+When the return code from evaluation of \fIscript\fR is
+\fBTCL_ERROR\fR, four additional entries are defined in the dictionary
+of return options stored in \fIoptionsVarName\fR: \fB\-errorinfo\fR,
+\fB\-errorcode\fR, \fB\-errorline\fR, and \fB\-errorstack\fR.  The
+value of the \fB\-errorinfo\fR entry is a formatted stack trace
+containing more information about the context in which the error
+happened.  The formatted stack trace is meant to be read by a person.
+The value of the \fB\-errorcode\fR entry is additional information
+about the error stored as a list.  The \fB\-errorcode\fR value is
+meant to be further processed by programs, and may not be particularly
+readable by people.  The value of the \fB\-errorline\fR entry is an
+integer indicating which line of \fIscript\fR was being evaluated when
+the error occurred.  The value of the \fB\-errorstack\fR entry is a
+list of lists made of the function names and arguments at each level
+from the call stack when the error occurred. It differs from
+-errorinfo in that (1) it is a true list of lists, for easy
+programmatic access without parsing, (2) it contains the true
+(substituted) values passed to the functions, instead of the static
+text of the calling sites, and (3) it is coarser-grained, with only
+one element per stack frame (like procs; no separate elements for
+[foreach] constructs for example).
+
+The values of the \fB\-errorinfo\fR and \fB\-errorcode\fR entries of
+the most recent error are also available as values of the global
+variables \fB::errorInfo\fR and \fB::errorCode\fR respectively. The
+value of the \fB\-errorstack\fR entry surfaces as \fBinfo
+errorstack\fR.
 .PP
 Tcl packages may provide commands that set other entries in the
 dictionary of return options, and the \fBreturn\fR command may be
Index: doc/info.n
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/info.n,v
retrieving revision 1.35
diff -u -p -u -p -r1.35 info.n
--- doc/info.n	16 Nov 2009 18:00:11 -0000	1.35
+++ doc/info.n	8 Feb 2010 10:07:03 -0000
@@ -94,6 +94,16 @@ does not have a default value then the c
 Otherwise it returns \fB1\fR and places the default value of \fIarg\fR
 into variable \fIvarname\fR.
 .TP
+\fBinfo errorstack \fR?\fIinterp\fR?
+.
+Returns a list of lists made of the function names and arguments at
+each level from the call stack of the last error in the given
+\fIinterp\fR, or in the current one if not specified.  This
+information is also present in the -errorstack entry of the options
+dictionary returned by 3-arg \fBcatch\fR; \fBinfo errorstack\fR is a
+convenient way of retrieving it for uncaught errors at toplevel in an
+interactive tclsh.
+.TP
 \fBinfo exists \fIvarName\fR
 .
 Returns \fB1\fR if the variable named \fIvarName\fR exists in the
Index: generic/tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.442
diff -u -p -u -p -r1.442 tclBasic.c
--- generic/tclBasic.c	5 Feb 2010 22:39:44 -0000	1.442
+++ generic/tclBasic.c	8 Feb 2010 10:07:03 -0000
@@ -529,6 +529,9 @@ Tcl_CreateInterp(void)
     iPtr->errorInfo = NULL;
     TclNewLiteralStringObj(iPtr->eiVar, "::errorInfo");
     Tcl_IncrRefCount(iPtr->eiVar);
+    iPtr->errorStack = Tcl_NewListObj(0, NULL);
+    Tcl_IncrRefCount(iPtr->errorStack);
+    iPtr->resetErrorStack = 1;
     iPtr->errorCode = NULL;
     TclNewLiteralStringObj(iPtr->ecVar, "::errorCode");
     Tcl_IncrRefCount(iPtr->ecVar);
@@ -1466,6 +1469,7 @@ DeleteInterpProc(
 	Tcl_DecrRefCount(iPtr->errorInfo);
 	iPtr->errorInfo = NULL;
     }
+    Tcl_DecrRefCount(iPtr->errorStack);
     if (iPtr->returnOpts) {
 	Tcl_DecrRefCount(iPtr->returnOpts);
     }
@@ -8920,5 +8924,7 @@ TclInfoCoroutineCmd(
  * mode: c
  * c-basic-offset: 4
  * fill-column: 78
+ * tab-width: 8
+ * indent-tabs-mode: nil
  * End:
  */
Index: generic/tclCmdIL.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdIL.c,v
retrieving revision 1.176
diff -u -p -u -p -r1.176 tclCmdIL.c
--- generic/tclCmdIL.c	22 Dec 2009 19:49:29 -0000	1.176
+++ generic/tclCmdIL.c	8 Feb 2010 10:07:04 -0000
@@ -118,6 +118,9 @@ static int		InfoCompleteCmd(ClientData d
 			    int objc, Tcl_Obj *const objv[]);
 static int		InfoDefaultCmd(ClientData dummy, Tcl_Interp *interp,
 			    int objc, Tcl_Obj *const objv[]);
+/* TIP #348 - New 'info' subcommand 'errorstack' */
+static int		InfoErrorStackCmd(ClientData dummy, Tcl_Interp *interp,
+			    int objc, Tcl_Obj *const objv[]);
 /* TIP #280 - New 'info' subcommand 'frame' */
 static int		InfoFrameCmd(ClientData dummy, Tcl_Interp *interp,
 			    int objc, Tcl_Obj *const objv[]);
@@ -164,6 +167,7 @@ static const EnsembleImplMap defaultInfo
     {"complete",	   InfoCompleteCmd,	    NULL, NULL, NULL},
     {"coroutine",	   TclInfoCoroutineCmd,     NULL, NULL, NULL},
     {"default",		   InfoDefaultCmd,	    NULL, NULL, NULL},
+    {"errorstack",	   InfoErrorStackCmd,	    NULL, NULL, NULL},
     {"exists",		   TclInfoExistsCmd,	    TclCompileInfoExistsCmd, NULL, NULL},
     {"frame",		   InfoFrameCmd,	    NULL, NULL, NULL},
     {"functions",	   InfoFunctionsCmd,	    NULL, NULL, NULL},
@@ -1017,6 +1021,55 @@ InfoDefaultCmd(
 /*
  *----------------------------------------------------------------------
  *
+ * InfoErrorStackCmd --
+ *
+ *	Called to implement the "info errorstack" command that returns information
+ *	about the last error's call stack. Handles the following syntax:
+ *
+ *	    info errorstack ?interp?
+ *
+ * Results:
+ *	Returns TCL_OK if successful and TCL_ERROR if there is an error.
+ *
+ * Side effects:
+ *	Returns a result in the interpreter's result object. If there is an
+ *	error, the result is an error message.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+InfoErrorStackCmd(
+    ClientData dummy,		/* Not used. */
+    Tcl_Interp *interp,		/* Current interpreter. */
+    int objc,			/* Number of arguments. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
+{
+    Tcl_Interp *target;
+    Interp *iPtr;
+
+    if ((objc != 1) && (objc != 2)) {
+	Tcl_WrongNumArgs(interp, 1, objv, "?interp?");
+	return TCL_ERROR;
+    }
+    
+    target = interp;
+    if (objc == 2) {
+        target = Tcl_GetSlave(interp, Tcl_GetString(objv[1]));
+        if (target == NULL) {
+            return TCL_ERROR;
+        }
+    }
+
+    iPtr = (Interp *) target;
+    Tcl_SetObjResult(interp, iPtr->errorStack);
+    
+    return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
  * TclInfoExistsCmd --
  *
  *	Called to implement the "info exists" command that determines whether
@@ -4392,5 +4445,7 @@ SelectObjFromSublist(
  * mode: c
  * c-basic-offset: 4
  * fill-column: 78
+ * tab-width: 8
+ * indent-tabs-mode: nil
  * End:
  */
Index: generic/tclInt.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v
retrieving revision 1.459
diff -u -p -u -p -r1.459 tclInt.h
--- generic/tclInt.h	5 Feb 2010 22:39:44 -0000	1.459
+++ generic/tclInt.h	8 Feb 2010 10:07:04 -0000
@@ -1903,6 +1903,8 @@ typedef struct Interp {
     Tcl_Obj *eiVar;		/* cached ref to ::errorInfo variable. */
     Tcl_Obj *errorCode;		/* errorCode value (now as a Tcl_Obj). */
     Tcl_Obj *ecVar;		/* cached ref to ::errorInfo variable. */
+    Tcl_Obj *errorStack;	/* [info errorstack] value (as a Tcl_Obj). */
+    int resetErrorStack;        /* controls cleaning up of ::errorStack */
     int returnLevel;		/* [return -level] parameter. */
 
     /*
Index: generic/tclNamesp.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclNamesp.c,v
retrieving revision 1.199
diff -u -p -u -p -r1.199 tclNamesp.c
--- generic/tclNamesp.c	3 Jan 2010 20:29:11 -0000	1.199
+++ generic/tclNamesp.c	8 Feb 2010 10:07:04 -0000
@@ -7573,7 +7573,7 @@ Tcl_LogCommandInfo(
 {
     register const char *p;
     Interp *iPtr = (Interp *) interp;
-    int overflow, limit = 150;
+    int overflow, limit = 150, len;
     Var *varPtr, *arrayPtr;
 
     if (iPtr->flags & ERR_ALREADY_LOGGED) {
@@ -7632,6 +7632,36 @@ Tcl_LogCommandInfo(
 		    TCL_GLOBAL_ONLY);
 	}
     }
+
+    /*
+     * TIP #348
+     */
+
+    if (Tcl_IsShared(iPtr->errorStack)) {
+        Tcl_Obj *newObj;
+            
+        newObj = Tcl_DuplicateObj(iPtr->errorStack);
+        Tcl_DecrRefCount(iPtr->errorStack);
+        Tcl_IncrRefCount(newObj);
+        iPtr->errorStack = newObj;
+    }
+    Tcl_ListObjLength(interp, iPtr->errorStack, &len);
+    if (iPtr->resetErrorStack) {
+        iPtr->resetErrorStack = 0;
+        /* reset while keeping the list intrep as much as possible */
+        Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, 0, NULL);
+        len=0;
+    } 
+    if (iPtr->varFramePtr != iPtr->rootFramePtr) {
+        Tcl_Obj *listPtr;
+        int result;
+        listPtr=Tcl_NewListObj(iPtr->varFramePtr->objc,
+                               iPtr->varFramePtr->objv);
+        result = Tcl_ListObjReplace(interp, iPtr->errorStack, len, 0, 1, &listPtr);
+        if (result != TCL_OK) {
+            Tcl_DecrRefCount(listPtr);
+        }
+    }
 }
 
 /*
@@ -7639,5 +7669,7 @@ Tcl_LogCommandInfo(
  * mode: c
  * c-basic-offset: 4
  * fill-column: 78
+ * tab-width: 8
+ * indent-tabs-mode: nil
  * End:
  */
Index: generic/tclResult.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclResult.c,v
retrieving revision 1.56
diff -u -p -u -p -r1.56 tclResult.c
--- generic/tclResult.c	16 Nov 2009 18:00:11 -0000	1.56
+++ generic/tclResult.c	8 Feb 2010 10:07:04 -0000
@@ -19,7 +19,7 @@
 
 enum returnKeys {
     KEY_CODE,	KEY_ERRORCODE,	KEY_ERRORINFO,	KEY_ERRORLINE,
-    KEY_LEVEL,	KEY_OPTIONS,	KEY_LAST
+    KEY_LEVEL,	KEY_OPTIONS,	KEY_ERRORSTACK,	KEY_LAST
 };
 
 /*
@@ -922,6 +922,7 @@ Tcl_ResetResult(
 	Tcl_DecrRefCount(iPtr->errorInfo);
 	iPtr->errorInfo = NULL;
     }
+    iPtr->resetErrorStack = 1;
     iPtr->returnLevel = 1;
     iPtr->returnCode = TCL_OK;
     if (iPtr->returnOpts) {
@@ -1158,6 +1159,7 @@ GetKeys(void)
 	TclNewLiteralStringObj(keys[KEY_ERRORCODE], "-errorcode");
 	TclNewLiteralStringObj(keys[KEY_ERRORINFO], "-errorinfo");
 	TclNewLiteralStringObj(keys[KEY_ERRORLINE], "-errorline");
+	TclNewLiteralStringObj(keys[KEY_ERRORSTACK],"-errorstack");
 	TclNewLiteralStringObj(keys[KEY_LEVEL],	    "-level");
 	TclNewLiteralStringObj(keys[KEY_OPTIONS],   "-options");
 
@@ -1503,6 +1505,7 @@ Tcl_GetReturnOptions(
 	Tcl_DictObjPut(NULL, options, keys[KEY_ERRORLINE],
 		Tcl_NewIntObj(iPtr->errorLine));
     }
+    Tcl_DictObjPut(NULL, options, keys[KEY_ERRORSTACK], iPtr->errorStack);
     return options;
 }
 
@@ -1624,5 +1627,7 @@ Tcl_TransferResult(
  * mode: c
  * c-basic-offset: 4
  * fill-column: 78
+ * tab-width: 8
+ * indent-tabs-mode: nil
  * End:
  */
Index: tests/cmdMZ.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/cmdMZ.test,v
retrieving revision 1.28
diff -u -p -u -p -r1.28 cmdMZ.test
--- tests/cmdMZ.test	16 Nov 2009 18:00:11 -0000	1.28
+++ tests/cmdMZ.test	8 Feb 2010 10:07:04 -0000
@@ -119,18 +119,18 @@ proc dictSort {d} {
     return $result
 }
 
-test cmdMZ-return-2.0 {return option handling} {
+test cmdMZ-return-2.0 {return option handling} -body {
     list [catch return -> foo] [dictSort $foo]
-} {2 {-code 0 -level 1}}
-test cmdMZ-return-2.1 {return option handling} {
+} -match glob -result {2 {-code 0 -errorstack * -level 1}}
+test cmdMZ-return-2.1 {return option handling} -body {
     list [catch {return -bar soom} -> foo] [dictSort $foo]
-} {2 {-bar soom -code 0 -level 1}}
-test cmdMZ-return-2.2 {return option handling} {
+} -match glob -result {2 {-bar soom -code 0 -errorstack * -level 1}}
+test cmdMZ-return-2.2 {return option handling} -body {
     list [catch {return -code return} -> foo] [dictSort $foo]
-} {2 {-code 0 -level 2}}
-test cmdMZ-return-2.3 {return option handling} {
+} -match glob -result {2 {-code 0 -errorstack * -level 2}}
+test cmdMZ-return-2.3 {return option handling} -body {
     list [catch {return -code return -level 10} -> foo] [dictSort $foo]
-} {2 {-code 0 -level 11}}
+} -match glob -result {2 {-code 0 -errorstack * -level 11}}
 test cmdMZ-return-2.4 {return option handling} -body {
     return -level 0 -code error
 } -returnCodes error -result {}
@@ -149,14 +149,14 @@ test cmdMZ-return-2.8 {return option han
 test cmdMZ-return-2.9 {return option handling} -body {
     return -level 0 -code 10
 } -returnCodes 10 -result {}
-test cmdMZ-return-2.10 {return option handling} {
+test cmdMZ-return-2.10 {return option handling} -body {
     list [catch {return -level 0 -code error} -> foo] [dictSort $foo]
-} {1 {-code 1 -errorcode NONE -errorinfo {
+} -match glob -result {1 {-code 1 -errorcode NONE -errorinfo {
     while executing
-"return -level 0 -code error"} -errorline 1 -level 0}}
-test cmdMZ-return-2.11 {return option handling} {
+"return -level 0 -code error"} -errorline 1 -errorstack * -level 0}}
+test cmdMZ-return-2.11 {return option handling} -body {
     list [catch {return -level 0 -code break} -> foo] [dictSort $foo]
-} {3 {-code 3 -level 0}}
+} -match glob -result {3 {-code 3 -errorstack * -level 0}}
 test cmdMZ-return-2.12 {return option handling} -body {
     return -level 0 -code error -options {-code ok}
 } -returnCodes ok -result {}
Index: tests/error.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/error.test,v
retrieving revision 1.25
diff -u -p -u -p -r1.25 error.test
--- tests/error.test	7 Dec 2009 15:08:47 -0000	1.25
+++ tests/error.test	8 Feb 2010 10:07:04 -0000
@@ -169,6 +169,19 @@ test error-4.5 {errorInfo and errorCode 
     list [catch {error msg1 msg2 {}} msg] $msg $::errorInfo $::errorCode
 } {1 msg1 msg2 {}}
 
+test error-4.6 {errorstack via info } -body {
+    proc f x {g $x$x}
+    proc g x {error G:$x}
+    catch {f 12}
+    info errorstack
+} -match glob -result {{g 1212} {f 12} {namespace eval *}}
+test error-4.7 {errorstack via options dict } -body {
+    proc f x {g $x$x}
+    proc g x {error G:$x}
+    catch {f 12} m d
+    dict get $d -errorstack
+} -match glob -result {{g 1212} {f 12} {namespace eval *}}
+
 # Errors in error command itself
 
 test error-5.1 {errors in error command} {
@@ -223,6 +236,15 @@ test error-6.9 {catch must reset error s
     catch foo
     list $::errorCode
 } {NONE}
+test error-6.10 {catch must reset errorstack} -body {
+	proc f x {g $x$x}
+	proc g x {error G:$x}
+	catch {f 12}
+	set e1 [info errorstack]
+	catch {f 13}
+	set e2 [info errorstack]
+	list $e1 $e2
+} -match glob -result {{{g 1212} {f 12} {namespace eval *}} {{g 1313} {f 13} {namespace eval *}}}
 
 test error-7.1 {Bug 1397843} -body {
     variable cmds
Index: tests/execute.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/execute.test,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 execute.test
--- tests/execute.test	16 Nov 2009 18:00:11 -0000	1.34
+++ tests/execute.test	8 Feb 2010 10:07:04 -0000
@@ -956,11 +956,11 @@ test execute-8.5 {Bug 2038069} -setup {
     demo
 } -cleanup {
     rename demo {}
-} -result {-code 1 -level 0 -errorcode NONE -errorinfo {FOO
+} -match glob -result {-code 1 -level 0 -errorcode NONE -errorinfo {FOO
     while executing
 "error FOO"
     invoked from within
-"catch [list error FOO] m o"} -errorline 2}
+"catch \[list error FOO\] m o"} -errorline 2 -errorstack *}
 
 test execute-9.1 {Interp result resetting [Bug 1522803]} {
     set c 0
Index: tests/info.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/info.test,v
retrieving revision 1.74
diff -u -p -u -p -r1.74 info.test
--- tests/info.test	10 Jan 2010 22:58:41 -0000	1.74
+++ tests/info.test	8 Feb 2010 10:07:05 -0000
@@ -676,16 +676,16 @@ test info-21.1 {miscellaneous error cond
 } -result {wrong # args: should be "info subcommand ?arg ...?"}
 test info-21.2 {miscellaneous error conditions} -returnCodes error -body {
     info gorp
-} -result {unknown or ambiguous subcommand "gorp": must be args, body, class, cmdcount, commands, complete, coroutine, default, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
+} -result {unknown or ambiguous subcommand "gorp": must be args, body, class, cmdcount, commands, complete, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
 test info-21.3 {miscellaneous error conditions} -returnCodes error -body {
     info c
-} -result {unknown or ambiguous subcommand "c": must be args, body, class, cmdcount, commands, complete, coroutine, default, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
+} -result {unknown or ambiguous subcommand "c": must be args, body, class, cmdcount, commands, complete, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
 test info-21.4 {miscellaneous error conditions} -returnCodes error -body {
     info l
-} -result {unknown or ambiguous subcommand "l": must be args, body, class, cmdcount, commands, complete, coroutine, default, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
+} -result {unknown or ambiguous subcommand "l": must be args, body, class, cmdcount, commands, complete, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
 test info-21.5 {miscellaneous error conditions} -returnCodes error -body {
     info s
-} -result {unknown or ambiguous subcommand "s": must be args, body, class, cmdcount, commands, complete, coroutine, default, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
+} -result {unknown or ambiguous subcommand "s": must be args, body, class, cmdcount, commands, complete, coroutine, default, errorstack, exists, frame, functions, globals, hostname, level, library, loaded, locals, nameofexecutable, object, patchlevel, procs, script, sharedlibextension, tclversion, or vars}
 
 ##
 # ### ### ### ######### ######### #########
Index: tests/init.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/init.test,v
retrieving revision 1.21
diff -u -p -u -p -r1.21 init.test
--- tests/init.test	16 Nov 2009 18:00:11 -0000	1.21
+++ tests/init.test	8 Feb 2010 10:07:05 -0000
@@ -181,7 +181,7 @@ test init-5.0 {return options passed thr
     list $code $foo $bar $code2 $foo2 $bar2
 } -cleanup {
     unset ::auto_index(::xxx)
-} -result {2 xxx {-errorcode NONE -code 1 -level 1} 2 xxx {-code 1 -level 1 -errorcode NONE}}
+} -match glob -result {2 xxx {-errorcode NONE -errorstack * -code 1 -level 1} 2 xxx {-code 1 -level 1 -errorcode NONE -errorstack *}}
 
 cleanupTests
 }	;#  End of [interp eval $testInterp]