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