diff --git a/front_end/sdk/DebuggerModel.js b/front_end/sdk/DebuggerModel.js index e3820707cc..829fd199d6 100644 --- a/front_end/sdk/DebuggerModel.js +++ b/front_end/sdk/DebuggerModel.js @@ -642,12 +642,13 @@ export class DebuggerModel extends SDKModel { * @param {?Protocol.Runtime.StackTrace} originStackTrace * @param {?number} codeOffset * @param {?string} scriptLanguage + * @param {?Protocol.Debugger.DebugSymbols} debugSymbols * @return {!Script} */ _parsedScriptSource( scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData, isLiveEdit, sourceMapURL, hasSourceURLComment, hasSyntaxError, length, originStackTrace, - codeOffset, scriptLanguage) { + codeOffset, scriptLanguage, debugSymbols) { if (this._scripts.has(scriptId)) { return this._scripts.get(scriptId); } @@ -659,7 +660,7 @@ export class DebuggerModel extends SDKModel { const script = new Script( this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, this._internString(hash), isContentScript, isLiveEdit, sourceMapURL, hasSourceURLComment, length, - originStackTrace, codeOffset, scriptLanguage); + originStackTrace, codeOffset, scriptLanguage, debugSymbols); this._registerScript(script); this.dispatchEventToListeners(Events.ParsedScriptSource, script); @@ -1108,15 +1109,16 @@ class DebuggerDispatcher { * @param {!Protocol.Runtime.StackTrace=} stackTrace * @param {number=} codeOffset * @param {string=} scriptLanguage + * @param {!Protocol.Debugger.DebugSymbols=} debugSymbols */ scriptParsed( scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData, isLiveEdit, sourceMapURL, hasSourceURL, isModule, length, stackTrace, codeOffset, - scriptLanguage) { + scriptLanguage, debugSymbols) { this._debuggerModel._parsedScriptSource( scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData, !!isLiveEdit, sourceMapURL, !!hasSourceURL, false, length || 0, stackTrace || null, - codeOffset || null, scriptLanguage || null); + codeOffset || null, scriptLanguage || null, debugSymbols || null); } /** @@ -1144,7 +1146,7 @@ class DebuggerDispatcher { this._debuggerModel._parsedScriptSource( scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxData, false, sourceMapURL, !!hasSourceURL, true, length || 0, stackTrace || null, - codeOffset || null, scriptLanguage || null); + codeOffset || null, scriptLanguage || null, null); } /** diff --git a/front_end/sdk/Script.js b/front_end/sdk/Script.js index d2b6b5e0ac..2b69e3e11d 100644 --- a/front_end/sdk/Script.js +++ b/front_end/sdk/Script.js @@ -54,10 +54,12 @@ export class Script { * @param {?Protocol.Runtime.StackTrace} originStackTrace * @param {?number} codeOffset * @param {?string} scriptLanguage + * @param {?Protocol.Debugger.DebugSymbols} debugSymbols */ constructor( debuggerModel, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, executionContextId, hash, - isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length, originStackTrace, codeOffset, scriptLanguage) { + isContentScript, isLiveEdit, sourceMapURL, hasSourceURL, length, originStackTrace, codeOffset, scriptLanguage, + debugSymbols) { /** @type {?string} */ this._source; @@ -74,6 +76,11 @@ export class Script { this._isContentScript = isContentScript; this._isLiveEdit = isLiveEdit; this.sourceMapURL = sourceMapURL; + if (!sourceMapURL && debugSymbols && debugSymbols.type === 'EmbeddedDWARF') { + // TODO(chromium:1064248) Remove this once we either drop gimli or support DebugSymbols all the way down. + this.sourceMapURL = 'wasm://dwarf'; + } + this.debugSymbols = debugSymbols; this.hasSourceURL = hasSourceURL; this.contentLength = length; this._originalContentProvider = null;