diff --git a/extension/docs/emulator.md b/extension/docs/emulator.md index a7cad317..271ae228 100644 --- a/extension/docs/emulator.md +++ b/extension/docs/emulator.md @@ -85,6 +85,10 @@ A launch configuration can also set: While you debug, a rebuild doesn't restart the program. Press F5 again to debug the new build. +**Stop** on the Debug toolbar ends debugging and leaves the program +running in the panel, without breakpoints. Close the panel to stop the +program. + Some platforms, such as the Atari 2600 and Verilog, can only stop between frames. There, breakpoints and steps work a frame at a time. diff --git a/extension/src/extension.ts b/extension/src/extension.ts index d83658c2..4643a471 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -1184,8 +1184,12 @@ function newDebugSession(session: vscode.DebugSession): EmuDebugSession { }, async () => { if (debugging?.session === session) debugging = undefined; - // stopping the session stops its program, not one started since - if (worker && worker === emu) panel?.dispose(); + // stopping the debugger leaves the program running, as Run would, + // unless another run has replaced it since + if (worker && worker === emu) { + await worker.call('debug', 'setBreakpoints', []); + await worker.call('resume'); + } }); debugging = { session, backend }; return new EmuDebugSession(backend);