diff options
author | Andy Wingo <wingo@pobox.com> | 2009-02-05 18:13:27 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-02-05 18:13:27 +0100 |
commit | 2f9769b60cec324e6d1cb13d8f5690342ac20152 (patch) | |
tree | 256544edb6e6dc6ff7965489fbc963f29f6f6604 /libguile/frames.c | |
parent | 3b9e095b44a618b9e5781adfaa287e14b0f44d03 (diff) | |
download | guile-2f9769b60cec324e6d1cb13d8f5690342ac20152.tar.gz |
fix the ping-pong between evaluator and vm stacks in make-stack
* libguile/frames.c (vm_frame_print): Add a frame printer.
* libguile/stacks.c (stack_depth, read_frames): Only switch the VM stack
for boot program dframes.
* libguile/vm-engine.c (VM_NAME): Push one debug frame per invocation,
unconditionally. (If we push them at all, of course.)
Diffstat (limited to 'libguile/frames.c')
-rw-r--r-- | libguile/frames.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libguile/frames.c b/libguile/frames.c index baa62a744..8a307f1ea 100644 --- a/libguile/frames.c +++ b/libguile/frames.c @@ -66,6 +66,19 @@ scm_c_make_vm_frame (SCM stack_holder, SCM *fp, SCM *sp, SCM_RETURN_NEWSMOB (scm_tc16_vm_frame, p); } +static int +vm_frame_print (SCM frame, SCM port, scm_print_state *pstate) +{ + scm_puts ("#<vm-frame ", port); + scm_uintprint (SCM_UNPACK (frame), 16, port); + scm_putc (' ', port); + scm_write (scm_vm_frame_program (frame), port); + /* don't write args, they can get us into trouble. */ + scm_puts (">", port); + + return 1; +} + static SCM vm_frame_mark (SCM obj) { @@ -283,6 +296,7 @@ scm_bootstrap_frames (void) scm_tc16_vm_frame = scm_make_smob_type ("vm-frame", 0); scm_set_smob_mark (scm_tc16_vm_frame, vm_frame_mark); scm_set_smob_free (scm_tc16_vm_frame, vm_frame_free); + scm_set_smob_print (scm_tc16_vm_frame, vm_frame_print); } void |