Closed Bug 878319 Opened 8 years ago Closed 8 years ago

JS debugger: move makeInfallible into a shareable JSM


(DevTools :: Debugger, defect)

Not set


(Not tracked)

Firefox 24


(Reporter: jimb, Assigned: jimb)




(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
Flags: in-testsuite-
Target Milestone: --- → Firefox 24
Backed out in - browser_dbg_chrome-debugging.js timed out, then the whole suite timed out after 7200 seconds of nothing happening, a la
I missed a use of safeErrorString in toolkit/devtools/server/main.js. Try push for revised version:

(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+
Closed: 8 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.