Closed
Bug 879341
Opened 11 years ago
Closed 11 years ago
Do something about the awful CheckForDebugMode call in PushJSContext
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(3 files)
2.63 KB,
patch
|
gkrizsanits
:
review+
|
Details | Diff | Splinter Review |
1.88 KB,
patch
|
gkrizsanits
:
review+
|
Details | Diff | Splinter Review |
1.11 KB,
patch
|
gkrizsanits
:
review+
|
Details | Diff | Splinter Review |
This is causing all sorts of problems, and I think we need to tackle it. I recently discovered that the ActivateDebugger currently invokes xpc->InitClasses using an unpushed cx, and we currently can't push a cx because that would cause infinite recursion. :-(
The IDL docs for setDebugModeWhenPossible have this to say:
>/**
> * When we place the browser in JS debug mode, there can't be any
> * JS on the stack. This is because we currently activate debugMode
> * on all scripts in the JSRuntime when the debugger is activated.
> * This method will turn debug mode on or off when the context
> * stack reaches zero length.
> */
This is currently quite far from reality (we currently do this stuff while _pushing_, not while popping). But it gives us some indication of the original intent here, which I think we can use to our advantage. I have a plan.
Assignee | ||
Updated•11 years ago
|
Summary: Do something about the awful CheckForDebugMode call in PushJSContext. → Do something about the awful CheckForDebugMode call in PushJSContext
Assignee | ||
Comment 1•11 years ago
|
||
This gets invoked at the very end of nsThread::ProcessNextEvent(). If the cx stack
is empty here, that means the event loop isn't nested - if it it was, we'd at
least have a null cx on the stack from a higher-level call to OnProcessNextEvent
for the main thread observer.
As such, this seems like a much more reasonable place to make debug mode changes.
Attachment #758021 -
Flags: review?(gkrizsanits)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #758022 -
Flags: review?(gkrizsanits)
Assignee | ||
Comment 3•11 years ago
|
||
We can do this now, since it won't cause infinite recursion.
Attachment #758023 -
Flags: review?(gkrizsanits)
Assignee | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Comment on attachment 758021 [details] [diff] [review]
Part 1 - Move CheckForDebugMode into the main thread event observer. v1
Review of attachment 758021 [details] [diff] [review]:
-----------------------------------------------------------------
I'm glad to see this fixed :)
Attachment #758021 -
Flags: review?(gkrizsanits) → review+
Updated•11 years ago
|
Attachment #758022 -
Flags: review?(gkrizsanits) → review+
Updated•11 years ago
|
Attachment #758023 -
Flags: review?(gkrizsanits) → review+
Assignee | ||
Comment 6•11 years ago
|
||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4e9b95c25646
https://hg.mozilla.org/mozilla-central/rev/c06f0863d73e
https://hg.mozilla.org/mozilla-central/rev/a5a75ac6f7e2
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•