Skip to content

Commit 25a5bda

Browse files
committed
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 <thor.thayer@ericsson.com>
1 parent 82ea4da commit 25a5bda

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/plugin/adapter-registry/amalgamator-gdb-tracker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ export class AmalgamatorGdbVariableTransformer extends AdapterVariableTracker {
9090
}
9191

9292
async getCurrentContext(_session: vscode.DebugSession): Promise<Context | undefined> {
93-
return Promise.resolve(this.currentContext);
93+
const curContext = this.contexts?.length ?
94+
(this.contexts?.filter(context => context.id === this.currentContext?.id).shift() ??
95+
this.currentContext) :
96+
this.currentContext;
97+
return Promise.resolve(curContext);
9498
}
9599

96100
readMemory(session: vscode.DebugSession, args: ReadMemoryArguments, context: Context): Promise<ReadMemoryResult> {

src/plugin/memory-webview-main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ export class MemoryWebview implements vscode.CustomReadonlyEditorProvider {
263263
}
264264

265265
protected async setSessionContext(webviewParticipant: WebviewIdMessageParticipant, context: SessionContext): Promise<void> {
266+
const contexts = await this.getContexts(); // Want to read this first.
266267
await this.messenger.sendRequest(sessionContextChangedType, webviewParticipant, [context,
267-
await this.getCurrentContext(), await this.getContexts()]);
268+
await this.getCurrentContext(), contexts]);
268269
}
269270

270271
protected getMemoryViewSettings(messageParticipant: WebviewIdMessageParticipant, title: string): MemoryViewSettings {

0 commit comments

Comments
 (0)