diff options
author | dgp <dgp@users.sourceforge.net> | 2006-01-11 17:34:53 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-01-11 17:34:53 (GMT) |
commit | 4fba402584534545a54e1ab6066c6858f2fe05a6 (patch) | |
tree | a35f7dcda6d1cd258e9898b035bcffedb47c925e /generic/tclBasic.c | |
parent | 1e0895777cf0ddb9f7236c7812cf7f34f9b5815e (diff) | |
download | tcl-4fba402584534545a54e1ab6066c6858f2fe05a6.zip tcl-4fba402584534545a54e1ab6066c6858f2fe05a6.tar.gz tcl-4fba402584534545a54e1ab6066c6858f2fe05a6.tar.bz2 |
* generic/tclBasic.c: Moved Tcl_LogCommandInfo from tclBasic.c to
* generic/tclNamesp.c: tclNamesp.c to get access to identifier with
* tests/error.test (error-7.0): file scope. Added check for traces
on ::errorInfo, and when present fall back to contruction of the
stack trace in the variable so that write trace notification timings
are compatible with earlier Tcl releases. This reduces, but does not
completely eliminate the ***POTENTIAL INCOMPATIBILITY*** created by
the 2004-10-15 commit. [Bug 1397843].
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r-- | generic/tclBasic.c | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 19acbf5..735874b 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.186 2005/12/27 20:14:08 kennykb Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.187 2006/01/11 17:34:53 dgp Exp $ */ #include "tclInt.h" @@ -3510,66 +3510,6 @@ Tcl_EvalObjv( /* *---------------------------------------------------------------------- * - * Tcl_LogCommandInfo -- - * - * This function is invoked after an error occurs in an interpreter. It - * adds information to iPtr->errorInfo field to describe the command that - * was being executed when the error occurred. - * - * Results: - * None. - * - * Side effects: - * Information about the command is added to errorInfo and the line - * number stored internally in the interpreter is set. - * - *---------------------------------------------------------------------- - */ - -void -Tcl_LogCommandInfo( - Tcl_Interp *interp, /* Interpreter in which to log information. */ - CONST char *script, /* First character in script containing - * command (must be <= command). */ - CONST char *command, /* First character in command that generated - * the error. */ - int length) /* Number of bytes in command (-1 means use - * all bytes up to first null byte). */ -{ - register CONST char *p; - Interp *iPtr = (Interp *) interp; - int overflow, limit = 150; - - if (iPtr->flags & ERR_ALREADY_LOGGED) { - /* - * Someone else has already logged error information for this command; - * we shouldn't add anything more. - */ - - return; - } - - /* - * Compute the line number where the error occurred. - */ - - iPtr->errorLine = 1; - for (p = script; p != command; p++) { - if (*p == '\n') { - iPtr->errorLine++; - } - } - - overflow = (length > limit); - TclFormatToErrorInfo(interp, "\n %s\n\"%.*s%s\"", - ((iPtr->errorInfo == NULL) - ? "while executing" : "invoked from within"), - (overflow ? limit : length), command, (overflow ? "..." : "")); -} - -/* - *---------------------------------------------------------------------- - * * Tcl_EvalTokensStandard -- * * Given an array of tokens parsed from a Tcl command (e.g., the tokens |