From 7155e422517885a7a271256fd989c158ca467de3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 19 Sep 2008 03:10:44 -0500 Subject: [PATCH 1/4] Better error messages --- basis/io/launcher/launcher.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/io/launcher/launcher.factor b/basis/io/launcher/launcher.factor index cc48ace60b..72535053eb 100755 --- a/basis/io/launcher/launcher.factor +++ b/basis/io/launcher/launcher.factor @@ -99,7 +99,7 @@ M: process hashcode* handle>> hashcode* ; GENERIC: >process ( obj -- process ) -ERROR: process-already-started ; +ERROR: process-already-started process ; M: process-already-started summary drop "Process has already been started once" ; @@ -116,7 +116,7 @@ HOOK: current-process-handle io-backend ( -- handle ) HOOK: run-process* io-backend ( process -- handle ) -ERROR: process-was-killed ; +ERROR: process-was-killed process ; : wait-for-process ( process -- status ) [ From 0a8980d37e649f990ea88daf098d05bdd4ffda08 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 19 Sep 2008 03:14:11 -0500 Subject: [PATCH 2/4] Better error messages in io.launcher --- basis/io/launcher/launcher.factor | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/basis/io/launcher/launcher.factor b/basis/io/launcher/launcher.factor index 72535053eb..7f1a3f4507 100755 --- a/basis/io/launcher/launcher.factor +++ b/basis/io/launcher/launcher.factor @@ -101,8 +101,10 @@ GENERIC: >process ( obj -- process ) ERROR: process-already-started process ; -M: process-already-started summary - drop "Process has already been started once" ; +M: process-already-started error. + "Process has already been started" print nl + "Launch descriptor:" print nl + process>> . ; M: process >process dup process-started? [ @@ -118,6 +120,13 @@ HOOK: run-process* io-backend ( process -- handle ) ERROR: process-was-killed process ; +M: process-was-killed error. + "Process was killed as a result of a call to" print + "kill-process, or a timeout" print + nl + "Launch descriptor:" print nl + process>> . ; + : wait-for-process ( process -- status ) [ dup handle>> From 005cdd4d3a6db484417fbeb3ff6f00e37c7949dd Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Fri, 19 Sep 2008 11:22:40 -0500 Subject: [PATCH 3/4] tweaking hello-world deploy --- extra/hello-world/deploy.factor | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/extra/hello-world/deploy.factor b/extra/hello-world/deploy.factor index 403cb4737e..c683ef6e06 100755 --- a/extra/hello-world/deploy.factor +++ b/extra/hello-world/deploy.factor @@ -1,15 +1,15 @@ USING: tools.deploy.config ; H{ - { deploy-word-props? f } - { deploy-random? f } - { deploy-compiler? f } { deploy-c-types? f } - { deploy-ui? f } - { deploy-reflection 1 } - { deploy-threads? f } - { deploy-io 2 } - { deploy-word-defs? f } - { "stop-after-last-window?" t } { deploy-name "Hello world (console)" } + { deploy-threads? f } + { deploy-word-props? f } + { deploy-reflection 2 } + { deploy-random? f } + { deploy-io 2 } { deploy-math? f } + { deploy-ui? f } + { deploy-compiler? f } + { "stop-after-last-window?" t } + { deploy-word-defs? f } } From be4915ee9c6b91d8e7878a8f5af4821a36d7e0f4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 19 Sep 2008 14:44:58 -0500 Subject: [PATCH 4/4] Fix save-image-and-exit bug --- core/memory/memory-tests.factor | 3 ++- vm/image.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/memory/memory-tests.factor b/core/memory/memory-tests.factor index 9fded3eb3a..1c23e700ca 100755 --- a/core/memory/memory-tests.factor +++ b/core/memory/memory-tests.factor @@ -1,4 +1,4 @@ -USING: generic kernel kernel.private math memory prettyprint +USING: generic kernel kernel.private math memory prettyprint io sequences tools.test words namespaces layouts classes classes.builtin arrays quotations ; IN: memory.tests @@ -19,6 +19,7 @@ TUPLE: testing x y z ; [ ] [ num-types get [ type>class [ + dup . flush "predicate" word-prop instances [ class drop ] each diff --git a/vm/image.c b/vm/image.c index a668cb7913..62f9e1c906 100755 --- a/vm/image.c +++ b/vm/image.c @@ -186,13 +186,16 @@ void strip_compiled_quotations(void) DEFINE_PRIMITIVE(save_image_and_exit) { - /* This reduces deployed image size */ - strip_compiled_quotations(); - + /* We unbox this before doing anything else. This is the only point + where we might throw an error, so we have to throw an error here since + later steps destroy the current image. */ F_CHAR *path = unbox_native_string(); REGISTER_C_STRING(path); + /* This reduces deployed image size */ + strip_compiled_quotations(); + /* strip out userenv data which is set on startup anyway */ CELL i; for(i = 0; i < FIRST_SAVE_ENV; i++)