Closed Bug 878319 Opened 8 years ago Closed 8 years ago
JS debugger: move make
Infallible into a shareable JSM
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)
Assignee: nobody → jimb
Status: NEW → ASSIGNED
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.
Try looked good. https://hg.mozilla.org/integration/mozilla-inbound/rev/24e9d3a53f8b
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.