Skip to content

Commit 0cd9217

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
Update script file after adding debug info url through dialog
This changes the DebuggerPlugin to update the script file after new debug info has been attached through the dialog. This also will trigger rendering any missing debug info information bar if debug information is missing. With this change, we can re-enable a previously skipped test, as the information bar will now show up as soon as we update the script file. Fixed: 372419542 Change-Id: I133baa99a491eb9466213c264ca5b27659d0520b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5982915 Reviewed-by: Philip Pfaffe <[email protected]> Commit-Queue: Kim-Anh Tran <[email protected]>
1 parent 1c8dc08 commit 0cd9217

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

front_end/panels/sources/DebuggerPlugin.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,18 +566,23 @@ export class DebuggerPlugin extends Plugin {
566566
scriptFile.addSourceMapURL(url);
567567
}
568568

569-
function addDebugInfoURL(scriptFile: Bindings.ResourceScriptMapping.ResourceScriptFile): void {
569+
function addDebugInfoURL(
570+
this: DebuggerPlugin, scriptFile: Bindings.ResourceScriptMapping.ResourceScriptFile): void {
570571
const dialog =
571-
AddDebugInfoURLDialog.createAddDWARFSymbolsURLDialog(addDebugInfoURLDialogCallback.bind(null, scriptFile));
572+
AddDebugInfoURLDialog.createAddDWARFSymbolsURLDialog(addDebugInfoURLDialogCallback.bind(this, scriptFile));
572573
dialog.show();
573574
}
574575

575576
function addDebugInfoURLDialogCallback(
576-
scriptFile: Bindings.ResourceScriptMapping.ResourceScriptFile, url: Platform.DevToolsPath.UrlString): void {
577+
this: DebuggerPlugin, scriptFile: Bindings.ResourceScriptMapping.ResourceScriptFile,
578+
url: Platform.DevToolsPath.UrlString): void {
577579
if (!url) {
578580
return;
579581
}
580582
scriptFile.addDebugInfoURL(url);
583+
if (scriptFile.script?.debuggerModel) {
584+
this.updateScriptFile(scriptFile.script?.debuggerModel);
585+
}
581586
}
582587

583588
if (this.uiSourceCode.project().type() === Workspace.Workspace.projectTypes.Network &&
@@ -593,7 +598,7 @@ export class DebuggerPlugin extends Plugin {
593598
!Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().pluginManager.hasPluginForScript(
594599
scriptFile.script)) {
595600
contextMenu.debugSection().appendItem(
596-
i18nString(UIStrings.addWasmDebugInfo), addDebugInfoURL.bind(null, scriptFile),
601+
i18nString(UIStrings.addWasmDebugInfo), addDebugInfoURL.bind(this, scriptFile),
597602
{jslogContext: 'add-wasm-debug-info'});
598603
}
599604
}

test/e2e/extensions/debugger-language-plugins_test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ describe('The Debugger Language Plugins', () => {
495495
assert.deepEqual(sourceLocations, ['unreachable.ll:6', 'unreachable.html:27', 'unreachable.html:30']);
496496
});
497497

498-
// Test needs to be updated after a protocol change.
499-
it.skip('[crbug.com/372419542], shows a warning when no debug info is present', async () => {
498+
it('shows a warning when no debug info is present', async () => {
500499
const extension = await loadExtension(
501500
'TestExtension', `${getResourcesPathWithDevToolsHostname()}/extensions/language_extensions.html`);
502501
await extension.evaluate(() => {
@@ -514,14 +513,15 @@ describe('The Debugger Language Plugins', () => {
514513
}
515514
}
516515

517-
RegisterExtension(new MissingInfoPlugin(), 'MissingInfo', {language: 'WebAssembly', symbol_types: ['None']});
516+
RegisterExtension(
517+
new MissingInfoPlugin(), 'MissingInfo', {language: 'WebAssembly', symbol_types: ['ExternalDWARF']});
518518
});
519519

520520
await openSourcesPanel();
521521
await click(PAUSE_ON_UNCAUGHT_EXCEPTION_SELECTOR);
522522
await goToResource('sources/wasm/unreachable.html');
523-
await addDummyExternalDWARFInfo('unreachable.wasm');
524523
await waitFor(RESUME_BUTTON);
524+
await addDummyExternalDWARFInfo('unreachable.wasm');
525525

526526
const incompleteMessage = `Failed to load any debug info for ${getResourcesPath()}/sources/wasm/unreachable.wasm.`;
527527
const infoBar = await waitFor(`.infobar-error[aria-label="${incompleteMessage}"`);

0 commit comments

Comments
 (0)