Closed
Bug 690771
Opened 13 years ago
Closed 12 years ago
Implement the debugger pause request (at the main loop)
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 13
People
(Reporter: dcamp, Assigned: past)
References
Details
Attachments
(1 file, 3 obsolete files)
21.82 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
When sitting at the main loop, a pause request should put the debuggee in a paused state as though it hit a breakpoint. A complete implementation of the pause request would actually interrupt a running thread, but we can leave that for another bug - it's much more difficult.
Assignee | ||
Comment 1•13 years ago
|
||
FWIW, the only way we can pause the debuggee currently that I can think of, is by delaying the return from an event handler (onDebuggerStatement, onNewScript, etc.), essentially communicating synchronously with the client. It's obviously a terrible idea, but it's the only way to solve the get-new-script-then-set-breakpoints problem, without waiting for a new API.
Assignee | ||
Comment 2•13 years ago
|
||
jimb explained how this should work to me. The 'interrupt' request type can be implemented by the debugger by just calling suppressEventHandling. Since the debugger and debuggee share the same event loop the debuggee is effectively paused when we make sure that no events can be delivered. The thread or tab client can have an isPaused method and an ensurePaused method that sends the interrupt request when not in a paused state. The setBreakpoint method can automatically call ensurePaused before setting the breakpoint as a bonus to the caller and a resume packet if it had to send an interrupt one.
Assignee: nobody → past
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•13 years ago
|
||
This implements the 'interrupt' protocol request that pauses the debuggee when it is in the main loop. An immediate use I found is to turn the Resume button into a toggle that pauses when the debuggee is running and resumes when the debuggee is paused. I'm also using it to manually enter the paused state for setting a breakpoint, but that will be automated in another bug. One other significant change I made, is that when entering a nested event loop I suspend timeouts and resume them when exiting. This should prevent debuggee setTimeout calls to fire while it is paused.
Attachment #582006 -
Flags: review?(dcamp)
Assignee | ||
Updated•13 years ago
|
Component: Developer Tools → Developer Tools: Debugger
QA Contact: developer.tools → developer.tools.debugger
Assignee | ||
Comment 4•12 years ago
|
||
Rebased.
Attachment #582006 -
Attachment is obsolete: true
Attachment #582006 -
Flags: review?(dcamp)
Attachment #587303 -
Flags: review?(dcamp)
Assignee | ||
Updated•12 years ago
|
Priority: -- → P2
Assignee | ||
Comment 5•12 years ago
|
||
Rebased and refactored to take the latest superreview-requested changes into account.
Attachment #587303 -
Attachment is obsolete: true
Attachment #587303 -
Flags: review?(dcamp)
Attachment #590651 -
Flags: review?(dcamp)
Reporter | ||
Comment 6•12 years ago
|
||
Comment on attachment 590651 [details] [diff] [review] Working patch v3 There's hope that eventually an interrupt packet could actually interrupt running script (by poking the execution hook that the slowrun dialog uses), but obviously a lot of work needs to happen before that's the case (processing packets on another thread, for starters). This is perfect for now, just wanted to mention that in case I hadn't before.
Attachment #590651 -
Flags: review?(dcamp) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Try run: https://tbpl.mozilla.org/?tree=Try&rev=e808fa2475c6
Whiteboard: [land-in-fx-team]
Assignee | ||
Comment 8•12 years ago
|
||
Updated patch metadata.
Attachment #590651 -
Attachment is obsolete: true
Attachment #595695 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Attachment #595695 -
Attachment description: Working patch v3.1 → [in-fx-team] Working patch v3.1
Assignee | ||
Comment 9•12 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/c98d2cd079d5
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c98d2cd079d5
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 13
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•