Closed Bug 1687175 Opened 4 years ago Closed 4 years ago

It is impossible to remove breakpoints on prettyfied sources

Categories

(DevTools :: Debugger, defect, P3)

Firefox 85
defect

Tracking

(firefox89 fixed)

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: random_n0body, Assigned: wartmanm)

References

(Blocks 3 open bugs)

Details

Attachments

(2 files)

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

Steps to reproduce:

THIS IS THE SET UP

  1. Go to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
  2. Open devtools
  3. Select "inspector"
  4. select "pick an element from the page"
  5. select the "run" button
  6. click on "event" on the highlighted element in the dom
  7. click on "open in debugger" (aka jump to function definition) on the small tooltip window
  8. press the "pretty print sources" button
  9. set a breakpoint where it says f() (currently line 65)
  10. click the "run" button
  11. watch the debugger pause
  12. continue the debugger

NOW FOR THE DIFFERENT WAYS TO TRIGGER THE BUG
Method 1:

  1. At the "breakpoints" list on the right side click "remove breakpoint" on the breakpoint
  2. close the tab
  3. reopen the tab (cmd + shift + t) or open a new tab at the same address
  4. press the "run" button on the page

Method 2 (leads to same results as method 1):

  1. On the left hand side of the line where the breakpoint is there is an arrow highlighting the breakpoint, rightclick the arrow and select "remove breakpoint"
  2. close the tab
  3. reopen the tab
  4. press the "run" button on the page

Method 3 (leads to the same result as method 1 and 2):

  1. On the left hand side rightclick on the breakpoint again
  2. Select "remove breakpoints on line"
  3. Close the tab
  4. Reopen the same address with debugger open
  5. press the "run" button on the page

Actual results:

The breakpoint is there again and will trigger / pause in the debugger.

Expected results:

The breakpoint should be GONE, REMOVED and NOT TRIGGER after I HAVE REMOVED IT THREE TIMES.

The only way to remove it is to right click the breakpoint list and select "delete all breakpoints". After that the breakpoint is gone. The three other delete buttons should also do this.

Possible duplicate of #1621819? Not sure if #1621819 isn't another issue though. And because nothing was done about it anyways I'm reporting it again, because this issue is frankly ridiculous.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → Debugger

Thanks for reporting! We can reproduce.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Looking in pending-breakpoints.js, there's special handling that always adds pretty-printed breakpoints to the minified version of the file. However, there's no such handling for removing breakpoints, so it tries to remove it from whichever version of the source is open, usually the pretty-printed one.

Making remove use the same logic as add seems to fix it. As as workaround, switching to the minified version of the file and then removing breakpoints also works to get rid of them.

(In reply to mattheww from comment #4)

Making remove use the same logic as add seems to fix it.

Thanks a lot for finally fixing this! It makes using the firefox dev tools every day much nicer. When will it be live in Firefox Developer Edition?

May I ask if you also could fix https://bugzilla.mozilla.org/show_bug.cgi?id=1687166 while you're at it?

It would be amazing because then I wouldn't have to waste time switching to chrome and reproducing whatever I'm doing there every time when I encounter a new Function source :)

(In reply to random_n0body from comment #6)

Thanks a lot for finally fixing this! It makes using the firefox dev tools every day much nicer. When will it be live in Firefox Developer Edition?

You're welcome, thanks for the detailed steps to reproduce. I'm just a volunteer, this is only a proposed fix, so I can't really say.

Assignee: nobody → wartmanm
Status: NEW → ASSIGNED

I can also easily repro the bug using STRs from comment #0

@mattheww: thanks for the patch.

Honza

Has STR: --- → yes
Attachment #9210485 - Attachment description: Bug 1687175 - remove pending breakpoints from the same location they are added to → Bug 1687175 - remove pending breakpoints from the same location they are added to r=bomsy
Pushed by hmanilla@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2f441d1132e6 remove pending breakpoints from the same location they are added to r=jdescottes,bomsy
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: