Skip to content

Commit

Permalink
debug: fix wasm module pauses for Node (#2117)
Browse files Browse the repository at this point in the history
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 microsoft/vscode#230875
  • Loading branch information
connor4312 authored Oct 28, 2024
1 parent 220de80 commit 4e9f6b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/adapter/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,8 @@ export class Thread implements IVariableStoreLocationProvider {
if (this._scriptWithSourceMapHandler) {
this._installWasmPauseHandler(description.id);
}

return context;
}

private _installWasmPauseHandler(contextId: number) {
Expand Down Expand Up @@ -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: '<autofilled>',
origin: '',
uniqueId: String(event.executionContextId),
});
this._executionContexts.set(event.executionContextId, executionContext);
}

const createSource = async () => {
Expand Down

0 comments on commit 4e9f6b8

Please # to comment.