Closed Bug 1093738 Opened 10 years ago Closed 9 years ago

Breakpoints hit in code not executed

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1013219

People

(Reporter: jimb, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

A breakpoint set in an 'else' clause can be hit even when the 'else' is not taken.

- Unpack the attached ZIP file, containing bp.html and bp.js.
- Visit bp.html.
- Open the debugger.
- Set a breakpoint in bp.js on the line indicated by the comment.
- Click on the text that says 'click me'.
- The text "PASS bleah" is logged to the console, indicating that the 'then' branch was taken.
- The debugger reports a breakpoint hit in the 'else' branch.
- Press continue.

Note that "FAIL bleah" is never logged to the console, ruling out the possibility of multiple calls to the function.
(In reply to Jim Blandy :jimb from comment #0)
> A breakpoint set in an 'else' clause can be hit even when the 'else' is not
> taken.
> 
> - Unpack the attached ZIP file, containing bp.html and bp.js.
> - Visit bp.html.
> - Open the debugger.
> - Set a breakpoint in bp.js on the line indicated by the comment.
> - Click on the text that says 'click me'.
> - The text "PASS bleah" is logged to the console, indicating that the 'then'
> branch was taken.
> - The debugger reports a breakpoint hit in the 'else' branch.
> - Press continue.
> 
> Note that "FAIL bleah" is never logged to the console, ruling out the
> possibility of multiple calls to the function.

Do you think this could be related to how we map breakpoint locations to bytecode offsets using source notes?
It sure looks like either a bug with source notes or perhaps with the gigantic, in-need-of-refactoring, offset-choosing ThreadActor.prototype._setBreakpoint function.
This is another instance of bug 1013219.
The patch for that (plus the patch for bug 1003554) fixes this.
I think the bug here is that the "goto" at the end of the "then"
branch lands on the compiler-generated retrval -- which is erroneously given the
line number of the previous console.log, and thus appears to be
an entry point for purposes of breakpoint setting.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: