* __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Mon, 21 Apr 2003 14:39:37 +0000 (14:39 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Mon, 21 Apr 2003 14:39:37 +0000 (14:39 +0000)
* gc.card.c (scm_gc_marked_p): Fixed compiler warning when
compiling with SCM_DEBUG==1 by moving definition behind prototype.

* gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
functions such that they check if the object is a non-immediate.
Further, renamed identifiers to use the scm_dbg_ prefix and made
their inclusion into the lib dependent of the
SCM_DEBUG_DEBUGGER_SUPPORT compile time option.

libguile/ChangeLog
libguile/__scm.h
libguile/gc-card.c

index 71a49a4..c652972 100644 (file)
@@ -1,3 +1,19 @@
+2003-04-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * __scm.h (SCM_DEBUG_DEBUGGER_SUPPORT): New compile-time option.
+
+       * gc.card.c (scm_gc_marked_p): Fixed compiler warning when
+       compiling with SCM_DEBUG==1 by moving definition behind prototype.
+
+       * gc.card.c (scm_dbg_t_list_cell, scm_dbg_t_double_cell,
+       scm_dbg_gc_marked_p, scm_dbg_gc_get_card, scm_dbg_gc_get_bvec,
+       scm_t_list_cell_struct, scm_t_list_cell, scm_t_double_cell,
+       scm_gc_marked_p, scm_gc_get_card, scm_gc_get_bvec): Fixed
+       functions such that they check if the object is a non-immediate.
+       Further, renamed identifiers to use the scm_dbg_ prefix and made
+       their inclusion into the lib dependent of the
+       SCM_DEBUG_DEBUGGER_SUPPORT compile time option.
+
 2003-04-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
 
        * __scm.h: Fixed comment about the SCM_DEBUG_TYPING_STRICTNESS
index c20a9c2..195128a 100644 (file)
 #define SCM_DEBUG_TYPING_STRICTNESS 1
 #endif
 
+/* If SCM_DEBUG_DEBUGGER_SUPPORT is set to 1, guile will provide a set of
+ * special functions that support debugging with a debugger like gdb.  The
+ * behaviour of guile is not changed by this macro, only the set of functions
+ * that are available will differ.  All functions that are introduced this way
+ * have the prefix 'scm_dbg_'.  This allows to easily determine the set of
+ * support functions, given that your debugger provides automatic name
+ * completion.  Note that these functions are intended to be used during
+ * interactive debugging sessions only.  They are not considered part of
+ * guile's official API.  They may change or disappear without notice or
+ * deprecation phase.
+ */
+#ifndef SCM_DEBUG_DEBUGGER_SUPPORT
+#define SCM_DEBUG_DEBUGGER_SUPPORT SCM_DEBUG
+#endif
+
 \f
 
 /* {Feature Options}
index bc40471..a1dd866 100644 (file)
@@ -325,51 +325,52 @@ scm_i_init_card_freelist (scm_t_cell *  card, SCM *free_list,
 }
 
 
-#if (SCM_DEBUG_CELL_ACCESSES == 1)
-int
-scm_gc_marked_p (SCM obj)
-{
-  return SCM_GC_MARK_P(obj);
-}
-#endif
-
-#if 0
-/*
-  These functions are meant to be called from GDB as a debug aid.
-
-  I've left them as a convenience for future generations. --hwn.
- */
+#if (SCM_DEBUG_DEBUGGER_SUPPORT == 1)
 
-
-int scm_gc_marked_p (SCM obj);
-scm_t_cell * scm_gc_get_card (SCM obj);
-long * scm_gc_get_bvec (SCM obj);
-
-typedef struct scm_t_list_cell_struct {
+typedef struct scm_dbg_t_list_cell {
   scm_t_bits car;  
-  struct scm_t_list_cell_struct * cdr;
-} scm_t_list_cell;
+  struct scm_dbg_t_list_cell * cdr;
+} scm_dbg_t_list_cell;
 
 
-typedef struct scm_t_double_cell
-{
+typedef struct scm_dbg_t_double_cell {
   scm_t_bits word_0;
   scm_t_bits word_1;
   scm_t_bits word_2;
   scm_t_bits word_3;
-} scm_t_double_cell;
+} scm_dbg_t_double_cell;
 
 
+int scm_dbg_gc_marked_p (SCM obj);
+scm_t_cell * scm_dbg_gc_get_card (SCM obj);
+long * scm_dbg_gc_get_bvec (SCM obj);
+
+
+int
+scm_dbg_gc_marked_p (SCM obj)
+{
+  if (!SCM_IMP (obj))
+    return SCM_GC_MARK_P(obj);
+  else
+    return 0;
+}
 
 scm_t_cell *
-scm_gc_get_card (SCM obj)
+scm_dbg_gc_get_card (SCM obj)
 {
-  return SCM_GC_CELL_CARD(obj);
+  if (!SCM_IMP (obj))
+    return SCM_GC_CELL_CARD(obj);
+  else
+    return NULL;
 }
 
 long *
-scm_gc_get_bvec (SCM obj)
+scm_dbg_gc_get_bvec (SCM obj)
 {
-  return SCM_GC_CARD_BVEC(SCM_GC_CELL_CARD(obj));
+  if (!SCM_IMP (obj))
+    return SCM_GC_CARD_BVEC (SCM_GC_CELL_CARD (obj));
+  else
+    return NULL;
 }
+
 #endif