/* Debugging extensions for Guile
- * Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation
+ * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <stdio.h>
-#include "_scm.h"
-#include "eval.h"
-#include "stackchk.h"
-#include "throw.h"
-#include "macros.h"
-#include "smob.h"
-#include "procprop.h"
-#include "srcprop.h"
-#include "alist.h"
-#include "continuations.h"
-#include "strports.h"
-#include "read.h"
-#include "feature.h"
-#include "dynwind.h"
-#include "modules.h"
-#include "ports.h"
-#include "root.h"
-
-#include "validate.h"
-#include "debug.h"
+#include "libguile/_scm.h"
+#include "libguile/eval.h"
+#include "libguile/stackchk.h"
+#include "libguile/throw.h"
+#include "libguile/macros.h"
+#include "libguile/smob.h"
+#include "libguile/procprop.h"
+#include "libguile/srcprop.h"
+#include "libguile/alist.h"
+#include "libguile/continuations.h"
+#include "libguile/strports.h"
+#include "libguile/read.h"
+#include "libguile/feature.h"
+#include "libguile/dynwind.h"
+#include "libguile/modules.h"
+#include "libguile/ports.h"
+#include "libguile/root.h"
+#include "libguile/fluids.h"
+
+#include "libguile/validate.h"
+#include "libguile/debug.h"
\f
/* {Run time control of the debugging evaluator}
static SCM
with_traps_inner (void *data)
{
- SCM thunk = (SCM) data;
+ SCM thunk = SCM_PACK (data);
return scm_apply (thunk, SCM_EOL, SCM_EOL);
}
return scm_internal_dynamic_wind (with_traps_before,
with_traps_inner,
with_traps_after,
- (void *) thunk,
+ (void *) SCM_UNPACK (thunk),
&trap_flag);
}
#undef FUNC_NAME
/* {Memoized Source}
*/
-long scm_tc16_memoized;
-
+scm_bits_t scm_tc16_memoized;
static int
-prinmemoized (SCM obj,SCM port,scm_print_state *pstate)
+memoized_print (SCM obj, SCM port, scm_print_state *pstate)
{
int writingp = SCM_WRITINGP (pstate);
scm_puts ("#<memoized ", port);
* - constant: SCM_IM_DISPATCH
*/
-#include "variable.h"
-#include "procs.h"
+#include "libguile/variable.h"
+#include "libguile/procs.h"
SCM_DEFINE (scm_make_gloc, "make-gloc", 1, 1, 0,
(SCM var, SCM env),
#endif
SCM_VALIDATE_VARIABLE (1,var);
if (SCM_UNBNDP (env))
- env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
+ env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
else
SCM_VALIDATE_NULLORCONS (2,env);
return scm_make_memoized (SCM_VARVCELL (var) + 1, env);
cdr = SCM_MEMOIZED_EXP (cdr);
}
if (SCM_UNBNDP (env))
- env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
+ env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
else
SCM_VALIDATE_NULLORCONS (3,env);
return scm_make_memoized (scm_cons (car, cdr), env);
SCM_EOL,
SCM_ENV (proc))));
}
- case scm_tc7_contin:
case scm_tcs_subrs:
#ifdef CCLO
case scm_tc7_cclo:
return scm_procedure_property (proc, scm_sym_source);
default:
SCM_WTA(1,proc);
- return 0;
+ return SCM_BOOL_F;
}
}
#undef FUNC_NAME
switch (SCM_TYP7 (proc)) {
case scm_tcs_closures:
return SCM_ENV (proc);
- case scm_tc7_contin:
case scm_tcs_subrs:
#ifdef CCLO
case scm_tc7_cclo:
return SCM_EOL;
default:
SCM_WTA(1,proc);
- return 0;
+ return SCM_BOOL_F;
}
}
#undef FUNC_NAME
{
if (SCM_UNBNDP (env))
{
- SCM_VALIDATE_MEMOIZED (1,exp);
- return scm_eval_3 (SCM_MEMOIZED_EXP (exp), 0, SCM_MEMOIZED_ENV (exp));
+ SCM_VALIDATE_MEMOIZED (1, exp);
+ return scm_i_eval_x (SCM_MEMOIZED_EXP (exp), SCM_MEMOIZED_ENV (exp));
}
- return scm_eval_3 (exp, 1, env);
+ return scm_i_eval (exp, env);
}
#undef FUNC_NAME
vframe.vect = &vframe_vect_body;
vframe.vect[0].id = id;
scm_last_debug_frame = &vframe;
- answer = scm_eval_3 (exp, 1, env);
+ answer = scm_i_eval (exp, env);
scm_last_debug_frame = vframe.prev;
return answer;
}
* The debugging evaluator throws these on frame traps.
*/
-long scm_tc16_debugobj;
+scm_bits_t scm_tc16_debugobj;
static int
-prindebugobj (SCM obj,SCM port,scm_print_state *pstate)
+debugobj_print (SCM obj, SCM port, scm_print_state *pstate)
{
scm_puts ("#<debug-object ", port);
scm_intprint ((int) SCM_DEBUGOBJ_FRAME (obj), 16, port);
{
scm_init_opts (scm_debug_options, scm_debug_opts, SCM_N_DEBUG_OPTIONS);
- scm_tc16_memoized = scm_make_smob_type_mfpe ("memoized", 0,
- scm_markcdr, NULL, prinmemoized, NULL);
+ scm_tc16_memoized = scm_make_smob_type ("memoized", 0);
+ scm_set_smob_mark (scm_tc16_memoized, scm_markcdr);
+ scm_set_smob_print (scm_tc16_memoized, memoized_print);
- scm_tc16_debugobj = scm_make_smob_type_mfpe ("debug-object", 0,
- NULL, NULL, prindebugobj, NULL);
+ scm_tc16_debugobj = scm_make_smob_type ("debug-object", 0);
+ scm_set_smob_print (scm_tc16_debugobj, debugobj_print);
scm_sym_procname = SCM_CAR (scm_sysintern ("procname", SCM_UNDEFINED));
scm_sym_dots = SCM_CAR (scm_sysintern ("...", SCM_UNDEFINED));
#endif
scm_add_feature ("debug-extensions");
-#include "debug.x"
+#ifndef SCM_MAGIC_SNARFER
+#include "libguile/debug.x"
+#endif
}
/*