From e400b975619c98f4c232afb415f17699b9c79a2b Mon Sep 17 00:00:00 2001 From: WyoTwT Date: Tue, 30 Apr 2024 23:20:10 +0200 Subject: [PATCH] Match Current Context with one of Contexts Match current context id with one of the elements of the Contexts array. Signed-off-by: Thor Thayer --- src/plugin/adapter-registry/amalgamator-gdb-tracker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugin/adapter-registry/amalgamator-gdb-tracker.ts b/src/plugin/adapter-registry/amalgamator-gdb-tracker.ts index efc31b9..9176ed1 100644 --- a/src/plugin/adapter-registry/amalgamator-gdb-tracker.ts +++ b/src/plugin/adapter-registry/amalgamator-gdb-tracker.ts @@ -90,7 +90,11 @@ export class AmalgamatorGdbVariableTransformer extends AdapterVariableTracker { } async getCurrentContext(_session: vscode.DebugSession): Promise { - return Promise.resolve(this.currentContext); + const curContext = this.contexts?.length ? + (this.contexts?.filter(context => context.id === this.currentContext?.id).shift() ?? + this.currentContext) : + this.currentContext; + return Promise.resolve(curContext); } readMemory(session: vscode.DebugSession, args: ReadMemoryArguments, context: Context): Promise {