1996-10-14 03:24:16 +00:00
|
|
|
|
/* Printing of backtraces and error messages
|
* backtrace.c, backtrace.h, debug.c, debug.h, eq.c,
gdb_interface.h, gdbint.c, gdbint.h, gh_data.c, gh_init.c,
gh_io.c, gh_list.c, gh_predicates.c, gh_test_c.c, gh_test_repl.c,
init.c, net_db.c, options.c, options.h, ports.c, print.c, read.c,
script.h, snarf.h, srcprop.c, srcprop.h, stacks.c, stacks.h,
throw.c: Update copyright years; these files have been worked on
significantly in 1997, but only had copyright years for 1996.
Also, change name of copyright holder on some from Mikael
Djurfeldt to Free Software Foundation; he has signed papers
assigning the changes to the FSF.
1997-05-16 09:14:28 +00:00
|
|
|
|
* Copyright (C) 1996,1997 Free Software Foundation
|
1996-10-14 03:24:16 +00:00
|
|
|
|
*
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
|
* any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
* along with this software; see the file COPYING. If not, write to
|
1997-05-26 22:34:48 +00:00
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
|
|
|
|
* Boston, MA 02111-1307 USA
|
1996-10-14 03:24:16 +00:00
|
|
|
|
*
|
|
|
|
|
|
* As a special exception, the Free Software Foundation gives permission
|
|
|
|
|
|
* for additional uses of the text contained in its release of GUILE.
|
|
|
|
|
|
*
|
|
|
|
|
|
* The exception is that, if you link the GUILE library with other files
|
|
|
|
|
|
* to produce an executable, this does not by itself cause the
|
|
|
|
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
|
|
|
|
* Your use of that executable is in no way restricted on account of
|
|
|
|
|
|
* linking the GUILE library code into it.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception does not however invalidate any other reasons why
|
|
|
|
|
|
* the executable file might be covered by the GNU General Public License.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception applies only to the code released by the
|
|
|
|
|
|
* Free Software Foundation under the name GUILE. If you copy
|
|
|
|
|
|
* code from other Free Software Foundation releases into a copy of
|
|
|
|
|
|
* GUILE, as the General Public License permits, the exception does
|
|
|
|
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
|
|
|
|
* anyone as to the status of such modified files, you must delete
|
|
|
|
|
|
* this exception notice from them.
|
|
|
|
|
|
*
|
|
|
|
|
|
* If you write modifications of your own for GUILE, it is your choice
|
|
|
|
|
|
* whether to permit this exception to apply to your modifications.
|
|
|
|
|
|
* If you do not wish that, delete this exception notice.
|
|
|
|
|
|
*
|
|
|
|
|
|
* The author can be reached at djurfeldt@nada.kth.se
|
1997-05-26 22:34:48 +00:00
|
|
|
|
* Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include "_scm.h"
|
|
|
|
|
|
#include "stacks.h"
|
|
|
|
|
|
#include "srcprop.h"
|
|
|
|
|
|
#include "genio.h"
|
|
|
|
|
|
#include "struct.h"
|
|
|
|
|
|
#include "strports.h"
|
1997-09-24 20:18:54 +00:00
|
|
|
|
#include "throw.h"
|
1997-11-29 01:10:21 +00:00
|
|
|
|
#include "fluids.h"
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
#include "backtrace.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* {Error reporting and backtraces}
|
|
|
|
|
|
* (A first approximation.)
|
|
|
|
|
|
*
|
|
|
|
|
|
* Note that these functions shouldn't generate errors themselves.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SCM_RECKLESS
|
|
|
|
|
|
#undef SCM_ASSERT
|
|
|
|
|
|
#define SCM_ASSERT(_cond, _arg, _pos, _subr) \
|
|
|
|
|
|
if (!(_cond)) \
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static void display_header SCM_P ((SCM source, SCM port));
|
|
|
|
|
|
static void
|
|
|
|
|
|
display_header (source, port)
|
|
|
|
|
|
SCM source;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM fname = (SCM_NIMP (source) && SCM_MEMOIZEDP (source)
|
|
|
|
|
|
? scm_source_property (source, scm_i_filename)
|
|
|
|
|
|
: SCM_BOOL_F);
|
|
|
|
|
|
if (SCM_NIMP (fname) && SCM_STRINGP (fname))
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_prin1 (fname, port, 0);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc (':', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
scm_prin1 (scm_source_property (source, scm_i_line), port, 0);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc (':', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
scm_prin1 (scm_source_property (source, scm_i_column), port, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("ERROR", port);
|
|
|
|
|
|
scm_puts (": ", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1996-12-10 01:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
scm_display_error_message (message, args, port)
|
1996-10-14 03:24:16 +00:00
|
|
|
|
SCM message;
|
|
|
|
|
|
SCM args;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
{
|
|
|
|
|
|
int writingp;
|
|
|
|
|
|
char *start;
|
|
|
|
|
|
char *p;
|
|
|
|
|
|
|
Ensure that shared substrings are handled properly when passed to
a system call or other foreign function. Many thanks to Tim
Pierce!
* symbols.h (SCM_COERCE_SUBSTR): new macro.
* filesys.c (scm_chmod, scm_rename, scm_delete_file, scm_mkdir,
scm_rmdir, scm_opendir, scm_chdir, scm_symlink, scm_readlink,
scm_lstat), ports.c (scm_sys_make_void_port), posix.c (scm_utime,
scm_putenv, scm_setlocale, scm_mknod), stime.c (setzone,
scm_strftime), vports.c (scm_make_soft_port), backtrace.c
(scm_display_error_message): use RO macros when strings may be RO.
* error.c (scm_error_scm), filesys.c (scm_chown, scm_chmod,
scm_rename, scm_delete_file, scm_mkdir, scm_rmdir, scm_opendir,
scm_chdir, scm_symlink, scm_readlink, scm_lstat), ioext.c
(scm_freopen, scm_duplicate_port, scm_fdopen), net_db.c
(scm_gethost, scm_getnet, scm_getproto, scm_getserv), ports.c
(scm_sys_make_void_port), posix.c (scm_getgrgid, scm_utime,
scm_setlocale, scm_mknod), stime.c (setzone, scm_strptime,
scm_strftime), vports.c (scm_make_soft_port): use
SCM_COERCE_SUBSTR to make sure shared substrings are
null-terminated.
1997-05-12 22:43:10 +00:00
|
|
|
|
if (SCM_IMP (message) || !SCM_ROSTRINGP (message) || SCM_IMP (args)
|
1997-03-13 00:22:20 +00:00
|
|
|
|
|| !scm_list_p (args))
|
1996-10-14 03:24:16 +00:00
|
|
|
|
{
|
|
|
|
|
|
scm_prin1 (message, port, 0);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc ('\n', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
Ensure that shared substrings are handled properly when passed to
a system call or other foreign function. Many thanks to Tim
Pierce!
* symbols.h (SCM_COERCE_SUBSTR): new macro.
* filesys.c (scm_chmod, scm_rename, scm_delete_file, scm_mkdir,
scm_rmdir, scm_opendir, scm_chdir, scm_symlink, scm_readlink,
scm_lstat), ports.c (scm_sys_make_void_port), posix.c (scm_utime,
scm_putenv, scm_setlocale, scm_mknod), stime.c (setzone,
scm_strftime), vports.c (scm_make_soft_port), backtrace.c
(scm_display_error_message): use RO macros when strings may be RO.
* error.c (scm_error_scm), filesys.c (scm_chown, scm_chmod,
scm_rename, scm_delete_file, scm_mkdir, scm_rmdir, scm_opendir,
scm_chdir, scm_symlink, scm_readlink, scm_lstat), ioext.c
(scm_freopen, scm_duplicate_port, scm_fdopen), net_db.c
(scm_gethost, scm_getnet, scm_getproto, scm_getserv), ports.c
(scm_sys_make_void_port), posix.c (scm_getgrgid, scm_utime,
scm_setlocale, scm_mknod), stime.c (setzone, scm_strptime,
scm_strftime), vports.c (scm_make_soft_port): use
SCM_COERCE_SUBSTR to make sure shared substrings are
null-terminated.
1997-05-12 22:43:10 +00:00
|
|
|
|
SCM_COERCE_SUBSTR (message);
|
|
|
|
|
|
start = SCM_ROCHARS (message);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
for (p = start; *p != '\0'; ++p)
|
|
|
|
|
|
if (*p == '%')
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_IMP (args) || SCM_NCONSP (args))
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
++p;
|
|
|
|
|
|
if (*p == 's')
|
|
|
|
|
|
writingp = 0;
|
|
|
|
|
|
else if (*p == 'S')
|
|
|
|
|
|
writingp = 1;
|
|
|
|
|
|
else
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_lfwrite (start, p - start - 1, port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
scm_prin1 (SCM_CAR (args), port, writingp);
|
|
|
|
|
|
args = SCM_CDR (args);
|
|
|
|
|
|
start = p + 1;
|
|
|
|
|
|
}
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_lfwrite (start, p - start, port);
|
|
|
|
|
|
scm_putc ('\n', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void display_expression SCM_P ((SCM frame, SCM pname, SCM source, SCM port));
|
|
|
|
|
|
static void
|
|
|
|
|
|
display_expression (frame, pname, source, port)
|
|
|
|
|
|
SCM frame;
|
|
|
|
|
|
SCM pname;
|
|
|
|
|
|
SCM source;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM print_state = scm_make_print_state ();
|
|
|
|
|
|
scm_print_state *pstate = SCM_PRINT_STATE (print_state);
|
|
|
|
|
|
pstate->writingp = 0;
|
|
|
|
|
|
pstate->fancyp = 1;
|
|
|
|
|
|
pstate->level = 2;
|
|
|
|
|
|
pstate->length = 3;
|
|
|
|
|
|
if (SCM_NIMP (pname) && SCM_ROSTRINGP (pname))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_NIMP (frame)
|
|
|
|
|
|
&& SCM_FRAMEP (frame)
|
|
|
|
|
|
&& SCM_FRAME_EVAL_ARGS_P (frame))
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("While evaluating arguments to ", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
else
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("In procedure ", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
scm_iprin1 (pname, port, pstate);
|
|
|
|
|
|
if (SCM_NIMP (source) && SCM_MEMOIZEDP (source))
|
|
|
|
|
|
{
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts (" in expression ", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
pstate->writingp = 1;
|
|
|
|
|
|
scm_iprin1 (scm_unmemoize (source), port, pstate);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (SCM_NIMP (source))
|
|
|
|
|
|
{
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("In expression ", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
pstate->writingp = 1;
|
|
|
|
|
|
scm_iprin1 (scm_unmemoize (source), port, pstate);
|
|
|
|
|
|
}
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts (":\n", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
scm_free_print_state (print_state);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1997-09-24 20:18:54 +00:00
|
|
|
|
struct display_error_args {
|
|
|
|
|
|
SCM stack;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
SCM subr;
|
|
|
|
|
|
SCM message;
|
|
|
|
|
|
SCM args;
|
|
|
|
|
|
SCM rest;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static SCM
|
|
|
|
|
|
display_error_body (struct display_error_args *a, SCM jmpbuf)
|
1996-10-14 03:24:16 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM current_frame = SCM_BOOL_F;
|
|
|
|
|
|
SCM source = SCM_BOOL_F;
|
|
|
|
|
|
SCM pname = SCM_BOOL_F;
|
1996-10-17 23:32:47 +00:00
|
|
|
|
if (SCM_DEBUGGINGP
|
1997-09-24 20:18:54 +00:00
|
|
|
|
&& SCM_NIMP (a->stack)
|
|
|
|
|
|
&& SCM_STACKP (a->stack)
|
|
|
|
|
|
&& SCM_STACK_LENGTH (a->stack) > 0)
|
1996-10-14 03:24:16 +00:00
|
|
|
|
{
|
1997-09-24 20:18:54 +00:00
|
|
|
|
current_frame = scm_stack_ref (a->stack, SCM_INUM0);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
source = SCM_FRAME_SOURCE (current_frame);
|
|
|
|
|
|
if (!(SCM_NIMP (source) && SCM_MEMOIZEDP (source)))
|
|
|
|
|
|
source = SCM_FRAME_SOURCE (SCM_FRAME_PREV (current_frame));
|
|
|
|
|
|
if (SCM_FRAME_PROC_P (current_frame)
|
1996-12-18 09:40:46 +00:00
|
|
|
|
&& scm_procedure_p (SCM_FRAME_PROC (current_frame)) == SCM_BOOL_T)
|
1996-10-14 03:24:16 +00:00
|
|
|
|
pname = scm_procedure_name (SCM_FRAME_PROC (current_frame));
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!(SCM_NIMP (pname) && SCM_ROSTRINGP (pname)))
|
1997-09-24 20:18:54 +00:00
|
|
|
|
pname = a->subr;
|
1996-10-14 03:24:16 +00:00
|
|
|
|
if ((SCM_NIMP (source) && SCM_MEMOIZEDP (source))
|
|
|
|
|
|
|| (SCM_NIMP (pname) && SCM_ROSTRINGP (pname)))
|
|
|
|
|
|
{
|
1997-09-24 20:18:54 +00:00
|
|
|
|
display_header (source, a->port);
|
|
|
|
|
|
display_expression (current_frame, pname, source, a->port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
1997-09-24 20:18:54 +00:00
|
|
|
|
display_header (source, a->port);
|
|
|
|
|
|
scm_display_error_message (a->message, a->args, a->port);
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct display_error_handler_data {
|
|
|
|
|
|
char *mode;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* This is the exception handler for error reporting routines.
|
|
|
|
|
|
Note that it is very important that this handler *doesn't* try to
|
|
|
|
|
|
print more than the error tag, since the error very probably is
|
|
|
|
|
|
caused by an erroneous print call-back routine. If we would
|
|
|
|
|
|
tru to print all objects, we would enter an infinite loop. */
|
|
|
|
|
|
static SCM
|
|
|
|
|
|
display_error_handler (struct display_error_handler_data *data,
|
|
|
|
|
|
SCM tag, SCM args)
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM print_state = scm_make_print_state ();
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("\nException during displaying of ", data->port);
|
|
|
|
|
|
scm_puts (data->mode, data->port);
|
|
|
|
|
|
scm_puts (": ", data->port);
|
1997-09-24 20:18:54 +00:00
|
|
|
|
scm_iprin1 (tag, data->port, SCM_PRINT_STATE (print_state));
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc ('\n', data->port);
|
1997-09-24 20:18:54 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC(s_display_error, "display-error", 6, 0, 0, scm_display_error);
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_display_error (stack, port, subr, message, args, rest)
|
|
|
|
|
|
SCM stack;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
SCM subr;
|
|
|
|
|
|
SCM message;
|
|
|
|
|
|
SCM args;
|
|
|
|
|
|
SCM rest;
|
|
|
|
|
|
{
|
|
|
|
|
|
struct display_error_args a = { stack, port, subr, message, args, rest };
|
|
|
|
|
|
struct display_error_handler_data data = { "error", port };
|
|
|
|
|
|
scm_internal_catch (SCM_BOOL_T,
|
|
|
|
|
|
(scm_catch_body_t) display_error_body, &a,
|
|
|
|
|
|
(scm_catch_handler_t) display_error_handler, &data);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void indent SCM_P ((int n, SCM port));
|
|
|
|
|
|
static void
|
|
|
|
|
|
indent (n, port)
|
|
|
|
|
|
int n;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
{
|
|
|
|
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < n; ++i)
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc (' ', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void display_frame_expr SCM_P ((char *hdr, SCM exp, char *tlr, int indentation, SCM sport, SCM port, scm_print_state *pstate));
|
|
|
|
|
|
static void
|
|
|
|
|
|
display_frame_expr (hdr, exp, tlr, indentation, sport, port, pstate)
|
|
|
|
|
|
char *hdr;
|
|
|
|
|
|
SCM exp;
|
|
|
|
|
|
char *tlr;
|
|
|
|
|
|
int indentation;
|
|
|
|
|
|
SCM sport;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
scm_print_state *pstate;
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_NIMP (exp) && SCM_CONSP (exp))
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_iprlist (hdr, exp, tlr[0], port, pstate);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts (&tlr[1], port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
scm_iprin1 (exp, port, pstate);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc ('\n', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1997-03-07 21:42:32 +00:00
|
|
|
|
static void display_application SCM_P ((SCM frame, int indentation, SCM sport, SCM port, scm_print_state *pstate));
|
|
|
|
|
|
static void
|
|
|
|
|
|
display_application (frame, indentation, sport, port, pstate)
|
|
|
|
|
|
SCM frame;
|
|
|
|
|
|
int indentation;
|
|
|
|
|
|
SCM sport;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
scm_print_state *pstate;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM proc = SCM_FRAME_PROC (frame);
|
|
|
|
|
|
SCM name = (SCM_NFALSEP (scm_procedure_p (proc))
|
|
|
|
|
|
? scm_procedure_name (proc)
|
|
|
|
|
|
: SCM_BOOL_F);
|
|
|
|
|
|
display_frame_expr ("[",
|
|
|
|
|
|
scm_cons (SCM_NFALSEP (name) ? name : proc,
|
|
|
|
|
|
SCM_FRAME_ARGS (frame)),
|
|
|
|
|
|
SCM_FRAME_EVAL_ARGS_P (frame) ? " ..." : "]",
|
|
|
|
|
|
indentation,
|
|
|
|
|
|
sport,
|
|
|
|
|
|
port,
|
|
|
|
|
|
pstate);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM_PROC(s_display_application, "display-application", 1, 1, 0, scm_display_application);
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_display_application (SCM frame, SCM port)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_UNBNDP (port))
|
|
|
|
|
|
port = scm_cur_outp;
|
|
|
|
|
|
if (SCM_FRAME_PROC_P (frame))
|
|
|
|
|
|
/* Display an application. */
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM print_state;
|
|
|
|
|
|
scm_print_state *pstate;
|
|
|
|
|
|
|
|
|
|
|
|
/* Create a print state for printing of frames. */
|
|
|
|
|
|
print_state = scm_make_print_state ();
|
|
|
|
|
|
pstate = SCM_PRINT_STATE (print_state);
|
|
|
|
|
|
pstate->writingp = 1;
|
|
|
|
|
|
pstate->fancyp = 1;
|
|
|
|
|
|
pstate->level = 2;
|
|
|
|
|
|
pstate->length = 9;
|
|
|
|
|
|
|
|
|
|
|
|
display_application (frame, 0, SCM_BOOL_F, port, pstate); /*fixme*/
|
|
|
|
|
|
return SCM_BOOL_T;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-14 03:24:16 +00:00
|
|
|
|
static void display_frame SCM_P ((SCM frame, int nfield, int indentation, SCM sport, SCM port, scm_print_state *pstate));
|
|
|
|
|
|
static void
|
|
|
|
|
|
display_frame (frame, nfield, indentation, sport, port, pstate)
|
|
|
|
|
|
SCM frame;
|
|
|
|
|
|
int nfield;
|
|
|
|
|
|
int indentation;
|
|
|
|
|
|
SCM sport;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
scm_print_state *pstate;
|
|
|
|
|
|
{
|
|
|
|
|
|
int n, i, j;
|
|
|
|
|
|
|
|
|
|
|
|
/* Announce missing frames? */
|
|
|
|
|
|
if (!SCM_BACKWARDS_P && SCM_FRAME_OVERFLOW_P (frame))
|
|
|
|
|
|
{
|
|
|
|
|
|
indent (nfield + 1 + indentation, port);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("...\n", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Check size of frame number. */
|
|
|
|
|
|
n = SCM_FRAME_NUMBER (frame);
|
|
|
|
|
|
for (i = 0, j = n; j > 0; ++i) j /= 10;
|
|
|
|
|
|
|
|
|
|
|
|
/* Number indentation. */
|
|
|
|
|
|
indent (nfield - (i ? i : 1), port);
|
|
|
|
|
|
|
|
|
|
|
|
/* Frame number. */
|
|
|
|
|
|
scm_iprin1 (SCM_MAKINUM (n), port, pstate);
|
|
|
|
|
|
|
|
|
|
|
|
/* Real frame marker */
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_putc (SCM_FRAME_REAL_P (frame) ? '*' : ' ', port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
/* Indentation. */
|
|
|
|
|
|
indent (indentation, port);
|
|
|
|
|
|
|
|
|
|
|
|
if (SCM_FRAME_PROC_P (frame))
|
|
|
|
|
|
/* Display an application. */
|
1997-03-07 21:42:32 +00:00
|
|
|
|
display_application (frame, nfield + 1 + indentation, sport, port, pstate);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
else
|
|
|
|
|
|
/* Display a special form. */
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM source = SCM_FRAME_SOURCE (frame);
|
|
|
|
|
|
SCM copy = scm_source_property (source, scm_i_copy);
|
|
|
|
|
|
display_frame_expr ("(",
|
|
|
|
|
|
SCM_NIMP (copy) && SCM_CONSP (copy)
|
|
|
|
|
|
? copy
|
|
|
|
|
|
: scm_unmemoize (source),
|
|
|
|
|
|
")",
|
|
|
|
|
|
nfield + 1 + indentation,
|
|
|
|
|
|
sport,
|
|
|
|
|
|
port,
|
|
|
|
|
|
pstate);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Announce missing frames? */
|
|
|
|
|
|
if (SCM_BACKWARDS_P && SCM_FRAME_OVERFLOW_P (frame))
|
|
|
|
|
|
{
|
|
|
|
|
|
indent (nfield + 1 + indentation, port);
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("...\n", port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1997-09-24 20:18:54 +00:00
|
|
|
|
struct display_backtrace_args {
|
|
|
|
|
|
SCM stack;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
SCM first;
|
|
|
|
|
|
SCM depth;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
1996-10-14 03:24:16 +00:00
|
|
|
|
SCM_PROC(s_display_backtrace, "display-backtrace", 2, 2, 0, scm_display_backtrace);
|
1997-09-24 20:18:54 +00:00
|
|
|
|
|
|
|
|
|
|
static SCM
|
|
|
|
|
|
display_backtrace_body (struct display_backtrace_args *a, SCM jmpbuf)
|
1996-10-14 03:24:16 +00:00
|
|
|
|
{
|
|
|
|
|
|
int n_frames, beg, end, n, i, j;
|
|
|
|
|
|
int nfield, indent_p, indentation;
|
|
|
|
|
|
SCM frame, sport, print_state;
|
|
|
|
|
|
scm_print_state *pstate;
|
|
|
|
|
|
|
* filesys.c (scm_close, set_element, get_element, scm_chown,
scm_chmod, scm_stat, scm_truncate_file, scm_fcntl, scm_fsync): Use
SCM_COERCE_OUTPORT to cope with the printstate/port magic.
* ports.c (scm_port_revealed, scm_set_port_revealed_x,
scm_close_port, scm_port_line, scm_set_port_line_x,
scm_port_column, scm_set_port_column_x, scm_port_filename,
scm_set_port_filename_x, scm_port_mode,
scm_close_all_ports_except, scm_set_current_output_port,
scm_set_current_error_port): Likewise
* ioext.c (scm_redirect_port, scm_dup_to_fdes, scm_freopen,
scm_ftell, scm_fileno, scm_isatty_p, scm_primitive_move_to_fdes):
Likewise
* posix.c (scm_ttyname, scm_tcgetpgrp, scm_tcsetpgrp): Likewise
* backtrace.c (display_backtrace_body): Likewise
* fports (scm_setvbuf): Likewise
* socket.c (scm_getsockopt, scm_setsockopt, scm_shutdown,
scm_connect, scm_bind, scm_listen, scm_accept, scm_getsockname,
scm_getpeername, scm_send, scm_sendto): Likewise
* unif.c (scm_uniform_array_write): Likewise
1997-10-25 21:54:12 +00:00
|
|
|
|
a->port = SCM_COERCE_OUTPORT (a->port);
|
|
|
|
|
|
|
1996-10-14 03:24:16 +00:00
|
|
|
|
/* Argument checking and extraction. */
|
1997-09-24 20:18:54 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (a->stack) && SCM_STACKP (a->stack),
|
|
|
|
|
|
a->stack,
|
1996-10-14 03:24:16 +00:00
|
|
|
|
SCM_ARG1,
|
|
|
|
|
|
s_display_backtrace);
|
1997-09-24 20:18:54 +00:00
|
|
|
|
SCM_ASSERT (SCM_NIMP (a->port) && SCM_OPOUTPORTP (a->port),
|
|
|
|
|
|
a->port,
|
1996-10-14 03:24:16 +00:00
|
|
|
|
SCM_ARG2,
|
|
|
|
|
|
s_display_backtrace);
|
1997-09-24 20:18:54 +00:00
|
|
|
|
n_frames = SCM_INUM (scm_stack_length (a->stack));
|
|
|
|
|
|
n = SCM_INUMP (a->depth) ? SCM_INUM (a->depth) : SCM_BACKTRACE_DEPTH;
|
1996-10-14 03:24:16 +00:00
|
|
|
|
if (SCM_BACKWARDS_P)
|
|
|
|
|
|
{
|
1997-09-24 20:18:54 +00:00
|
|
|
|
beg = SCM_INUMP (a->first) ? SCM_INUM (a->first) : 0;
|
1996-10-14 03:24:16 +00:00
|
|
|
|
end = beg + n - 1;
|
|
|
|
|
|
if (end >= n_frames)
|
|
|
|
|
|
end = n_frames - 1;
|
|
|
|
|
|
n = end - beg + 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
1997-09-24 20:18:54 +00:00
|
|
|
|
if (SCM_INUMP (a->first))
|
1996-10-14 03:24:16 +00:00
|
|
|
|
{
|
1997-09-24 20:18:54 +00:00
|
|
|
|
beg = SCM_INUM (a->first);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
end = beg - n + 1;
|
|
|
|
|
|
if (end < 0)
|
|
|
|
|
|
end = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
beg = n - 1;
|
|
|
|
|
|
end = 0;
|
|
|
|
|
|
if (beg >= n_frames)
|
|
|
|
|
|
beg = n_frames - 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
n = beg - end + 1;
|
|
|
|
|
|
}
|
1997-09-24 20:18:54 +00:00
|
|
|
|
SCM_ASSERT (beg >= 0 && beg < n_frames, a->first, SCM_ARG3, s_display_backtrace);
|
|
|
|
|
|
SCM_ASSERT (n > 0, a->depth, SCM_ARG4, s_display_backtrace);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
/* Create a string port used for adaptation of printing parameters. */
|
|
|
|
|
|
sport = scm_mkstrport (SCM_INUM0,
|
|
|
|
|
|
scm_make_string (SCM_MAKINUM (240), SCM_UNDEFINED),
|
|
|
|
|
|
SCM_OPN | SCM_WRTNG,
|
|
|
|
|
|
s_display_backtrace);
|
|
|
|
|
|
|
|
|
|
|
|
/* Create a print state for printing of frames. */
|
|
|
|
|
|
print_state = scm_make_print_state ();
|
|
|
|
|
|
pstate = SCM_PRINT_STATE (print_state);
|
|
|
|
|
|
pstate->writingp = 1;
|
|
|
|
|
|
pstate->fancyp = 1;
|
1997-03-07 21:42:32 +00:00
|
|
|
|
pstate->level = 2;
|
|
|
|
|
|
pstate->length = 3;
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
/* First find out if it's reasonable to do indentation. */
|
|
|
|
|
|
if (SCM_BACKWARDS_P)
|
|
|
|
|
|
indent_p = 0;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
indent_p = 1;
|
1997-09-24 20:18:54 +00:00
|
|
|
|
frame = scm_stack_ref (a->stack, SCM_MAKINUM (beg));
|
1996-10-14 03:24:16 +00:00
|
|
|
|
for (i = 0, j = 0; i < n; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_FRAME_REAL_P (frame))
|
|
|
|
|
|
++j;
|
|
|
|
|
|
if (j > SCM_BACKTRACE_INDENT)
|
|
|
|
|
|
{
|
|
|
|
|
|
indent_p = 0;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
frame = (SCM_BACKWARDS_P
|
|
|
|
|
|
? SCM_FRAME_PREV (frame)
|
|
|
|
|
|
: SCM_FRAME_NEXT (frame));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Determine size of frame number field. */
|
1997-09-24 20:18:54 +00:00
|
|
|
|
j = SCM_FRAME_NUMBER (scm_stack_ref (a->stack, SCM_MAKINUM (end)));
|
1996-10-14 03:24:16 +00:00
|
|
|
|
for (i = 0; j > 0; ++i) j /= 10;
|
|
|
|
|
|
nfield = i ? i : 1;
|
|
|
|
|
|
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("Backtrace:\n", a->port);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
/* Print frames. */
|
1997-09-24 20:18:54 +00:00
|
|
|
|
frame = scm_stack_ref (a->stack, SCM_MAKINUM (beg));
|
1996-10-14 03:24:16 +00:00
|
|
|
|
indentation = 1;
|
1997-09-24 20:18:54 +00:00
|
|
|
|
display_frame (frame, nfield, indentation, sport, a->port, pstate);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
for (i = 1; i < n; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (indent_p && SCM_FRAME_EVAL_ARGS_P (frame))
|
|
|
|
|
|
++indentation;
|
|
|
|
|
|
frame = SCM_BACKWARDS_P ? SCM_FRAME_PREV (frame) : SCM_FRAME_NEXT (frame);
|
1997-09-24 20:18:54 +00:00
|
|
|
|
display_frame (frame, nfield, indentation, sport, a->port, pstate);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
}
|
1997-09-24 20:18:54 +00:00
|
|
|
|
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_display_backtrace (stack, port, first, depth)
|
|
|
|
|
|
SCM stack;
|
|
|
|
|
|
SCM port;
|
|
|
|
|
|
SCM first;
|
|
|
|
|
|
SCM depth;
|
|
|
|
|
|
{
|
|
|
|
|
|
struct display_backtrace_args a = { stack, port, first, depth };
|
|
|
|
|
|
struct display_error_handler_data data = { "backtrace", port };
|
|
|
|
|
|
scm_internal_catch (SCM_BOOL_T,
|
|
|
|
|
|
(scm_catch_body_t) display_backtrace_body, &a,
|
|
|
|
|
|
(scm_catch_handler_t) display_error_handler, &data);
|
1996-10-14 03:24:16 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1997-03-21 22:53:08 +00:00
|
|
|
|
SCM_VCELL (scm_has_shown_backtrace_hint_p_var, "has-shown-backtrace-hint?");
|
1997-02-10 01:01:54 +00:00
|
|
|
|
|
|
|
|
|
|
SCM_PROC(s_backtrace, "backtrace", 0, 0, 0, scm_backtrace);
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_backtrace ()
|
|
|
|
|
|
{
|
1997-11-29 01:10:21 +00:00
|
|
|
|
SCM the_last_stack = scm_fluid_ref (SCM_CDR (scm_the_last_stack_var));
|
|
|
|
|
|
if (SCM_NFALSEP (the_last_stack))
|
1997-02-10 01:01:54 +00:00
|
|
|
|
{
|
|
|
|
|
|
scm_newline (scm_cur_outp);
|
1997-11-29 01:10:21 +00:00
|
|
|
|
scm_display_backtrace (the_last_stack,
|
1997-02-10 01:01:54 +00:00
|
|
|
|
scm_cur_outp,
|
|
|
|
|
|
SCM_UNDEFINED,
|
|
|
|
|
|
SCM_UNDEFINED);
|
|
|
|
|
|
scm_newline (scm_cur_outp);
|
|
|
|
|
|
if (SCM_FALSEP (SCM_CDR (scm_has_shown_backtrace_hint_p_var))
|
|
|
|
|
|
&& !SCM_BACKTRACE_P)
|
|
|
|
|
|
{
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("Type \"(debug-enable 'backtrace)\" if you would like "
|
|
|
|
|
|
"a backtrace\n"
|
|
|
|
|
|
"automatically if an error occurs in the future.\n",
|
|
|
|
|
|
scm_cur_outp);
|
1997-02-10 01:01:54 +00:00
|
|
|
|
SCM_SETCDR (scm_has_shown_backtrace_hint_p_var, SCM_BOOL_T);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
* Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
mbstrings.c.
(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
* unif.c (scm_vector_set_length_x): Don't handle multibyte
strings.
* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
(scm_tag): Don't handle multibyte strings.
* read.c: Don't include mbstrings.h.
(scm_lreadr): Don't handle multibyte ports.
* kw.c: Don't include mbstrings.h.
* init.c: Don't include mbstrings.h.
(scm_boot_guile_1): Don't init mbstrings module.
* hash.c (scm_hasher): Don't handle mbstrings.
* gscm.c (gscm_run_scm): Don't init mbstrings module.
* gc.c (scm_gc_mark): Don't handle mbstrings.
(scm_gc_sweep): Likewise.
* eval.c (SCM_CEVAL): Don't handle mbstrings.
* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
* tags.h (SCM_TYP7SD): Removed.
(SCM_TYP7D): Removed.
(scm_tc7_mb_string): Removed.
(scm_tc7_mb_substring): Removed.
* print.c (scm_iprin1): Handle char printing directly. Don't
handle mbstrings.
Don't include "mbstrings.h".
* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
multi-byte flag.
Don't include "mbstrings.h".
* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
(SCM_SYMBOL_SLOTS): Define as 4.
(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
struct.c, threads.c, throw.c, unif.c, variable.c: Use new
("gen"-less) I/O function names.
* ports.c (scm_add_to_port_table): Don't set port's
representation.
* ports.h (scm_port_representation_type): Removed.
(scm_string_representation_type): Removed.
(struct scm_port_table ): Removed representation field.
(SCM_PORT_REPRESENTATION): Removed.
(SCM_SET_PORT_REPRESENTATION): Removed.
* genio.h: Use new function names.
* genio.c: Don't include "extchrs.h".
(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
Removed.
(scm_putc, scm_puts, scm_lfwrite): No longer static.
(scm_getc): No longer static; handle line and column changes.
(scm_ungetc): Renamed from scm_gen_ungetc.
(scm_do_read_line): Renamed from scm_gen_read_line.
* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
|
|
|
|
scm_puts ("No backtrace available.\n", scm_cur_outp);
|
1997-02-10 01:01:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-14 03:24:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
scm_init_backtrace ()
|
|
|
|
|
|
{
|
1997-11-29 01:10:21 +00:00
|
|
|
|
SCM f = scm_make_fluid ();
|
|
|
|
|
|
scm_the_last_stack_var = scm_sysintern ("the-last-stack", f);
|
1997-02-10 01:01:54 +00:00
|
|
|
|
|
1996-10-14 03:24:16 +00:00
|
|
|
|
#include "backtrace.x"
|
|
|
|
|
|
}
|