Skip to content

Commit

Permalink
Match Current Context with one of Contexts
Browse files Browse the repository at this point in the history
Match current context id with one of the elements of the
Contexts array.

Signed-off-by: Thor Thayer <[email protected]>
  • Loading branch information
WyoTwT committed Aug 23, 2024
1 parent efc0ab0 commit c406f34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plugin/adapter-registry/amalgamator-gdb-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export class AmalgamatorGdbVariableTransformer extends AdapterVariableTracker {
}

async getCurrentConnectionContext(_session: vscode.DebugSession): Promise<ConnectionContext | undefined> {
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<ReadMemoryResult> {
Expand Down

0 comments on commit c406f34

Please sign in to comment.