Skip to content

Commit

Permalink
Revert "[debug] Lazily update frames of all threads in all-stop mode"
Browse files Browse the repository at this point in the history
This reverts commit d1678ad.

Fixes #7272

Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work authored and lmcbout committed Mar 4, 2020
1 parent c965552 commit d0cb41a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
8 changes: 1 addition & 7 deletions packages/debug/src/browser/debug-session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ export class DebugSession implements CompositeTreeElement {
}
}),
this.on('stopped', async ({ body }) => {
// Update thread list
await this.updateThreads(body);

// Update current thread's frames immediately
await this.updateFrames();
}),
this.on('thread', ({ body: { reason, threadId } }) => {
Expand Down Expand Up @@ -224,9 +221,6 @@ export class DebugSession implements CompositeTreeElement {
this.fireDidChange();
if (thread) {
this.toDisposeOnCurrentThread.push(thread.onDidChanged(() => this.fireDidChange()));

// If this thread is missing stack frame information, then load that.
this.updateFrames();
}
}

Expand Down Expand Up @@ -471,7 +465,7 @@ export class DebugSession implements CompositeTreeElement {

protected async updateFrames(): Promise<void> {
const thread = this._currentThread;
if (!thread || thread.pendingFrameCount || thread.frameCount) {
if (!thread || thread.frameCount) {
return;
}
if (this.capabilities.supportsDelayedStackTraceLoading) {
Expand Down
7 changes: 0 additions & 7 deletions packages/debug/src/browser/model/debug-thread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ export class DebugThread extends DebugThreadData implements TreeElement {
}

protected pendingFetch = Promise.resolve<DebugStackFrame[]>([]);
protected _pendingFetchCount: number = 0;
async fetchFrames(levels: number = 20): Promise<DebugStackFrame[]> {
this._pendingFetchCount += 1;
return this.pendingFetch = this.pendingFetch.then(async () => {
try {
const start = this.frameCount;
Expand All @@ -151,14 +149,9 @@ export class DebugThread extends DebugThreadData implements TreeElement {
} catch (e) {
console.error(e);
return [];
} finally {
this._pendingFetchCount -= 1;
}
});
}
get pendingFrameCount(): number {
return this._pendingFetchCount;
}
protected async doFetchFrames(startFrame: number, levels: number): Promise<DebugProtocol.StackFrame[]> {
try {
const response = await this.session.sendRequest('stackTrace',
Expand Down

0 comments on commit d0cb41a

Please sign in to comment.