Closed Bug 1249435 Opened 8 years ago Closed 8 years ago

[meta] JS Debugger doesn't pause the debuggee

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1074448

People

(Reporter: jimb, Unassigned)

References

Details

This is a meta-bug to be blocked by all the cases we find of the JS debugger failing to pause the debuggee.

To preserve run-to-completion semantics, when the DevTools JS debugger has paused a page (at a breakpoint; single-stepping; etc.), all other attempts to run code in the debuggee (event handlers; callbacks; Promise resolutions; etc.) should be delayed until the paused invocation has completed --- even as the devtools JS debugger UI spins a nested event loop to allow its own UI to run, and to provide access to other tabs.

Firefox, or more properly Gecko, provides no single bottleneck for delaying or dropping these invocations. There are many, many reasons the browser may try to invoke JavaScript, and each must be handled in a way that respects its particular requirements. At present, we use nsIDOMWindowUtils' suppressEventHandling and suspendTimeouts, but those don't cover everything.
For bug 912337, Shu has written a patch to implement the Debugger.DebuggeeWouldRun exception, which is thrown when something tries to run code in a paused debuggee. A pref causes this to be merely a warning, not an error; this pref defaults to warning. This patch gives us a way to catch all the cases that the nsIDOMWindowUtils methods aren't handling.

This has already yielded a large list of pause violations. They're just source locations at the moment. If we could get full JS stacks from them, that would be a big step forward in helping us identify violations.
Priority: -- → P2
We already have a meta bug for tracking where we break run-to-completion semantics; I think we should reuse it here.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
(In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #2)
> We already have a meta bug for tracking where we break run-to-completion
> semantics; I think we should reuse it here.

Ah, thanks. My search didn't turn that up.
(In reply to Jim Blandy :jimb from comment #3)
> (In reply to Nick Fitzgerald [:fitzgen] [⏰PST; UTC-8] from comment #2)
> > We already have a meta bug for tracking where we break run-to-completion
> > semantics; I think we should reuse it here.
> 
> Ah, thanks. My search didn't turn that up.

Run-to-completion was arguably a very bad name for that bug :-P
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.