The debugger doesn't always move the source view to the break point when it's hit
Categories
(DevTools :: Debugger, defect, P2)
Tracking
(firefox138 fixed)
Tracking | Status | |
---|---|---|
firefox138 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I think it's often on the first breakpoint hit on during page load. The debugger won't automatically show the currently hit breakpoint and it requires clicking on the stack frame in the stack window to go there.
I've never noticed this behaviour in Chrome.
Comment 1•8 months ago
|
||
Alex is seeing a similar intermittent issue where the Debugger doesn't scroll the source to the paused line
Updated•8 months ago
|
Reporter | ||
Updated•7 months ago
|
Updated•7 months ago
|
Assignee | ||
Comment 2•7 months ago
|
||
I reproduced against lemonde.fr, by pausing on next interruption and pretty printed the two possible scripts.
If you have simpler or different STR let me know as they may be different race conditions.
There seems to be a race condition between the pretty printing of the pause source and the selection of the paused frame.
When we pause, we immediately select the location of the frame, in the bundle/generated source (i.e. non-pretty printed):
https://searchfox.org/mozilla-central/rev/a4935c8cb9edb35981871dee4a9132ab3e77d92b/devtools/client/debugger/src/actions/pause/paused.js#53
In this action, we do detect it was a pretty printed source and start creating the pretty printed source:
https://searchfox.org/mozilla-central/rev/a4935c8cb9edb35981871dee4a9132ab3e77d92b/devtools/client/debugger/src/actions/sources/select.js#174
Within the process of creating the pretty printed source, we have some logic to maintain the currently selected location from the non-pretty printed to pretty printed location, over here:
https://searchfox.org/mozilla-central/rev/a4935c8cb9edb35981871dee4a9132ab3e77d92b/devtools/client/debugger/src/actions/sources/prettyPrint.js#246-262
But at this point in time, the actual selected location hasn't updated yet and is the one before the pause.
So that we select the top of the pretty printed source.
We then continue the execution of selectLocation
action, but bail out as the selected location changed by the pretty print creation action...
https://searchfox.org/mozilla-central/rev/a4935c8cb9edb35981871dee4a9132ab3e77d92b/devtools/client/debugger/src/actions/sources/select.js#261-264
All these async work is really complex to compose against each other, I faced similar challenges in bug 980022.
We might want/have to simplify select and pretty print actions, somehow.
Assignee | ||
Comment 3•7 months ago
|
||
Bug 1493094 is for when the source is empty in same cases.
Comment 4•6 months ago
|
||
(In reply to Alexandre Poirot [:ochameau] from comment #3)
Bug 1493094 is for when the source is empty in same cases.
I think this probably meant to be Bug 1926486, which is fixed
Assignee | ||
Comment 5•4 months ago
|
||
Reproduced again by Jeff while debugging https://qlover.jp/
Assignee | ||
Comment 6•4 months ago
|
||
I found a couple of reason why the scroll wouldn't work while investigating test failures in bug 1938418.
I'll submit a couple of fixes.
Assignee | ||
Comment 7•4 months ago
|
||
Adding a new test to extensively cover isScrolledPositionVisible
behavior,
while doing strong assertion on the behavior of scroll on pause.
Also tweak isScrolledPositionVisible
and scrollEditorIntoView
test function to receive 1-based lines.
Many usages passed 1-based lines and could possibly have an unexpected -1 shift.
Description
•