cannot set breakpoint in for loop without var declaration

VERIFIED FIXED in Firefox 55


2 years ago
11 months ago


(Reporter: account-mozilla-bugzilla, Assigned: tromey)


54 Branch
Firefox 55

Firefox Tracking Flags

(firefox55 fixed)



(3 attachments)



2 years ago
Posted file example.html
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170418123106

Steps to reproduce:

1. Open attached example.html in Firefox 53.0 or Firefox Developer Edition 54.0a2 (both affected, new and old debugger!).
2. Open Developer Tools, go to Debugger.
3. Reload once to enable breakpoint sliding.
3. Click on gutter to set breakpoints in line 13 and 21.

Actual results:

- Breakpoint in line 13 is removed and one in line 16 added instead (due to sliding).
- Breakpoint in line 21 is removed and one in line 24 added instead (due to sliding).

Expected results:

- Breakpoint in line 13 should stay and not slide somewhere else.
- Breakpoint in line 21 should stay and not slide somewhere else.
- Note: Chrome 58.0 allows setting breakpoints in lines 13 and 21.
- Note: In both cases (line 13 in a loop, line 21 in a for...of loop) the loop header does not contain a declaration with "var" keyword. In the loops with a "var" declaration, setting breakpoints works (lines 9 and 17).


2 years ago
Component: Untriaged → Developer Tools: Debugger
Thanks for filing. This is likely a server related issue so i'll leave it open here as opposed to moving it to our github repo for the new ui
Priority: -- → P2

Comment 3

2 years ago
That certainly looks like a problem at a low level, perhaps even in the Debugger API itself.

Comment 4

2 years ago
The patch in bug #1362403 fixes case 4, but not case 2.

Comment 5

2 years ago
In this bug, the line table seems ok, but stepping through FlowGraphSummary gives something weird:

(gdb) p lineno
$21 = 18446744073709551615

... while it is examining the loophead op.

I think the issue is that FlowGraphSummary::populate assumes that a branch target is always visited
before the branch that leads there -- but this is not true.

I'm sure this bug arose once before but I can't find it now.

Comment 6

2 years ago
I have a mildly ugly patch for this, based on top of my patch for bug 1362403.
Assignee: nobody → ttromey
Depends on: 1362403
Ever confirmed: true
Comment hidden (mozreview-request)

Comment 8

2 years ago
Comment on attachment 8864993 [details]
Bug 1362416 - fix FlowGraphSummary to handle branch target before the branch;

Looks good to me.
Attachment #8864993 - Flags: review?(jimb) → review+

Comment 9

2 years ago
Pushed by
fix FlowGraphSummary to handle branch target before the branch; r=jimb

Comment 10

2 years ago
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
I have reproduced this bug with nightly 55.0a1 (2017-05-05) (64-bit) on "Linux Mint 18.1 Serena"(64 Bit).

The bug's fix is now verified on Latest nightly 55.0a1.

Build ID 	20170530100155
User Agent 	Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

I have successfully reproduced the bug in firefox Nightly 55.0a1 (2017-05-05) (32-bit) with windows 10 (32 bit) 

Verified as fixed with latest nightly 55.0a1 (2017-05-31) (32-bit)

Build ID:   20170531030204
Mozilla/5.0 (Windows NT 10.0; rv:55.0) Gecko/20100101 Firefox/55.0
QA Whiteboard: [Bugday-20170531]
 As per Comment 11 & Comment 12, I am marking this bug as verified fixed.


11 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.