From c406f340b0f9fd29a61c7ae5fc75481dfade142c 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 7af62ce..e21d45f 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 getCurrentConnectionContext(_session: vscode.DebugSession): Promise { - return Promise.resolve(this.currentConnectionContext); + const curConnectionContext = this.connectionContexts?.length ? + (this.connectionContexts?.filter(context => context.id === this.currentConnectionContext?.id).shift() ?? + this.currentConnectionContext) : + this.currentConnectionContext; + return Promise.resolve(curConnectionContext); } readMemory(session: vscode.DebugSession, args: ReadMemoryArguments, context: ConnectionContext): Promise {