Closed Bug 1578752 Opened 5 years ago Closed 5 years ago

Jumping from Inspector events to Debugger jumps to wrong line for pretty-printed sources

Categories

(DevTools :: Debugger, defect, P2)

70 Branch
defect

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: minkul.alam, Assigned: zhaogangse)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

  1. Open this Glitch project https://mini-whippoorwill.glitch.me/
  2. Inspect the button
  3. Click the event listeners list icon
  4. From the event listeners list, click the 'open in debugger' arrow for custom script 'script.js' file.
  5. Pretty print source by clicking the prettifier button on bottom.

Actual results:

Debugger cannot point to exact line number, where the event is attached.

Expected results:

Like chromium devTools, Firefox devTools also should be able to point to exact line number on prettified source.

Priority: -- → P2

Thanks for filing a great report.

After some browsing and testing, I'd like to share some information for fixing the bug.

In our current code base, the problem is twofold:

  1. Debugger only receives line location from the inspector. An additional column indicating the head of the listener is needed to be sent. This doesn't seem to be a problem on the debugger side.

  2. Our pretty print has a bug that the highlight location isn't selected in the prettified version, though there exists code supposedly doing the job. This can be fixed by deleting
    await dispatch(selectSource(cx, prettySource.id)) in prettyPrint.js:createPrettySource(), because this line cleared the current selected location as a side effect, and it's useless.

Now the event listener tooltip url in the inspector will have an additional column part for generated file, which will be parsed as location.column to debugger, and the debugger pretty print can correctly create and use source map.

Attachment #9100119 - Attachment description: Bug 1578752 - Pass event listener column to debugger for more accurate pretty print. r=jlast → Bug 1578752 - Pass event listener column to debugger for more accurate pretty print. r=jlast, davidwalsh
Pushed by dwalsh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0762a641fec7
Pass event listener column to debugger for more accurate pretty print. r=davidwalsh
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
Summary: Debugger fails when source is minified → Jumping from Inspector events to Debugger jumps to wrong line for prettu printed sources
Summary: Jumping from Inspector events to Debugger jumps to wrong line for prettu printed sources → Jumping from Inspector events to Debugger jumps to wrong line for pretty-printed sources
Assignee: nobody → zhaogangse
Regressions: 1589278
Regressions: 1591058
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: