Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1a7f711d887ed01907e9f8d1d61710c543f967ac
      
https://github.com/WebKit/WebKit/commit/1a7f711d887ed01907e9f8d1d61710c543f967ac
  Author: Devin Rousso <[email protected]>
  Date:   2026-08-04 (Tue, 04 Aug 2026)

  Changed paths:
    M LayoutTests/http/tests/inspector/debugger/wasm/resources/named-module.py
    M LayoutTests/http/tests/inspector/debugger/wasm/script-url-expected.txt
    M LayoutTests/http/tests/inspector/debugger/wasm/script-url.html
    A LayoutTests/inspector/debugger/wasm/resources/source-map.json
    A LayoutTests/inspector/debugger/wasm/source-map-expected.txt
    A LayoutTests/inspector/debugger/wasm/source-map.html
    M LayoutTests/inspector/worker/debugger-getScriptSource-wasm-expected.txt
    M LayoutTests/inspector/worker/debugger-getScriptSource-wasm.html
    M LayoutTests/inspector/worker/resources/worker-debugger-wasm.js
    M Source/JavaScriptCore/debugger/Debugger.cpp
    M Source/WebInspectorUI/UserInterface/Models/Script.js
    M Source/WebInspectorUI/UserInterface/Models/SourceCode.js
    M Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js
    M Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js

  Log Message:
  -----------
  Web Inspector: map WebAssembly byte offsets to original source with source 
maps
https://bugs.webkit.org/show_bug.cgi?id=320621

Reviewed by Yusuke Suzuki.

WebAssembly source maps use module byte offsets as generated columns on line 
`0`.
Preserve canonical `(0, byteOffset)` positions without requiring generated 
source content or a disassembly.

* Source/JavaScriptCore/debugger/Debugger.cpp:
(JSC::Debugger::sourceParsed):
Report the WebAssembly module's `sourceMappingURL` to Inspector.

* Source/WebInspectorUI/UserInterface/Models/Script.js:
(WI.Script.isWebAssembly):
Check known `WI.Script` instances directly by source type.
(WI.Script.prototype.createSourceCodeLocationForBytecodeOffset): Added.
(WI.Script.prototype.createSourceMapSourceCodeLocation): Added.
(WI.Script.prototype.bytecodeOffsetForPosition): Added.
(WI.Script.prototype.createSourceMapPosition): Added.
* Source/WebInspectorUI/UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.createSourceMapSourceCodeLocation): Added.
(WI.SourceCode.prototype.createSourceMapPosition): Added.
Represent WebAssembly module byte offsets as canonical `(0, byteOffset)` source 
code positions and convert them to and from source map positions.

* Source/WebInspectorUI/UserInterface/Models/SourceCodeLocation.js:
(WI.SourceCodeLocation.prototype.resolveMappedLocation):
* Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.createSourceCodeLocation):
Convert raw locations to source map positions before resolving mappings, and 
convert generated source map positions back to raw locations.

* LayoutTests/http/tests/inspector/debugger/wasm/resources/named-module.py:
* LayoutTests/http/tests/inspector/debugger/wasm/script-url.html:
* LayoutTests/http/tests/inspector/debugger/wasm/script-url-expected.txt:
* LayoutTests/inspector/debugger/wasm/resources/source-map.json: Added.
* LayoutTests/inspector/debugger/wasm/source-map.html: Added.
* LayoutTests/inspector/debugger/wasm/source-map-expected.txt: Added.
* LayoutTests/inspector/worker/resources/worker-debugger-wasm.js:
* LayoutTests/inspector/worker/debugger-getScriptSource-wasm.html:
* LayoutTests/inspector/worker/debugger-getScriptSource-wasm-expected.txt:

Canonical link: https://commits.webkit.org/318546@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to