提交 bb69254b 编写于 作者: I isidor

debug: call stack message box shows stopped reason of focused thread

fixes #1701
上级 77dffb00
...@@ -246,10 +246,11 @@ class CallStackView extends viewlet.CollapsibleViewletView { ...@@ -246,10 +246,11 @@ class CallStackView extends viewlet.CollapsibleViewletView {
this.toDispose.push(debugModel.addListener2(debug.ModelEvents.CALLSTACK_UPDATED, () => { this.toDispose.push(debugModel.addListener2(debug.ModelEvents.CALLSTACK_UPDATED, () => {
this.tree.refresh().done(null, errors.onUnexpectedError); this.tree.refresh().done(null, errors.onUnexpectedError);
})); }));
this.toDispose.push(this.debugService.addListener2(debug.ServiceEvents.STATE_CHANGED, (reason: string) => { this.toDispose.push(this.debugService.getViewModel().addListener2(debug.ViewModelEvents.FOCUSED_STACK_FRAME_UPDATED, () => {
if (this.debugService.getState() === debug.State.Stopped && reason !== 'step') { const focussedThread = this.debugService.getModel().getThreads()[this.debugService.getViewModel().getFocusedThreadId()];
this.messageBox.textContent = nls.localize('debugStopped', "Paused on {0}.", reason); if (focussedThread && focussedThread.stoppedReason && focussedThread.stoppedReason !== 'step') {
reason === 'exception' ? this.messageBox.classList.add('exception') : this.messageBox.classList.remove('exception'); this.messageBox.textContent = nls.localize('debugStopped', "Paused on {0}.", focussedThread.stoppedReason);
focussedThread.stoppedReason === 'exception' ? this.messageBox.classList.add('exception') : this.messageBox.classList.remove('exception');
this.messageBox.hidden = false; this.messageBox.hidden = false;
return; return;
......
...@@ -128,7 +128,7 @@ export interface IViewModel extends ee.EventEmitter { ...@@ -128,7 +128,7 @@ export interface IViewModel extends ee.EventEmitter {
} }
export interface IModel extends ee.IEventEmitter, ITreeElement { export interface IModel extends ee.IEventEmitter, ITreeElement {
getThreads(): { [reference: number]: IThread; }; getThreads(): { [threadId: number]: IThread; };
getBreakpoints(): IBreakpoint[]; getBreakpoints(): IBreakpoint[];
areBreakpointsActivated(): boolean; areBreakpointsActivated(): boolean;
getFunctionBreakpoints(): IFunctionBreakpoint[]; getFunctionBreakpoints(): IFunctionBreakpoint[];
......
...@@ -228,7 +228,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService ...@@ -228,7 +228,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
})); }));
this.toDispose.push(this.session.addListener2(debug.SessionEvents.STOPPED, (event: DebugProtocol.StoppedEvent) => { this.toDispose.push(this.session.addListener2(debug.SessionEvents.STOPPED, (event: DebugProtocol.StoppedEvent) => {
this.setStateAndEmit(debug.State.Stopped, event.body.reason); this.setStateAndEmit(debug.State.Stopped);
const threadId = event.body.threadId; const threadId = event.body.threadId;
this.getThreadData(threadId).then(() => { this.getThreadData(threadId).then(() => {
...@@ -356,9 +356,9 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService ...@@ -356,9 +356,9 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return this.state; return this.state;
} }
private setStateAndEmit(newState: debug.State, data?: any): void { private setStateAndEmit(newState: debug.State): void {
this.state = newState; this.state = newState;
this.emit(debug.ServiceEvents.STATE_CHANGED, data); this.emit(debug.ServiceEvents.STATE_CHANGED);
} }
public get enabled(): boolean { public get enabled(): boolean {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册