From 9e5604a23d758b7b2d08ed457d737c69b7aea2a5 Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Mon, 21 Dec 2009 16:30:08 +0000 Subject: [PATCH] 1.0.33.28: Display descriptions for internal errors in the runtime. * In genesis, output a define with the descriptions of internal errors. * In interr.c, create an array with said descriptions and use it when describing an internal error. --- src/compiler/generic/genesis.lisp | 4 +++- src/runtime/interr.c | 5 ++++- version.lisp-expr | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/generic/genesis.lisp b/src/compiler/generic/genesis.lisp index edd8074..3470516 100644 --- a/src/compiler/generic/genesis.lisp +++ b/src/compiler/generic/genesis.lisp @@ -2832,7 +2832,9 @@ core and return a descriptor to it." (unless (eq nil (car current-error)) (format t "#define ~A ~D~%" (c-symbol-name (car current-error)) - i))))) + i)))) + (format t "#define INTERNAL_ERROR_NAMES \\~%~{~S~#[~:;, \\~%~]~}~%" + (map 'list #'cdr internal-errors))) (terpri) ;; I'm not really sure why this is in SB!C, since it seems diff --git a/src/runtime/interr.c b/src/runtime/interr.c index 3b0a882..2187fd8 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -117,6 +117,7 @@ corruption_warning_and_maybe_lose(char *fmt, ...) #endif } +char *internal_error_descriptions[] = {INTERNAL_ERROR_NAMES}; /* internal error handler for when the Lisp error system doesn't exist * * FIXME: Shouldn't error output go to stderr instead of stdout? (Alas, @@ -129,7 +130,9 @@ describe_internal_error(os_context_t *context) int len, scoffset, sc, offset, ch; len = *ptr++; - printf("internal error #%d\n", *ptr++); + printf("internal error #%d (%s)\n", *ptr, + internal_error_descriptions[*ptr]); + ptr++; len--; while (len > 0) { scoffset = *ptr++; diff --git a/version.lisp-expr b/version.lisp-expr index d9e1bc8..7c5ac2a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.33.27" +"1.0.33.28" -- 1.7.10.4