Breakpoint on the last line in an if block fires twice

RESOLVED DUPLICATE of bug 1013219

Status

()

Firefox
Developer Tools: Debugger
RESOLVED DUPLICATE of bug 1013219
3 years ago
3 years ago

People

(Reporter: ejpbruel, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Steps to reproduce:
- In Nightly, open bug.html in the attachment
- Set a breakpoint on the following lines:
  - var a = 2;
  - var b = 3;
  - var c = 5
- Call the function f() in the console

Observed behavior:
- The breakpoint on the first two lines hits once, but the breakpoint on the last line hits twice (note how you have to resume twice).
- This only happens if you wrap the statements in an if-block, as I did here. If you remove the if-block the problem disappears.

Expected behavior:
- The breakpoint on the last line should hit only once as well.

Since the problem only occurs within an if-block, I suspect this has something to do with how we map source locations to breakpoint offsets.
(Reporter)

Comment 1

3 years ago
Created attachment 8471810 [details]
bug.html
I think this is similar:

When you go inside any loop, the execution first goes to the second last line of the loop block and then enter the loop....
(Reporter)

Comment 3

3 years ago
I'm a bit surprised we still have so many issues with breakpoint offsets tbh. I thought we had pretty decent test coverage for that?
(Reporter)

Updated

3 years ago
Duplicate of this bug: 1056942
Attachment #8471810 - Attachment is patch: false
Attachment #8471810 - Attachment mime type: text/plain → text/html
The first pause in the "var c..." line happens in column 8, while the second one in column 9. I think we should inspect the source notes to get more data.
(Reporter)

Updated

3 years ago
Blocks: 1074182

Comment 6

3 years ago
I believe this is another instance of bug #1013219.
The fix for that bug fixes this one as well.

Comment 7

3 years ago
(In reply to Tom Tromey :tromey from comment #6)
> I believe this is another instance of bug #1013219.
> The fix for that bug fixes this one as well.

I'm not sure why I didn't mark it as a dup then; doing so now.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1013219
(Reporter)

Updated

3 years ago
Depends on: 1013219
You need to log in before you can comment on or make changes to this bug.