From 4e9f6b8cee28ea0cfaadcee586e2230ee55f9d4d Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Mon, 28 Oct 2024 11:03:35 -0700 Subject: [PATCH] debug: fix wasm module pauses for Node (#2117) Node has a bug where it doesn't report execution contexts properly. We 'backfill' them if we see a script parsed in an unknown execution context, but we didn't handle that in the same way and so didn't set the WASM module pause in the backfilled contexts. Closes https://github.com/microsoft/vscode/issues/230875 --- src/adapter/threads.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/adapter/threads.ts b/src/adapter/threads.ts index 8b790b9f0..1ea141859 100644 --- a/src/adapter/threads.ts +++ b/src/adapter/threads.ts @@ -927,6 +927,8 @@ export class Thread implements IVariableStoreLocationProvider { if (this._scriptWithSourceMapHandler) { this._installWasmPauseHandler(description.id); } + + return context; } private _installWasmPauseHandler(contextId: number) { @@ -1661,13 +1663,12 @@ export class Thread implements IVariableStoreLocationProvider { let executionContext = this._executionContexts.get(event.executionContextId); if (!executionContext) { this.logger.info(LogTag.Internal, 'Creating missing execution context id', event); - executionContext = new ExecutionContext({ + executionContext = this._executionContextCreated({ id: event.executionContextId, name: '', origin: '', uniqueId: String(event.executionContextId), }); - this._executionContexts.set(event.executionContextId, executionContext); } const createSource = async () => {