diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/debug/wasm-07.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/debug/wasm-07.js')
-rw-r--r-- | js/src/jit-test/tests/debug/wasm-07.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/wasm-07.js b/js/src/jit-test/tests/debug/wasm-07.js new file mode 100644 index 0000000000..a6977198e8 --- /dev/null +++ b/js/src/jit-test/tests/debug/wasm-07.js @@ -0,0 +1,39 @@ +// |jit-test| test-also=--wasm-compiler=optimizing; skip-if: !wasmDebuggingEnabled() + +// Checking existence of all frame.offset references during onEnterFrame, +// onLeaveFrame and onStep events in the source code, and that we can +// potentially resolve offset back to the line/column. + +load(libdir + "wasm.js"); + +var offsets; +wasmRunWithDebugger( + '(module (func (nop) (nop)) (export "test" (func 0)))', + undefined, + function ({dbg}) { + offsets = []; + dbg.onEnterFrame = function (frame) { + if (frame.type != 'wasmcall') { + return; + } + offsets.push(frame.offset); + frame.onStep = function () { + offsets.push(frame.offset); + }; + frame.onPop = function () { + offsets.push(frame.offset); + }; + }; + }, + function ({wasmScript, error}) { + assertEq(error, undefined); + assertEq(offsets.length, 4); + offsets.forEach(offset => { + var loc = wasmScript.getOffsetLocation(offset); + assertEq(loc.isEntryPoint, true); + assertEq(loc.lineNumber > 0, true); + assertEq(loc.columnNumber > 0, true); + assertEq(wasmScript.getLineOffsets(loc.lineNumber).length, 1); + }); + } +); |