Skip to content

Commit 5bad1d7

Browse files
authored
Merge pull request #2114 from microsoft/connor4312/fix-wasm-bp-not-working-with-predictor
fix: wasm breakpoint pausing not working on first run w/ predictor
2 parents fea4d20 + ce5dfbb commit 5bad1d7

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-debug",
33
"displayName": "JavaScript Debugger",
4-
"version": "1.95.0",
4+
"version": "1.95.1",
55
"publisher": "ms-vscode",
66
"author": {
77
"name": "Microsoft Corporation"

src/adapter/threads.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,22 +1983,18 @@ export class Thread implements IVariableStoreLocationProvider {
19831983
handler?: ScriptWithSourceMapHandler,
19841984
): Promise<boolean> {
19851985
this._scriptWithSourceMapHandler = handler;
1986-
19871986
const needsPause = pause && this._sourceContainer.sourceMapTimeouts().sourceMapMinPause
19881987
&& handler;
19891988
if (needsPause && !this._pauseOnSourceMapBreakpointIds?.length) {
19901989
// setting the URL breakpoint for wasm fails if debugger isn't fully initialized
19911990
await this.debuggerReady.promise;
19921991

1993-
const wasmHandlers = Promise.all([...this._executionContexts.keys()]
1994-
.map(id => this._installWasmPauseHandler(id)));
19951992
const result = await Promise.all([
19961993
this._cdp.Debugger.setInstrumentationBreakpoint({
19971994
instrumentation: 'beforeScriptWithSourceMapExecution',
19981995
}),
19991996
]);
20001997
this._pauseOnSourceMapBreakpointIds = result.map(r => r?.breakpointId).filter(truthy);
2001-
await wasmHandlers;
20021998
} else if (!needsPause && this._pauseOnSourceMapBreakpointIds?.length) {
20031999
const breakpointIds = this._pauseOnSourceMapBreakpointIds;
20042000
this._pauseOnSourceMapBreakpointIds = undefined;
@@ -2007,6 +2003,14 @@ export class Thread implements IVariableStoreLocationProvider {
20072003
);
20082004
}
20092005

2006+
// WASM pauses should be unconditionally installed because DWARF parsing
2007+
// always happens at runtime, not in the brekapoint predictor (currently)
2008+
if (handler) {
2009+
await Promise.all(
2010+
[...this._executionContexts.keys()].map(id => this._installWasmPauseHandler(id)),
2011+
);
2012+
}
2013+
20102014
return !!this._pauseOnSourceMapBreakpointIds?.length;
20112015
}
20122016

0 commit comments

Comments
 (0)