Adding breakpoints sometimes doesn't work

RESOLVED FIXED in Firefox 14

Status

()

Firefox
Developer Tools: Debugger
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: past, Assigned: past)

Tracking

Trunk
Firefox 14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

STR:

1) Load http://htmlpad.org/debugger/ and open the script debugger
2) Reload page.
3) Click on 'Click me!'
3) Try to add a breakpoint in line 19 or 20: noScript error is returned from the protocol

It may be a bug in the innermost script calculation or some issue with the workaround for the lack of findScripts.
I noticed this while writing the test for the breakpoints source editor integration stuff.

I reliably reproduced the issue and it happened on certain lines of code only. For example if I tried to add a breakpoint where a comment is I get the error.

The line numbers I picked first were giving back such errors. I had to see which lines in the code don't give the error. I determined it doesn't have to be whitespace or a comment-only line. This was surprising because when I use the debugger myself, I can add breakpoints wherever I want.
(In reply to Mihai Sucan [:msucan] from comment #1)
> I noticed this while writing the test for the breakpoints source editor
> integration stuff.
> 
> I reliably reproduced the issue and it happened on certain lines of code
> only. For example if I tried to add a breakpoint where a comment is I get
> the error.
> 
> The line numbers I picked first were giving back such errors. I had to see
> which lines in the code don't give the error. I determined it doesn't have
> to be whitespace or a comment-only line. This was surprising because when I
> use the debugger myself, I can add breakpoints wherever I want.

Your case may be a slightly different issue: the findScripts workaround doesn't work for inline scripts AFAICT, because these notifications come before the debugger client is ready to listen for them. This is a common pattern in mochitests, so I've reverted to using eval, in order for scripts to be discovered way after the debugger is initialized. In my STR above, if you remove step 2, no breakpoint can be set outside of the eval script.

You can verify from the protocol log if there is a script found containing the line you are trying to set a breakpoint to, or provide me with STR to verify it myself.
(In reply to Panos Astithas [:past] from comment #2)
> Your case may be a slightly different issue: the findScripts workaround
> doesn't work for inline scripts AFAICT, because these notifications come
> before the debugger client is ready to listen for them. This is a common

Er, what I meant to say here is that the workaround doesn't work without a page reload, which we don't commonly do in mochitests.
Ah, that makes sense. I forgot to check if a page reload would fix that. Thanks Panos!
Assignee: nobody → past
Status: NEW → ASSIGNED
Created attachment 607238 [details] [diff] [review]
Fix

Embarrassingly enough, this is the fix and I'm the one to blame here. I'll see about adding a test case.
Comment on attachment 607238 [details] [diff] [review]
Fix

So, adding a test seems to be too much work for such an obvious error (I should have spotted it from reading the comment above, for crying out loud!).
Attachment #607238 - Flags: review?(rcampbell)
Comment on attachment 607238 [details] [diff] [review]
Fix

I thought I already r+'d this. Sorry for the delay!
Attachment #607238 - Flags: review?(rcampbell) → review+
Whiteboard: [land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/86907cf92dae
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/86907cf92dae
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
OS: Mac OS X → All
Hardware: x86 → All
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 14
You need to log in before you can comment on or make changes to this bug.