Closed Bug 886137 Opened 11 years ago Closed 11 years ago

Can't inspect objects in the webconsole, while debugging and inspecting

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(firefox24 verified, firefox25 verified)

VERIFIED FIXED
Firefox 25
Tracking Status
firefox24 --- verified
firefox25 --- verified

People

(Reporter: vporof, Assigned: msucan)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

STR:

1. Go to http://htmlpad.org/debugger/
2. Open Debugger
3. Switch to Inspector
4. Switch to WebConsole
5. Click me in the content page
6. Type |window| in the jsterm input
7. Hit Enter


DBG-SERVER: Received packet 50: {
  "error": "unknownError",
  "message": "error occurred while processing 'evaluateJS': TypeError: Debugger.Object belongs to a different Debugger\nWCA_evalWithDebugger@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/actors/webconsole.js:894\nWCA_onEvaluateJS@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/actors/webconsole.js:591\nDSC_onPacket@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/main.js:805\nLDT_send/<@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/transport.js:236\nmakeInfallible/<@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/DevToolsUtils.js:61\n"
}
DBG-CLIENT: Server did not specify an actor, dropping packet: {"error":"unknownError","message":"error occurred while processing 'evaluateJS': TypeError: Debugger.Object belongs to a different Debugger\nWCA_evalWithDebugger@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/actors/webconsole.js:894\nWCA_onEvaluateJS@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/actors/webconsole.js:591\nDSC_onPacket@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/main.js:805\nLDT_send/<@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/server/transport.js:236\nmakeInfallible/<@resource://gre/modules/devtools/dbg-server.jsm -> resource://gre/modules/devtools/DevToolsUtils.js:61\n"}
The problem only occurs while the debugger pauses the page and the inspector is also opened, and the user tries to eval js in the web console. I have a fix ready, I just need to add a test.

Thanks for the bug report!
Assignee: nobody → mihai.sucan
Status: NEW → ASSIGNED
Summary: Can't inspect objects in the webconsole → Can't inspect objects in the webconsole, while debugging and inspecting
Attached patch proposed patch (obsolete) — Splinter Review
Problem was that jsterm helpers continued to use makeDebuggeeValue() that belonged to the console's Debugger instance.

I tried to refactor evalWithDebugger() to be clearer and easier to follow, and I added comments. Please let me know if I can further improve the code to be less confusing. I removed caching of jsterm helpers for the dbgWindow because there's not much point.

Thanks!
Attachment #768514 - Flags: review?(past)
Comment on attachment 768514 [details] [diff] [review]
proposed patch

Review of attachment 768514 [details] [diff] [review]:
-----------------------------------------------------------------

evalWithDebugger() is much easier to follow now, thanks!

::: browser/devtools/webconsole/test/browser_console_variables_view_while_debugging_and_inspecting.js
@@ +26,5 @@
> +  gJSTerm = hud.jsterm;
> +
> +  executeSoon(() => {
> +    info("openDebugger");
> +    openDebugger().then(debuggerOpened);

Are these executeSoon calls necessary or could you just chain the promises from opening all tools? If they are necessary, could you please add a comment explaining why?
Attachment #768514 - Flags: review?(past) → review+
Attached patch updated patchSplinter Review
Thanks for the review. The executeSoon() calls were in the test from a copy/paste from a different test. Removed them.

Landed in fx-team: https://hg.mozilla.org/integration/fx-team/rev/078bd06b592c
Attachment #768514 - Attachment is obsolete: true
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/078bd06b592c
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 25
Comment on attachment 769015 [details] [diff] [review]
updated patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 869003
User impact if declined: console eval can fail when the inspector is open and the debugger is paused.
Testing completed (on m-c, etc.): tests included, green in fx-team and m-c.
Risk to taking this patch (and alternatives if risky): minimal risks. This is central to how the console works, and it is one of the most tested parts.
String or IDL/UUID changes made by this patch: none.

Thank you!
Attachment #769015 - Flags: approval-mozilla-aurora?
Keywords: regression
Comment on attachment 769015 [details] [diff] [review]
updated patch

Low risk patch, Fx23 regression. We are still early in the Fx24 aurora cycle to land this, approving.
Attachment #769015 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Thank you!
Keywords: verifyme
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:26.0) Gecko/20100101 Firefox/26.0
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0
Mozilla/5.0 (X11; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0) Gecko/20100101 Firefox/26.0

Verified as fixed on Firefox 24 beta 7 (Build ID: 20130829135643) and latest Nightly 26.0a1(2013-08-29) with STR from comment 0.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 fixed
Mozilla/5.0 (X11; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0 fixed
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:25.0) Gecko/20100101 Firefox/25.0 

Verified as fixed with latest Aurora 25.0a2 (Build ID: 20130909004001).
Status: RESOLVED → VERIFIED
Keywords: verifyme
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: