cannot set breakpoint in for loop without var declaration

VERIFIED FIXED in Firefox 55

Status

defect
P2
normal
VERIFIED FIXED
2 years ago
a year ago

People

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

Tracking

54 Branch
Firefox 55
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(3 attachments)

Reporter

Description

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 for...in 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).
Reporter

Updated

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 github.com/devtools-html/debugger.html/
Priority: -- → P2

Comment 3

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

Comment 4

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

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.
Assignee

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
Status: UNCONFIRMED → NEW
Depends on: 1362403
Ever confirmed: true
Comment hidden (mozreview-request)

Comment 8

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

https://reviewboard.mozilla.org/r/136648/#review139762

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

Comment 9

2 years ago
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b2bec2797b6d
fix FlowGraphSummary to handle branch target before the branch; r=jimb

Comment 10

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b2bec2797b6d
Status: NEW → RESOLVED
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

[Bugday-20170531]
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.
Status: RESOLVED → VERIFIED

Updated

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