guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile ChangeLog backtrace.c


From: Dirk Herrmann
Subject: guile/guile-core/libguile ChangeLog backtrace.c
Date: Thu, 25 Jan 2001 15:34:31 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  01/01/25 15:34:31

Modified files:
        guile-core/libguile: ChangeLog backtrace.c 

Log message:
        * On errors, show line and column information even for unnamed ports.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1249&r2=1.1250
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/backtrace.c.diff?r1=1.58&r2=1.59

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1249 
guile/guile-core/libguile/ChangeLog:1.1250
--- guile/guile-core/libguile/ChangeLog:1.1249  Thu Jan 25 09:40:50 2001
+++ guile/guile-core/libguile/ChangeLog Thu Jan 25 15:34:31 2001
@@ -1,5 +1,12 @@
 2001-01-25  Dirk Herrmann  <address@hidden>
 
+       * 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  <address@hidden>
+
        * fports.[ch] (scm_file_port_p):  New primitive.
 
 2001-01-25  Dirk Herrmann  <address@hidden>
Index: guile/guile-core/libguile/backtrace.c
diff -u guile/guile-core/libguile/backtrace.c:1.58 
guile/guile-core/libguile/backtrace.c:1.59
--- guile/guile-core/libguile/backtrace.c:1.58  Wed Jan 24 07:58:46 2001
+++ guile/guile-core/libguile/backtrace.c       Thu Jan 25 15:34:31 2001
@@ -86,20 +86,28 @@
 static void
 display_header (SCM source, SCM port)
 {
-  SCM fname = (SCM_MEMOIZEDP (source)
-              ? scm_source_property (source, scm_sym_filename)
-              : SCM_BOOL_F);
-  if (SCM_STRINGP (fname))
+  if (SCM_MEMOIZEDP (source))
     {
-      scm_prin1 (fname, port, 0);
-      scm_putc (':', port);
-      scm_intprint (SCM_INUM (scm_source_property (source, scm_sym_line)) + 1,
-                   10,
-                   port);
-      scm_putc (':', port);
-      scm_intprint (SCM_INUM (scm_source_property (source, scm_sym_column)) + 
1,
-                   10,
-                   port);
+      SCM fname = scm_source_property (source, scm_sym_filename);
+      SCM line = scm_source_property (source, scm_sym_line);
+      SCM col = scm_source_property (source, scm_sym_column);
+
+      /* Dirk:FIXME:: Maybe we should store the _port_ rather than the
+       * filename with the source properties?  Then we could in case of
+       * non-file ports give at least some more details than just
+       * "<unnamed 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
     scm_puts ("ERROR", port);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]