debug: send the continued thread id with the event

This commit is contained in:
isidor 2016-04-21 17:28:23 +02:00
parent b7ed8faad1
commit b1b0dd5891
2 changed files with 9 additions and 7 deletions

View file

@ -266,9 +266,9 @@ export class DebugService implements debug.IDebugService {
}, errors.onUnexpectedError);
}));
this.toDisposeOnSessionEnd.push(this.session.onDidContinue(() => {
this.toDisposeOnSessionEnd.push(this.session.onDidContinue(threadID => {
aria.status(nls.localize('debuggingContinued', "Debugging continued."));
this.model.clearThreads(false, this.viewModel.getFocusedThreadId());
this.model.clearThreads(false, threadID);
this.setFocusedStackFrameAndEvaluate(null).done(null, errors.onUnexpectedError);
this.setStateAndEmit(this.configurationManager.configuration.noDebug ? debug.State.RunningNoDebug : debug.State.Running);
}));

View file

@ -41,8 +41,9 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
public restarted: boolean;
public emittedStopped: boolean;
public readyForBreakpoints: boolean;
private flowEventsCount: number;
private lastThreadId: number;
private flowEventsCount: number;
private serverProcess: cp.ChildProcess;
private socket: net.Socket = null;
private cachedInitServer: TPromise<void>;
@ -56,7 +57,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
private _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
private _onDidTerminateDebugee: Emitter<SessionTerminatedEvent>;
private _onDidExitAdapter: Emitter<SessionExitedEvent>;
private _onDidContinue: Emitter<void>;
private _onDidContinue: Emitter<number>;
private _onDidThread: Emitter<DebugProtocol.ThreadEvent>;
private _onDidOutput: Emitter<DebugProtocol.OutputEvent>;
private _onDidBreakpoint: Emitter<DebugProtocol.BreakpointEvent>;
@ -79,7 +80,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
this._onDidStop = new Emitter<DebugProtocol.StoppedEvent>();
this._onDidTerminateDebugee = new Emitter<SessionTerminatedEvent>();
this._onDidExitAdapter = new Emitter<SessionExitedEvent>();
this._onDidContinue = new Emitter<void>();
this._onDidContinue = new Emitter<number>();
this._onDidThread = new Emitter<DebugProtocol.ThreadEvent>();
this._onDidOutput = new Emitter<DebugProtocol.OutputEvent>();
this._onDidBreakpoint = new Emitter<DebugProtocol.BreakpointEvent>();
@ -102,7 +103,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
return this._onDidExitAdapter.event;
}
public get onDidContinue(): Event<void> {
public get onDidContinue(): Event<number> {
return this._onDidContinue.event;
}
@ -198,7 +199,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
} else if (event.event === 'continued') {
// TODO@Isidor continued event needs to come from the adapter
this.flowEventsCount++;
this._onDidContinue.fire();
this._onDidContinue.fire(this.lastThreadId);
}
this._onDidEvent.fire(event);
@ -250,6 +251,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
// we do not emit straight away to reduce viewlet flickering.
private sendAndLazyContinue(command: string, args: any): TPromise<DebugProtocol.Response> {
const count = this.flowEventsCount;
this.lastThreadId = args.threadId;
return this.send(command, args).then(response => {
setTimeout(() => {
if (this.flowEventsCount === count) {