summaryrefslogtreecommitdiff
path: root/libguile/debug.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1996-11-02 20:53:18 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1996-11-02 20:53:18 +0000
commite38ecb055c5167669a1dfb102bd66857c4674c8e (patch)
treecd5fbad119885ad9998a35b16861c46b5fd26a3a /libguile/debug.c
parente412e180d4685289f102c289e3ef19243233a611 (diff)
downloadguile-e38ecb055c5167669a1dfb102bd66857c4674c8e.tar.gz
* debug.c (scm_m_start_stack): Bugfix: Use SCM_ECONSP instead of
SCM_CONSP since this is a macro!; Set vframe.prev to scm_last_debug_frame instead of 0. In this way we can look "above" the virtual start stack frame if we wish. (scm_debug_hang): New function: Useful for debugging Guile in certain tricky situations. Will probably be removed later...
Diffstat (limited to 'libguile/debug.c')
-rw-r--r--libguile/debug.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/libguile/debug.c b/libguile/debug.c
index b18c5165c..b989d2d65 100644
--- a/libguile/debug.c
+++ b/libguile/debug.c
@@ -160,8 +160,6 @@ scm_memoized_p (obj)
return SCM_NIMP (obj) && SCM_MEMOIZEDP (obj) ? SCM_BOOL_T : SCM_BOOL_F;
}
-SCM_PROC (s_make_memoized, "make-memoized", 2, 0, 0, scm_make_memoized);
-
SCM
scm_make_memoized (exp, env)
SCM exp;
@@ -290,10 +288,10 @@ scm_procedure_environment (proc)
/* Eval in a local environment. We would like to have the ability to
- * evaluate in a specified local environment, but due to the memoization
- * this isn't normally possible. We solve it by copying the code before
- * evaluating. Probably the best solution would be to have eval.c generate
- * yet another evaluator. They are not very big actually.
+ * evaluate in a specified local environment, but due to the
+ * memoization this isn't normally possible. We solve it by copying
+ * the code before evaluating. One solution would be to have eval.c
+ * generate yet another evaluator. They are not very big actually.
*/
SCM_PROC (s_local_eval, "local-eval", 1, 1, 0, scm_local_eval);
@@ -317,23 +315,22 @@ scm_m_start_stack (exp, env)
SCM env;
{
SCM answer;
- scm_debug_frame *oframe = scm_last_debug_frame;
scm_debug_frame vframe;
exp = SCM_CDR (exp);
SCM_ASSERT (SCM_NIMP (exp)
- && SCM_CONSP (exp)
+ && SCM_ECONSP (exp)
&& SCM_NIMP (SCM_CDR (exp))
- && SCM_CONSP (SCM_CDR (exp))
+ && SCM_ECONSP (SCM_CDR (exp))
&& SCM_NULLP (SCM_CDDR (exp)),
exp,
SCM_WNA,
s_start_stack);
- vframe.prev = 0;
+ vframe.prev = scm_last_debug_frame;
vframe.status = SCM_VOIDFRAME;
vframe.vect[0].id = scm_eval_car (exp, env);
scm_last_debug_frame = &vframe;
answer = scm_eval_car (SCM_CDR (exp), env);
- scm_last_debug_frame = oframe;
+ scm_last_debug_frame = vframe.prev;
return answer;
}
@@ -386,6 +383,19 @@ scm_make_debugobj (frame)
+SCM_PROC (s_debug_hang, "debug-hang", 0, 1, 0, scm_debug_hang);
+
+SCM
+scm_debug_hang (obj)
+ SCM obj;
+{
+ int go = 0;
+ while (!go) ;
+ return SCM_UNSPECIFIED;
+}
+
+
+
void
scm_init_debug ()
{