1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

(scm_ithrow): print out key symbol and string arguments

when error happens inside a critical section, and document why.
This commit is contained in:
Han-Wen Nienhuys 2007-01-10 11:42:04 +00:00
parent 391f57e6ad
commit a2c40dc7c0
2 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2007-01-10 Han-Wen Nienhuys <hanwen@lilypond.org>
* throw.c (scm_ithrow): print out key symbol and string arguments
when error happens inside a critical section, and document why.
2007-01-06 Han-Wen Nienhuys <hanwen@lilypond.org> 2007-01-06 Han-Wen Nienhuys <hanwen@lilypond.org>
* read.c (s_scm_read_hash_extend): document #f argument to * read.c (s_scm_read_hash_extend): document #f argument to

View file

@ -37,6 +37,7 @@
#include "libguile/validate.h" #include "libguile/validate.h"
#include "libguile/throw.h" #include "libguile/throw.h"
#include "libguile/init.h" #include "libguile/init.h"
#include "libguile/strings.h"
/* the jump buffer data structure */ /* the jump buffer data structure */
@ -695,7 +696,24 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED)
if (scm_i_critical_section_level) 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"); 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++)
if (scm_is_string (scm_car (s)))
fprintf (stderr, "argument %d: %s\n", i, scm_i_string_chars (scm_car (s)));
abort (); abort ();
} }