diff options
author | Andy Wingo <wingo@pobox.com> | 2010-09-28 09:22:38 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-09-28 09:22:38 +0200 |
commit | 97b18a66403aee100021485d85009b975ecb1614 (patch) | |
tree | e3fc18b83615a54b2d12c542da69fbd881e0f105 | |
parent | f2ee6341baa31d75f9734a93545eb2608dd5653c (diff) | |
download | guile-97b18a66403aee100021485d85009b975ecb1614.tar.gz |
default to regular vm for noninteractive use
* libguile/script.c (scm_compile_shell_switches): Select the debugging
VM in the cases that we previously would select deval -- when running
interactively without --no-debug, or otherwise with --debug.
* libguile/vm.c: Default to the regular engine.
(scm_c_set_vm_engine_x): Remove requirement for the VM to have no
pending computations.
-rw-r--r-- | libguile/script.c | 4 | ||||
-rw-r--r-- | libguile/vm.c | 14 |
2 files changed, 5 insertions, 13 deletions
diff --git a/libguile/script.c b/libguile/script.c index 03d5de194..088c06b92 100644 --- a/libguile/script.c +++ b/libguile/script.c @@ -40,6 +40,7 @@ #include "libguile/strports.h" #include "libguile/validate.h" #include "libguile/version.h" +#include "libguile/vm.h" #ifdef HAVE_STRING_H #include <string.h> @@ -718,7 +719,10 @@ scm_compile_shell_switches (int argc, char **argv) was not explicitly turned off, turn on debugging. */ if (turn_on_debugging || (interactive && !dont_turn_on_debugging)) { + /* FIXME: backtraces and positions should always be on (?) */ tail = scm_cons (scm_cons (sym_turn_on_debugging, SCM_EOL), tail); + scm_c_set_default_vm_engine_x (SCM_VM_DEBUG_ENGINE); + scm_c_set_vm_engine_x (scm_the_vm (), SCM_VM_DEBUG_ENGINE); } { diff --git a/libguile/vm.c b/libguile/vm.c index 05e1f7191..29d686255 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -36,7 +36,7 @@ #include "programs.h" #include "vm.h" -static int vm_default_engine = SCM_VM_DEBUG_ENGINE; +static int vm_default_engine = SCM_VM_REGULAR_ENGINE; /* Unfortunately we can't snarf these: snarfed things are only loaded up from (system vm vm), which might not be loaded before an error happens. */ @@ -745,13 +745,6 @@ vm_engine_to_symbol (int engine, const char *FUNC_NAME) } } -static int -vm_has_pending_computation (SCM vm) -{ - struct scm_vm *vp = SCM_VM_DATA (vm); - return vp->sp >= vp->stack_base; -} - SCM_DEFINE (scm_vm_engine, "vm-engine", 1, 0, 0, (SCM vm), "") @@ -768,11 +761,6 @@ scm_c_set_vm_engine_x (SCM vm, int engine) { SCM_VALIDATE_VM (1, vm); - if (vm_has_pending_computation (vm)) - SCM_MISC_ERROR ("VM engine may only be changed while there are no " - "pending computations.", - SCM_EOL); - if (engine < 0 || engine >= SCM_VM_NUM_ENGINES) SCM_MISC_ERROR ("Unknown VM engine: ~a", scm_list_1 (scm_from_int (engine))); |