From 730084676353e8285b5ca9d8f98f77e493ba9b51 Mon Sep 17 00:00:00 2001 From: WebFreak001 Date: Sun, 6 Mar 2016 16:04:22 +0100 Subject: [PATCH] Fixed variable stack when switching frames --- src/mibase.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mibase.ts b/src/mibase.ts index 11f8c35..402def4 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -151,7 +151,7 @@ export class MI2DebugSession extends DebugSession { protected scopesRequest(response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments): void { const scopes = new Array(); - scopes.push(new Scope("Local", this.variableHandles.create("@frame:" + args.frameId), false)); + scopes.push(new Scope("Local", this.variableHandles.create("@frame:" + (args.frameId || 0)), false)); response.body = { scopes: scopes @@ -169,7 +169,7 @@ export class MI2DebugSession extends DebugSession { if (typeof id == "string") { if (id.startsWith("@frame:")) { - this.miDebugger.getStackVariables(1, 0).then(stack => { + this.miDebugger.getStackVariables(1, parseInt(id.substr("@frame:".length))).then(stack => { stack.forEach(variable => { if (variable[1] !== undefined) { let expanded = expandValue(createVariable, `{${variable[0]} = ${variable[1]}}`);