#include "value.h"
#include "scm-lang.h"
#include "valprint.h"
+#include "gdbcore.h"
+
+/* FIXME: Should be in a header file that we import. */
+extern int
+c_val_print PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *, int, int,
+ int, enum val_prettyprint));
+
+static void scm_ipruk PARAMS ((char *, LONGEST, GDB_FILE *));
+static void scm_scmlist_print PARAMS ((LONGEST, GDB_FILE *, int, int,
+ int, enum val_prettyprint));
+static int scm_inferior_print PARAMS ((LONGEST, GDB_FILE *, int, int,
+ int, enum val_prettyprint));
/* Prints the SCM value VALUE by invoking the inferior, if appropraite.
Returns >= 0 on succes; retunr -1 if the inferior cannot/should not
print VALUE. */
-int
+static int
scm_inferior_print (value, stream, format, deref_ref, recurse, pretty)
LONGEST value;
GDB_FILE *stream;
static char *scm_isymnames[] =
{
/* This table must agree with the declarations */
- "#@and",
- "#@begin",
- "#@case",
- "#@cond",
- "#@do",
- "#@if",
- "#@lambda",
- "#@let",
- "#@let*",
- "#@letrec",
- "#@or",
- "#@quote",
- "#@set!",
- "#@define",
+ "and",
+ "begin",
+ "case",
+ "cond",
+ "do",
+ "if",
+ "lambda",
+ "let",
+ "let*",
+ "letrec",
+ "or",
+ "quote",
+ "set!",
+ "define",
#if 0
- "#@literal-variable-ref",
- "#@literal-variable-set!",
+ "literal-variable-ref",
+ "literal-variable-set!",
#endif
- "#@apply",
- "#@call-with-current-continuation",
+ "apply",
+ "call-with-current-continuation",
/* user visible ISYMS */
/* other keywords */
"#<unspecified>"
};
-static int
+static void
scm_scmlist_print (svalue, stream, format, deref_ref, recurse, pretty)
LONGEST svalue;
GDB_FILE *stream;
if (recurse > 6)
{
fputs_filtered ("...", stream);
- return 0;
+ return;
}
scm_scmval_print (SCM_CAR (svalue), stream, format,
deref_ref, recurse + 1, pretty);
GDB_FILE *stream;
{
fprintf_filtered (stream, "#<unknown-%s", hdr);
-#define SCM_SIZE (SCM_TYPE ? TYPE_LENGTH (SCM_TYPE) : sizeof (void*))
+#define SCM_SIZE TYPE_LENGTH (builtin_type_scm)
if (SCM_CELLP (ptr))
fprintf_filtered (stream, " (0x%lx . 0x%lx) @",
(long) SCM_CAR (ptr), (long) SCM_CDR (ptr));
fprintf_filtered (stream, " 0x%x>", ptr);
}
-int
+void
scm_scmval_print (svalue, stream, format, deref_ref, recurse, pretty)
LONGEST svalue;
GDB_FILE *stream;
break;
case 1:
/* gloc */
- fputs_filtered ("#@", stream);
svalue = SCM_CAR (svalue - 1);
goto taloop;
default:
case scm_tcs_cons_gloc:
if (SCM_CDR (SCM_CAR (svalue) - 1L) == 0)
{
+#if 0
SCM name;
+#endif
fputs_filtered ("#<latte ", stream);
#if 1
fputs_filtered ("???", stream);
goto punk;
#endif
default:
- punk:scm_ipruk ("type", svalue, stream);
+#if 0
+ punk:
+#endif
+ scm_ipruk ("type", svalue, stream);
}
break;
}
{
if (is_scmvalue_type (type))
{
- LONGEST svalue = unpack_long (type, valaddr);
+ LONGEST svalue = extract_signed_integer (valaddr, TYPE_LENGTH (type));
if (scm_inferior_print (svalue, stream, format,
deref_ref, recurse, pretty) >= 0)
{