diff --git a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts index 24cd8e9aabe..745d52d8160 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts @@ -71,7 +71,7 @@ export class DebugActionsWidget implements wbext.IWorkbenchContribution { } private registerListeners(): void { - this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(() => { + this.toDispose.push(this.debugService.onDidChangeState(() => { this.update(); })); this.toDispose.push(this.actionBar.actionRunner.addListener2(events.EventType.RUN, (e: any) => { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 484ef46a112..b9380518dcb 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -439,9 +439,11 @@ export class DebugService implements debug.IDebugService { return !!this.contextService.getWorkspace(); } - public setFocusedStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame): TPromise { + public setFocusedStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame, process?: debug.IProcess): TPromise { const processes = this.model.getProcesses(); - const process = focusedStackFrame ? focusedStackFrame.thread.process : processes.length ? processes[0] : null; + if (!process) { + process = focusedStackFrame ? focusedStackFrame.thread.process : processes.length ? processes[0] : null; + } if (process && !focusedStackFrame) { const thread = process.getAllThreads().pop(); const callStack = thread ? thread.getCachedCallStack() : null; @@ -635,7 +637,7 @@ export class DebugService implements debug.IDebugService { const process = this.model.addProcess(configuration.name, session); if (!this.viewModel.focusedProcess) { - this.viewModel.setFocusedStackFrame(null, process); + this.setFocusedStackFrameAndEvaluate(null, process); } this.toDisposeOnSessionEnd[session.getId()] = []; if (client) {