From 89db8759e052abab4da8c6fe09ba57d94fda9486 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Thu, 14 Nov 2024 09:48:35 +0100 Subject: [PATCH] Catch ProcessSwitch in headless mode only --- .../hpi/swa/trufflesqueak/model/AbstractSqueakObject.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java index d19d47ab5..09a0e8e87 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java @@ -70,8 +70,12 @@ protected static final Object send(final AbstractSqueakObject receiver, final Me return performInteropSendNode.execute(node, receiver, message, arguments); } catch (final ProcessSwitch ps) { CompilerDirectives.transferToInterpreter(); - image.printToStdErr(ps); - throw new IllegalArgumentException(); + if (image.options.isHeadless()) { + image.printToStdErr(ps); + throw new IllegalArgumentException(); + } else { + throw ps; // open debugger in interactive mode + } } finally { if (wasActive) { image.interrupt.activate();