From cf734f6128cad588c9d3d6dabf56d5f2ed1785e3 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Sun, 19 May 2024 22:00:47 +0800 Subject: [PATCH] Propagate the exit code of debugee to exit event Fixes https://github.com/microsoft/java-debug/issues/475 --- .../core/adapter/handler/ConfigurationDoneRequestHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/ConfigurationDoneRequestHandler.java b/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/ConfigurationDoneRequestHandler.java index 1c543bce4..c841261de 100644 --- a/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/ConfigurationDoneRequestHandler.java +++ b/com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/ConfigurationDoneRequestHandler.java @@ -82,7 +82,7 @@ private void handleDebugEvent(DebugEvent debugEvent, IDebugSession debugSession, } else if (event instanceof VMDeathEvent) { vmHandler.disconnectVirtualMachine(event.virtualMachine()); context.setVmTerminated(); - context.getProtocolServer().sendEvent(new Events.ExitedEvent(0)); + context.getProtocolServer().sendEvent(new Events.ExitedEvent(event.virtualMachine().process().exitValue())); } else if (event instanceof VMDisconnectEvent) { vmHandler.disconnectVirtualMachine(event.virtualMachine()); if (context.isAttached()) {