Closed Bug 878319 Opened 11 years ago Closed 11 years ago

JS debugger: move makeInfallible into a shareable JSM

Categories

(DevTools :: Debugger, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 24

People

(Reporter: jimb, Assigned: jimb)

References

Details

Attachments

(1 file, 1 obsolete file)

It's annoying not to have it readily available, since it's really needed almost any time one uses IDL-based callbacks.
Attachment #756826 - Flags: review?(dcamp)
Attachment #756826 - Flags: review?(dcamp) → review+
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Flags: in-testsuite-
Target Milestone: --- → Firefox 24
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/fc1972bf1410 - browser_dbg_chrome-debugging.js timed out, then the whole suite timed out after 7200 seconds of nothing happening, a la https://tbpl.mozilla.org/php/getParsedLog.php?id=23687167&tree=Mozilla-Inbound&full=1
I missed a use of safeErrorString in toolkit/devtools/server/main.js. Try push for revised version: https://tbpl.mozilla.org/?tree=Try&rev=8043a802ec56 (What's ironic is that this patch is about making some functions for reliably catching and reporting errors more easily available by moving them to their own JSM. We've used them to ensure that unexpected exceptions in the JS debugger's xpcshell tests reliably cause test failures, but we haven't tightened up the debugger's mochitests this way yet. The mochitests do use one error-reporting function, which my move made unavailable... causing the mochitests to hang without failing... in exactly the way that those functions were created to make it easier to avoid.)
This is kind of pathetic: this breaks chrome debugging (the checks are working as intended, for once). makeInfallible returns a closure of one of its nested functions. One of these closures will be on the stack whenever the debugger server is handling a packet from the client, because that little closure from makeInfallible needs to catch and report any uncaught exceptions thrown by the packet handling code. But each JSM gets its own global object. By putting makeInfallible in its own JSM, we've moved it to a global that addAllGlobalsAsDebuggees doesn't recognize as part of the debugger (it knows to skip the global whose compartment contains the Debugger instance, but that's as much as it knows). So when the chrome debugger actor gets an 'attach' packet, it tries to add makeInfallible's compartment as a debuggee, but fails. So we have to use loadSubScript.
Requesting new review; should be quick.
Attachment #756826 - Attachment is obsolete: true
Attachment #757491 - Flags: review?(dcamp)
Attachment #757491 - Flags: review?(dcamp) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 882760
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: