diff options
author | Ludovic Courtès <ludo@gnu.org> | 2008-09-10 22:33:40 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-10 22:33:40 +0200 |
commit | 4a4849dbe0ae1b731b408167f90222e05d1ca2bd (patch) | |
tree | caa909b99ffb221e43408a3d19ad3e8209e3a96b /libguile/throw.c | |
parent | 3ec17f28b8f96fa43218db83656c0d85b4f69d7c (diff) | |
parent | 032913739218c756f673bfb9c8f66ef9f8f02330 (diff) | |
download | guile-4a4849dbe0ae1b731b408167f90222e05d1ca2bd.tar.gz |
Merge commit '032913739218c756f673bfb9c8f66ef9f8f02330' into boehm-demers-weiser-gc
Conflicts:
libguile/gc.c
libguile/srcprop.c
libguile/srcprop.h
Diffstat (limited to 'libguile/throw.c')
-rw-r--r-- | libguile/throw.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libguile/throw.c b/libguile/throw.c index 115bb0c03..02503c36a 100644 --- a/libguile/throw.c +++ b/libguile/throw.c @@ -37,6 +37,10 @@ #include "libguile/validate.h" #include "libguile/throw.h" #include "libguile/init.h" +#include "libguile/strings.h" + +#include "libguile/private-options.h" + /* the jump buffer data structure */ @@ -695,7 +699,31 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED) if (scm_i_critical_section_level) { + SCM s = args; + int i = 0; + + /* + We have much better routines for displaying Scheme, but we're + already inside a pernicious error, and it's unlikely that they + are available to us. We try to print something useful anyway, + so users don't need a debugger to find out what went wrong. + */ fprintf (stderr, "throw from within critical section.\n"); + if (scm_is_symbol (key)) + fprintf (stderr, "error key: %s\n", scm_i_symbol_chars (key)); + + + for (; scm_is_pair (s); s = scm_cdr (s), i++) + { + char const *str = NULL; + if (scm_is_string (scm_car (s))) + str = scm_i_string_chars (scm_car (s)); + else if (scm_is_symbol (scm_car (s))) + str = scm_i_symbol_chars (scm_car (s)); + + if (str != NULL) + fprintf (stderr, "argument %d: %s\n", i, str); + } abort (); } |