diff --git a/src/chrome/chromeDebugAdapter.ts b/src/chrome/chromeDebugAdapter.ts index 1d0f43ba7..31b82a205 100644 --- a/src/chrome/chromeDebugAdapter.ts +++ b/src/chrome/chromeDebugAdapter.ts @@ -1218,7 +1218,12 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter { // Only process at the requested number of frames, if 'levels' is specified let stack = this._currentPauseNotification.callFrames; - if (args.levels) { + const totalFrames = stack.length; + if (typeof args.startFrame === 'number') { + stack = stack.slice(args.startFrame); + } + + if (typeof args.levels === 'number') { stack = stack.filter((_, i) => i < args.levels); } @@ -1226,7 +1231,8 @@ export abstract class ChromeDebugAdapter implements IDebugAdapter { .concat(this.asyncFrames(this._currentPauseNotification.asyncStackTrace)); const stackTraceResponse: IInternalStackTraceResponseBody = { - stackFrames + stackFrames, + totalFrames }; this._pathTransformer.stackTraceResponse(stackTraceResponse); this._sourceMapTransformer.stackTraceResponse(stackTraceResponse); diff --git a/src/debugAdapterInterfaces.d.ts b/src/debugAdapterInterfaces.d.ts index deaa01ad0..89dc61d6c 100644 --- a/src/debugAdapterInterfaces.d.ts +++ b/src/debugAdapterInterfaces.d.ts @@ -87,6 +87,7 @@ export interface IThreadsResponseBody { export interface IStackTraceResponseBody { stackFrames: DebugProtocol.StackFrame[]; + totalFrames?: number; } export interface IInternalStackFrame extends DebugProtocol.StackFrame {