Skip to content

Commit

Permalink
Revert "debug: Breaking should jump to top frame that has source"
Browse files Browse the repository at this point in the history
This reverts commit b995df2.
  • Loading branch information
isidorn committed Jan 23, 2019
1 parent ed5a04d commit 07b3b9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/parts/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export interface IDebugModel extends ITreeElement {
getWatchExpressions(): ReadonlyArray<IExpression & IEvaluate>;

onDidChangeBreakpoints: Event<IBreakpointsChangeEvent>;
onDidChangeCallStack: Event<IThread | undefined>;
onDidChangeCallStack: Event<void>;
onDidChangeWatchExpressions: Event<IExpression>;
}

Expand Down
10 changes: 5 additions & 5 deletions src/vs/workbench/parts/debug/common/debugModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ export class DebugModel implements IDebugModel {
private schedulers = new Map<string, RunOnceScheduler>();
private breakpointsSessionId: string;
private readonly _onDidChangeBreakpoints: Emitter<IBreakpointsChangeEvent>;
private readonly _onDidChangeCallStack: Emitter<IThread | undefined>;
private readonly _onDidChangeCallStack: Emitter<void>;
private readonly _onDidChangeWatchExpressions: Emitter<IExpression>;

constructor(
Expand All @@ -758,7 +758,7 @@ export class DebugModel implements IDebugModel {
this.sessions = [];
this.toDispose = [];
this._onDidChangeBreakpoints = new Emitter<IBreakpointsChangeEvent>();
this._onDidChangeCallStack = new Emitter<IThread | undefined>();
this._onDidChangeCallStack = new Emitter<void>();
this._onDidChangeWatchExpressions = new Emitter<IExpression>();
}

Expand Down Expand Up @@ -793,7 +793,7 @@ export class DebugModel implements IDebugModel {
return this._onDidChangeBreakpoints.event;
}

get onDidChangeCallStack(): Event<IThread | undefined> {
get onDidChangeCallStack(): Event<void> {
return this._onDidChangeCallStack.event;
}

Expand Down Expand Up @@ -826,12 +826,12 @@ export class DebugModel implements IDebugModel {
return thread.fetchCallStack(1).then(() => {
if (!this.schedulers.has(thread.getId())) {
this.schedulers.set(thread.getId(), new RunOnceScheduler(() => {
thread.fetchCallStack(19).then(() => this._onDidChangeCallStack.fire(thread));
thread.fetchCallStack(19).then(() => this._onDidChangeCallStack.fire());
}, 420));
}

this.schedulers.get(thread.getId()).schedule();
this._onDidChangeCallStack.fire(thread);
this._onDidChangeCallStack.fire();
});
}

Expand Down
10 changes: 0 additions & 10 deletions src/vs/workbench/parts/debug/electron-browser/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,16 +613,6 @@ export class DebugSession implements IDebugSession {
this.model.fetchCallStack(<Thread>thread).then(() => {
if (!event.body.preserveFocusHint && thread.getCallStack().length) {
this.debugService.focusStackFrame(undefined, thread);
if (!this.debugService.getViewModel().focusedStackFrame) {
// There were no appropriate stack frames to focus.
// We need to listen on additional stack frame fetching and try to refocus #65012
const listener = this.model.onDidChangeCallStack(t => {
if (t && t.getId() === thread.getId()) {
dispose(listener);
this.debugService.focusStackFrame(undefined, thread);
}
});
}
if (thread.stoppedDetails) {
if (this.configurationService.getValue<IDebugConfiguration>('debug').openDebug === 'openOnDebugBreak') {
this.viewletService.openViewlet(VIEWLET_ID);
Expand Down

0 comments on commit 07b3b9e

Please sign in to comment.