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 May 27, 2024
1 parent 47dbfc8 commit e400b97
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 getCurrentContext(_session: vscode.DebugSession): Promise<Context | undefined> {
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<ReadMemoryResult> {
Expand Down

0 comments on commit e400b97

Please sign in to comment.