+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
#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}
}
-#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