Closed Bug 1052738 Opened 10 years ago Closed 9 years ago

Breakpoint on the last line in an if block fires twice

Categories

(DevTools :: Debugger, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1013219

People

(Reporter: ejpbruel, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
Attached file 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....
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?
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.
I believe this is another instance of bug #1013219.
The fix for that bug fixes this one as well.
(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
Closed: 9 years ago
Resolution: --- → DUPLICATE
Depends on: 1013219
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: