Closed Bug 1571640 Opened 5 years ago Closed 5 years ago

Breakpoints of assigned functions aren't hit

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1572280

People

(Reporter: ochameau, Unassigned)

Details

Attachments

(3 files, 1 obsolete file)

When setting a breakpoint on such line:
window.onclick = {document.body.innerHTML+="x";};
we used to only break when clicking on the page.
Now, we do break only on page load and no longer when clicking on the page.
This seems to have changed in a less than 10 days as I think I was having the old behavior I can now see on release builds on a somewhat recent nightly.

Here is a test document:
data:text/html,<script>window.onclick=()=>{document.body.innerHTML+="x";};</script>

Now, we do have to introduce a newline in order to be able to break on the innerHTML code.

Thanks for the report Alex.

I can't reproduce the issue. Here is what I am doing:

  1. Open DevTools and select the Debugger panel
  2. Load data:text/html,<script>window.onclick=()=>{document.body.innerHTML+="x";};</script>
  3. Create a breakpoint on line 1
  4. Reload the page, the BP should not hit
  5. Click on the page, the BP should hit

Steps #3 and #4 are working as described for me (Nightly + Win10).

What am I doing wrong?

Honza

Flags: needinfo?(poirot.alex)

I do not reproduce your STR from comment 1 and still reproduces mine.
I'm testing against Nightly 70.0a1 (2019-08-05) (64 bits) on Windows.

If I test on a local build, with very lastest m-c changeset, on Linux, I hit bug 1571721 constantly and that doesn't allow me to even try to reproduce this STR.

Flags: needinfo?(poirot.alex)
Attached image image.png

Note that Col BP needs to be properly set

See the attached screenshot:

  • If the second col BP is set - the script breaks on click
  • If the first col BP is set - the script breaks on reload

Honza

Ah ok. It works fine if I set the breakpoint on the right column.

But it highlights some randomness in:

  • how many column breakpoint are displayed,
  • and because of that, the finaly breakpoint being set by default when cliking on the line number.

It looks like there is a race or some random behavior for some reason.
See the two following screenshots from the same firefox instance against the exact same URI, but loaded in two distinct tabs.

Attachment #9083358 - Attachment is obsolete: true

I am marking this as dup since the GC issue will be solved by bug 1572280

Honza

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: