From 88a2e28e252e76fa1676aaafd012ede721ebe266 Mon Sep 17 00:00:00 2001 From: Christopher Dwyer-Perkins Date: Thu, 13 Feb 2025 09:59:01 -0400 Subject: [PATCH] Fixed a bug that would cause the stopOnEntry setting from always being respected when using restart debug session --- src/debugSession/BrightScriptDebugSession.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/debugSession/BrightScriptDebugSession.ts b/src/debugSession/BrightScriptDebugSession.ts index 5eef38b0..da153a5a 100644 --- a/src/debugSession/BrightScriptDebugSession.ts +++ b/src/debugSession/BrightScriptDebugSession.ts @@ -367,6 +367,11 @@ export class BrightScriptDebugSession extends BaseDebugSession { public async launchRequest(response: DebugProtocol.LaunchResponse, config: LaunchConfiguration) { const logEnd = this.logger.timeStart('log', '[launchRequest] launch'); + // launchRequest gets invoked by our restart session flow. + // We need to clear/reset some state to avoid issues. + this.entryBreakpointWasHandled = false; + this.breakpointManager.clearBreakpointLastState(); + //send the response right away so the UI immediately shows the debugger toolbar this.sendResponse(response); @@ -474,9 +479,6 @@ export class BrightScriptDebugSession extends BaseDebugSession { // close disconnect if required when the app is exited // eslint-disable-next-line @typescript-eslint/no-misused-promises this.rokuAdapter.on('app-exit', async () => { - this.entryBreakpointWasHandled = false; - this.breakpointManager.clearBreakpointLastState(); - if (this.launchConfiguration.stopDebuggerOnAppExit) { let message = `App exit event detected and launchConfiguration.stopDebuggerOnAppExit is true`; message += ' - shutting down debug session';