debug: on continue only clear the currently debugged thread

This commit is contained in:
isidor 2016-04-21 17:09:44 +02:00
parent e987744e76
commit 05d8d9eaea
4 changed files with 4 additions and 19 deletions

View file

@ -431,6 +431,7 @@ export class Model implements debug.IModel {
if (reference) {
this.threads[reference].clearCallStack();
this.threads[reference].stoppedDetails = undefined;
this.threads[reference].stopped = false;
if (removeThreads) {
delete this.threads[reference];
@ -439,6 +440,7 @@ export class Model implements debug.IModel {
Object.keys(this.threads).forEach(ref => {
this.threads[ref].clearCallStack();
this.threads[ref].stoppedDetails = undefined;
this.threads[ref].stopped = false;
});
if (removeThreads) {
@ -450,16 +452,6 @@ export class Model implements debug.IModel {
this._onDidChangeCallStack.fire();
}
public continueThreads(): void {
for (let ref in this.threads) {
if (this.threads.hasOwnProperty(ref)) {
this.threads[ref].stopped = false;
}
}
this.clearThreads(false);
}
public getBreakpoints(): debug.IBreakpoint[] {
return this.breakpoints;
}

View file

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

View file

@ -196,6 +196,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
this.flowEventsCount++;
this._onDidExitAdapter.fire(<SessionExitedEvent>event);
} else if (event.event === 'continued') {
// TODO@Isidor continued event needs to come from the adapter
this.flowEventsCount++;
this._onDidContinue.fire();
}

View file

@ -174,10 +174,6 @@ suite('Debug - Model', () => {
assert.equal(thread2.stopped, true);
assert.equal(thread2.getCachedCallStack(), undefined);
model.continueThreads();
assert.equal(thread1.stopped, false);
assert.equal(thread2.stopped, false);
model.clearThreads(true);
assert.equal(model.getThreads[threadId1], null);
assert.equal(model.getThreads[threadId2], null);
@ -261,10 +257,6 @@ suite('Debug - Model', () => {
assert.equal(stoppedThread.stopped, true);
assert.equal(stoppedThread.getCachedCallStack(), undefined);
model.continueThreads();
assert.equal(runningThread.stopped, false);
assert.equal(stoppedThread.stopped, false);
model.clearThreads(true);
assert.equal(model.getThreads[stoppedThreadId], null);
assert.equal(model.getThreads[runningThreadId], null);