From a5ba48b76595d703ffbc26f108fd9f5acef154f9 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 26 Oct 2016 15:42:16 +0200 Subject: [PATCH] debug: distinguish if there is a process left on session end fixes #14332 --- .../parts/debug/common/debugModel.ts | 1 + .../debug/electron-browser/debugService.ts | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index da4841443e8..4eddacc3b10 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -559,6 +559,7 @@ export class Process implements debug.IProcess { } } +// TODO@Isidor breakpoint should not have a pointer to source. Source should live inside a stack frame export class Breakpoint implements debug.IBreakpoint { public lineNumber: number; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 0b6dd2c56ce..a95380fbedf 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -804,25 +804,26 @@ export class DebugService implements debug.IDebugService { // an internal module might be open so the dispose can throw -> ignore and continue with stop session. } - this.partService.removeClass('debugging'); - this.model.removeProcess(session.getId()); this.setFocusedStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError); this.setStateAndEmit(session.getId(), debug.State.Inactive); - // set breakpoints back to unverified since the session ended. - // source reference changes across sessions, so we do not use it to persist the source. - const data: { [id: string]: { line: number, verified: boolean } } = {}; - this.model.getBreakpoints().forEach(bp => { - delete bp.source.raw.sourceReference; - data[bp.getId()] = { line: bp.lineNumber, verified: false }; - }); - this.model.updateBreakpoints(data); + if (this.model.getProcesses().length === 0) { + this.partService.removeClass('debugging'); + // set breakpoints back to unverified since the session ended. + // source reference changes across sessions, so we do not use it to persist the source. + const data: { [id: string]: { line: number, verified: boolean } } = {}; + this.model.getBreakpoints().forEach(bp => { + delete bp.source.raw.sourceReference; + data[bp.getId()] = { line: bp.lineNumber, verified: false }; + }); + this.model.updateBreakpoints(data); - this.inDebugMode.reset(); + this.inDebugMode.reset(); - if (!this.partService.isSideBarHidden() && this.configurationService.getConfiguration('debug').openExplorerOnEnd) { - this.viewletService.openViewlet(EXPLORER_VIEWLET_ID).done(null, errors.onUnexpectedError); + if (!this.partService.isSideBarHidden() && this.configurationService.getConfiguration('debug').openExplorerOnEnd) { + this.viewletService.openViewlet(EXPLORER_VIEWLET_ID).done(null, errors.onUnexpectedError); + } } } -- GitLab