Closed Bug 1686564 Opened 3 years ago Closed 3 years ago

Set onExceptionUnwind once

Categories

(DevTools :: Debugger, enhancement, P3)

enhancement

Tracking

(firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Existing codebase in ThreadActor is toggling the Debugger API's onExceptionUnwind many times:

  • nullified on will-navigate, so when we start navigating to a new top level document
  • set again, if we are pausing on exception, on window-ready for top level document. Here we revert the nullification we just did in the first bullet point.
  • nullified when hitting a breakpoint, so that we aren't calling onExceptionUnwind listener while breaking and stepping
  • restored on resume, if we were pausing on exception. We revert what we did on previous bullet point.

I believe the first two bullet points are clearly legacy and not useful and may be even source of missed exception!
For the disabling while breaking and stepping, it may make sense, but I'm not able to reproduce a case where onExceptionUnwind is called while paused.

So we may get rid of all that, and only set onExceptionUnwind once, when we enable pause on exception. And nullify it only when we disable pause on exception.

Stop unregistering onExceptionUnwind on navigation (will-navigate) and pauses.
So that we no longer have to re-register it on window-ready and resume.
Instead, only check that we aren't paused when processing an exception.
Regarding navigation, I don't think we want to ignore any exception during the process of navigating to another page.
I would rather say we want to catch anything that happen during this process!

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3eafc02dd3a5
[devtools] Register onExceptionUnwind only once. r=nchevobbe
Severity: -- → S3
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: