From 94bd4393a82b4663c743d12a3daed7f996981cd4 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Wed, 8 Jan 2025 15:50:11 +0530 Subject: [PATCH] Fix breakpoint changes inside Ballerina services after starting a debug session --- .../org/ballerinalang/debugadapter/BreakpointProcessor.java | 5 +---- .../org/ballerinalang/debugadapter/JDIEventProcessor.java | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/BreakpointProcessor.java b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/BreakpointProcessor.java index 6a9edc9ff121..fea84fc9877e 100644 --- a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/BreakpointProcessor.java +++ b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/BreakpointProcessor.java @@ -175,10 +175,7 @@ void restoreUserBreakpoints() { } context.getEventManager().deleteAllBreakpoints(); - for (Map.Entry> entry : userBreakpoints.entrySet()) { - String qClassName = entry.getKey(); - context.getDebuggeeVM().classesByName(qClassName).forEach(ref -> activateUserBreakPoints(ref, false)); - } + context.getDebuggeeVM().allClasses().forEach(ref -> activateUserBreakPoints(ref, false)); } /** diff --git a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/JDIEventProcessor.java b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/JDIEventProcessor.java index ad29ed4e8b17..1d49eb3edcf2 100755 --- a/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/JDIEventProcessor.java +++ b/misc/debug-adapter/modules/debug-adapter-core/src/main/java/org/ballerinalang/debugadapter/JDIEventProcessor.java @@ -175,8 +175,7 @@ void enableBreakpoints(String qClassName, LinkedHashMap // Setting breakpoints to an already running debug session. context.getEventManager().deleteAllBreakpoints(); - context.getDebuggeeVM().classesByName(qClassName) - .forEach(ref -> breakpointProcessor.activateUserBreakPoints(ref, false)); + context.getDebuggeeVM().allClasses().forEach(ref -> breakpointProcessor.activateUserBreakPoints(ref, false)); } void sendStepRequest(int threadId, int stepType) {