Closed Bug 2060460 Opened 1 month ago Closed 13 days ago

moz:debugging fails to handle nested pauses correctly

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect

Tracking

(firefox156 fixed)

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: jdescottes, Assigned: khalid.alhaddad98)

References

Details

(Whiteboard: [webdriver:m21][webdriver:external])

Attachments

(1 file, 1 obsolete file)

Spotted while reviewing Bug 2041335.

The moz:debugging windowglobal module tracks the paused state via a single flag (#paused). We also store a single paused frame in messageHandler.debuggerEnvironment.

If a nested pause occurs (either through evaluating script while paused, or via a same process iframe), this model breaks because you can't cleanly resume only the top pause (prior to Bug 2041335, it would fail slightly differently: we would remain paused with no way to resume).

We should fix this by adding a depth counter and a stack of frames, as well as tests.

Khalid, would you be interested in picking up this follow up bug around breakpoints? It is a bit more involved but I'm happy to help in case you want to pick it up.

I will push a patch adding tests in any case.

Flags: needinfo?(khalid.alhaddad98)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

(In reply to Julian Descottes [:jdescottes] from comment #1)

Khalid, would you be interested in picking up this follow up bug around breakpoints? It is a bit more involved but I'm happy to help in case you want to pick it up.

I will push a patch adding tests in any case.

Yes, I would like to pick it up, and thank you!

Flags: needinfo?(khalid.alhaddad98)

Great! Assigning to you, I think you already know how to run wdspec tests right? Feel free to pull the tests attached to the bug and use them to check your fixes!

Assignee: jdescottes → khalid.alhaddad98

Yes as well, so I will add the depth counter and stack of frames. I will also pull the tests from this bug to verify my fixes, and I will let you know if I run into any issues.

Hi Khalid, can you request review on https://phabricator.services.mozilla.com/D316732 ?

Flags: needinfo?(khalid.alhaddad98)
Attachment #9622380 - Attachment description: WIP: Bug 2060460 - Add depth counter and stack of frames to handle nested pauses in moz:debugging. r=jdescottes → Bug 2060460 - Add depth counter and stack of frames to handle nested pauses in moz:debugging. r=jdescottes

Hi Julian, done. I requested review.

Flags: needinfo?(khalid.alhaddad98)
Blocks: 2064044
Attachment #9621556 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/31d2cf1564f5 https://hg.mozilla.org/integration/autoland/rev/2de58503718e Add depth counter and stack of frames to handle nested pauses in moz:debugging. r=jdescottes
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
Whiteboard: [webdriver:m21][webdriver:external]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: