diff options
author | Andy Wingo <wingo@pobox.com> | 2009-02-05 12:28:19 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-02-05 12:28:19 +0100 |
commit | e06e857c8dc1f9f8c25bc4d3e40ce5bf351753d5 (patch) | |
tree | a284b9ba2bad1c16709a49e3f25058f552df7b79 /libguile/vm-i-system.c | |
parent | 4abef68f61f3ff4e674734a4aae18514dd96f221 (diff) | |
download | guile-e06e857c8dc1f9f8c25bc4d3e40ce5bf351753d5.tar.gz |
in debug mode, make sure that calls to the vm can be captured via make-stack
* libguile/vm-engine.c (VM_PUSH_DEBUG_FRAMES): New knob, if true we much
with the scm_i_last_debug_frame when entering the VM, because sometimes
the evaluator doesn't do it for us.
(VM_ENGINE): Plug through debug frame fondling. Now, program exit comes
back to the main text. Rename err_args to finish_args, and reuse for
the return value.
* libguile/vm-engine.h (PUSH_LIST):
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c:
* libguile/vm-i-system.c: Update for finish_args.
(halt): goto vm_done, now, instead of returning directly.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r-- | libguile/vm-i-system.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 06d9e8940..c99371774 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -30,19 +30,18 @@ VM_DEFINE_INSTRUCTION (0, nop, "nop", 0, 0, 0) VM_DEFINE_INSTRUCTION (1, halt, "halt", 0, 0, 0) { - SCM ret; vp->time += scm_c_get_internal_run_time () - start_time; HALT_HOOK (); nvalues = SCM_I_INUM (*sp--); NULLSTACK (1); if (nvalues == 1) - POP (ret); + POP (finish_args); else { POP_LIST (nvalues); - POP (ret); + POP (finish_args); SYNC_REGISTER (); - ret = scm_values (ret); + finish_args = scm_values (finish_args); } { @@ -55,8 +54,8 @@ VM_DEFINE_INSTRUCTION (1, halt, "halt", 0, 0, 0) fp = SCM_FRAME_DYNAMIC_LINK (fp); NULLSTACK (stack_base - sp); } - SYNC_ALL (); - return ret; + + goto vm_done; } VM_DEFINE_INSTRUCTION (2, break, "break", 0, 0, 0) @@ -254,8 +253,8 @@ VM_DEFINE_INSTRUCTION (24, variable_ref, "variable-ref", 0, 0, 1) if (!VARIABLE_BOUNDP (x)) { - err_args = SCM_LIST1 (x); - /* Was: err_args = SCM_LIST1 (SCM_CAR (x)); */ + finish_args = SCM_LIST1 (x); + /* Was: finish_args = SCM_LIST1 (SCM_CAR (x)); */ goto vm_error_unbound; } else @@ -299,7 +298,7 @@ VM_DEFINE_INSTRUCTION (25, toplevel_ref, "toplevel-ref", 1, 0, 1) mod = scm_module_public_interface (mod); if (SCM_FALSEP (mod)) { - err_args = SCM_LIST1 (mod); + finish_args = SCM_LIST1 (mod); goto vm_error_no_such_module; } /* might longjmp */ @@ -308,7 +307,7 @@ VM_DEFINE_INSTRUCTION (25, toplevel_ref, "toplevel-ref", 1, 0, 1) if (!VARIABLE_BOUNDP (what)) { - err_args = SCM_LIST1 (what); + finish_args = SCM_LIST1 (what); goto vm_error_unbound; } @@ -382,7 +381,7 @@ VM_DEFINE_INSTRUCTION (29, toplevel_set, "toplevel-set", 1, 1, 0) mod = scm_module_public_interface (mod); if (SCM_FALSEP (mod)) { - err_args = SCM_LIST1 (what); + finish_args = SCM_LIST1 (what); goto vm_error_no_such_module; } /* might longjmp */ @@ -1088,7 +1087,7 @@ VM_DEFINE_INSTRUCTION (50, return_values_star, "return/values*", 1, -1, -1) nvalues++; } if (SCM_UNLIKELY (!SCM_NULL_OR_NIL_P (l))) { - err_args = scm_list_1 (l); + finish_args = scm_list_1 (l); goto vm_error_improper_list; } |