Skip to content

Commit eac9ada

Browse files
committed
Fix Continue on Multithreaded programs
fixes microsoft#18195
1 parent 9cb6273 commit eac9ada

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/vs/workbench/parts/debug/electron-browser/debugService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export class DebugService implements debug.IDebugService {
310310
}));
311311

312312
this.toDisposeOnSessionEnd.get(session.getId()).push(session.onDidContinued(event => {
313-
const threadId = event.body.allThreadsContinued ? undefined : event.body.threadId;
313+
const threadId = event.body.allThreadsContinued !== false ? undefined : event.body.threadId;
314314
this.model.clearThreads(session.getId(), false, threadId);
315315
if (this.viewModel.focusedProcess.getId() === session.getId()) {
316316
this.focusStackFrameAndEvaluate(null, this.viewModel.focusedProcess).done(null, errors.onUnexpectedError);

src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
5454
public disconnected: boolean;
5555
private sentPromises: TPromise<DebugProtocol.Response>[];
5656
private capabilities: DebugProtocol.Capabilities;
57+
private allThreadsContinued: boolean;
5758

5859
private _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
5960
private _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
@@ -80,6 +81,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
8081
super(id);
8182
this.emittedStopped = false;
8283
this.readyForBreakpoints = false;
84+
this.allThreadsContinued = false;
8385
this.sentPromises = [];
8486

8587
this._onDidInitialize = new Emitter<DebugProtocol.InitializedEvent>();
@@ -202,6 +204,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
202204
this.emittedStopped = true;
203205
this._onDidStop.fire(<DebugProtocol.StoppedEvent>event);
204206
} else if (event.event === 'continued') {
207+
this.allThreadsContinued = (<DebugProtocol.ContinuedEvent>event).body.allThreadsContinued = false ? false : true;
205208
this._onDidContinued.fire(<DebugProtocol.ContinuedEvent>event);
206209
} else if (event.event === 'thread') {
207210
this._onDidThread.fire(<DebugProtocol.ThreadEvent>event);
@@ -270,7 +273,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
270273

271274
public continue(args: DebugProtocol.ContinueArguments): TPromise<DebugProtocol.ContinueResponse> {
272275
return this.send('continue', args).then(response => {
273-
this.fireFakeContinued(args.threadId);
276+
this.fireFakeContinued(args.threadId, this.allThreadsContinued);
274277
return response;
275278
});
276279
}
@@ -402,12 +405,13 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
402405
}
403406
}
404407

405-
private fireFakeContinued(threadId: number): void {
408+
private fireFakeContinued(threadId: number, allThreadsContinued = false): void {
406409
this._onDidContinued.fire({
407410
type: 'event',
408411
event: 'continued',
409412
body: {
410-
threadId
413+
threadId,
414+
allThreadsContinued
411415
},
412416
seq: undefined
413417
});

0 commit comments

Comments
 (0)