Review the pausing behavior between multiple threads
Categories
(DevTools :: Debugger, enhancement)
Tracking
(Not tracked)
People
(Reporter: ochameau, Unassigned)
References
Details
For now, when pausing between various document is independent.
The following test page helps highlight this. The top document and the two iframes are all running on the same thread,
but can be pause independently of each others.
data:text/html,<button onclick="debugger">top</button><iframe src="data:text/html,<button onclick='debugger'>iframe 1</button>"></iframe><iframe src="data:text/html,<button onclick='debugger'>iframe 2</button>"></iframe>
While it can be handy to pause documents individually, it can trigger code ordering that are impossible to reproduce without this special behavior of the debugger.
As a user, you may also want to pause everything, even other documents running in distinct thread and process.
For now, the pausing behavior is correctly displayed in the debugger. Each actually paused document is reported as paused in the debugger threads panel, and each document get the right pause overlay in the web page.
Bug 1413872 started introducing a discrepancy. When a Web Extension Content script is paused, the related document it runs against is also paused.
But no overlay is shown on the page, nor is the document reported as paused in the debugger threads.
We should probably unify the pausing of all threads, may be optionally, while keeping things clear in the UI.
Reporter | ||
Comment 1•2 months ago
|
||
We may end up having two different pausing state:
- thread/target actually paused on a frame, from which we can show the scope/environment in the debugger and show values in CodeMirror.
- thread/target paused by another target, but whose event loop is frozen and not paused on any actual location.
About pausing everywhere once any target pauses, we may have the options of:
- pausing the events loops. So all other threads would be in this "frozen" but state
- pause on next interupt, so that we let the event loops run until we hit some javascript execute, which we immediately pause.
Description
•