mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-05 23:20:38 +02:00
* On errors, show line and column information even for unnamed ports.
This commit is contained in:
parent
c4a9b7bbd1
commit
2f2b390c83
2 changed files with 28 additions and 13 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* backtrace.c (display_header): Make sure that line and column
|
||||||
|
information is shown independent of whether the port the code was
|
||||||
|
read from had an associated filename. Thanks to Martin
|
||||||
|
Grabmueller for providing this patch.
|
||||||
|
|
||||||
2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
2001-01-25 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
* fports.[ch] (scm_file_port_p): New primitive.
|
* fports.[ch] (scm_file_port_p): New primitive.
|
||||||
|
|
|
@ -86,20 +86,28 @@ SCM scm_the_last_stack_fluid;
|
||||||
static void
|
static void
|
||||||
display_header (SCM source, SCM port)
|
display_header (SCM source, SCM port)
|
||||||
{
|
{
|
||||||
SCM fname = (SCM_MEMOIZEDP (source)
|
if (SCM_MEMOIZEDP (source))
|
||||||
? scm_source_property (source, scm_sym_filename)
|
|
||||||
: SCM_BOOL_F);
|
|
||||||
if (SCM_STRINGP (fname))
|
|
||||||
{
|
{
|
||||||
scm_prin1 (fname, port, 0);
|
SCM fname = scm_source_property (source, scm_sym_filename);
|
||||||
scm_putc (':', port);
|
SCM line = scm_source_property (source, scm_sym_line);
|
||||||
scm_intprint (SCM_INUM (scm_source_property (source, scm_sym_line)) + 1,
|
SCM col = scm_source_property (source, scm_sym_column);
|
||||||
10,
|
|
||||||
port);
|
/* Dirk:FIXME:: Maybe we should store the _port_ rather than the
|
||||||
scm_putc (':', port);
|
* filename with the source properties? Then we could in case of
|
||||||
scm_intprint (SCM_INUM (scm_source_property (source, scm_sym_column)) + 1,
|
* non-file ports give at least some more details than just
|
||||||
10,
|
* "<unnamed port>". */
|
||||||
port);
|
if (SCM_STRINGP (fname))
|
||||||
|
scm_prin1 (fname, port, 0);
|
||||||
|
else
|
||||||
|
scm_puts ("<unnamed port>", port);
|
||||||
|
|
||||||
|
if (!SCM_FALSEP (line) && !SCM_FALSEP (col))
|
||||||
|
{
|
||||||
|
scm_putc (':', port);
|
||||||
|
scm_intprint (SCM_INUM (line) + 1, 10, port);
|
||||||
|
scm_putc (':', port);
|
||||||
|
scm_intprint (SCM_INUM (col) + 1, 10, port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
scm_puts ("ERROR", port);
|
scm_puts ("ERROR", port);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue