Closed Bug 862142 Opened 7 years ago Closed 7 years ago

remote debugger doesn't find any sources for simulator on nightly

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 23

People

(Reporter: myk, Assigned: past)

Details

(Whiteboard: [b2g])

Attachments

(1 file, 1 obsolete file)

The remote debugger reports "This page has no sources." after I connect it to the chrome://browser/content/shell.xul remote tab of the Firefox OS Simulator from the latest nightly build of Firefox.  It works fine on the latest Aurora build of Firefox.

I'm testing on the latest Firefox OS Simulator preview build (3.0pre5):

    Windows: https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-windows.xpi
    Mac: https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-mac.xpi
    Linux: https://ftp.mozilla.org/pub/mozilla.org/labs/r2d2b2g/r2d2b2g-linux.xpi


Steps to Reproduce:

1. install the Firefox OS Simulator;
2. select Tools > Web Developer > Firefox OS Simulator to open the Dashboard;
3. press the Simulator toggle button in the Dashboard to start the Simulator;
4. press the Connect... button in the Dashboard to open the Connect tab;
5. press the Connect button in the Connect tab to connect to the Simulator;
6. select the chrome://browser/content/shell.xul (only) remote tab to open the Web Console window;
7. select the Debugger tab in the Web Console window.

Expected Results: Debugger sidebar lists sources.
Actual Results: Debugger sidebar says "This page has no sources."


There isn't anything suspicious in the Error Console.  The debugger log has:

DBG-CLIENT: Got: {
  "from": "root",
  "applicationType": "browser",
  "traits": {}
}
DBG-CLIENT: Got: {
  "from": "root",
  "selected": 0,
  "tabs": [
    {
      "actor": "conn0.tab2",
      "url": "chrome://browser/content/shell.xul",
      "consoleActor": "conn0.console8"
    }
  ],
  "consoleActor": "conn0.console3",
  "profilerActor": "conn0.profiler4",
  "webappsActor": "conn0.webapps5",
  "simulatorActor": "conn0.simulator6",
  "simulatorWebappsActor": "conn0.simulatorWebapps7"
}
DBG-CLIENT: Got: {
  "msg": "geolocationReady received",
  "from": "conn0.simulator6"
}
DBG-CLIENT: Got: {
  "from": "root",
  "applicationType": "browser",
  "traits": {}
}
DBG-CLIENT: Got: {
  "from": "root",
  "selected": 0,
  "tabs": [
    {
      "actor": "conn1.tab2",
      "url": "chrome://browser/content/shell.xul",
      "consoleActor": "conn1.console8"
    }
  ],
  "consoleActor": "conn1.console3",
  "profilerActor": "conn1.profiler4",
  "webappsActor": "conn1.webapps5",
  "simulatorActor": "conn1.simulator6",
  "simulatorWebappsActor": "conn1.simulatorWebapps7"
}
DBG-CLIENT: Got: {
  "startedListeners": [
    "PageError",
    "ConsoleAPI",
    "NetworkActivity",
    "FileActivity"
  ],
  "nativeConsoleAPI": true,
  "from": "conn1.console8"
}
DBG-CLIENT: Got: {
  "from": "conn1.console8",
  "messages": []
}
DBG-CLIENT: Got: {
  "updated": [
    "NetworkMonitor.saveRequestAndResponseBodies"
  ],
  "from": "conn1.console8"
}
DBG-FRONTEND: ToolbarView was instantiated
DBG-FRONTEND: OptionsView was instantiated
DBG-FRONTEND: FilterView was instantiated
DBG-FRONTEND: FilteredSourcesView was instantiated
DBG-FRONTEND: FilteredFunctionsView was instantiated
DBG-FRONTEND: ChromeGlobalsView was instantiated
DBG-FRONTEND: StackFramesView was instantiated
DBG-FRONTEND: SourcesView was instantiated
DBG-FRONTEND: WatchExpressionsView was instantiated
DBG-FRONTEND: GlobalSearchView was instantiated
DBG-FRONTEND: Initializing the DebuggerView
DBG-FRONTEND: Initializing the DebuggerView window
DBG-FRONTEND: Initializing the DebuggerView panes
DBG-FRONTEND: Initializing the ToolbarView
DBG-FRONTEND: Initializing the OptionsView
DBG-FRONTEND: Initializing the FilterView
DBG-FRONTEND: Initializing the FilteredSourcesView
DBG-FRONTEND: Initializing the FilteredFunctionsView
DBG-FRONTEND: Initializing the ChromeGlobalsView
DBG-FRONTEND: Initializing the StackFramesView
DBG-FRONTEND: Initializing the SourcesView
DBG-FRONTEND: Initializing the WatchExpressionsView
DBG-FRONTEND: Initializing the GlobalSearchView
DBG-FRONTEND: Initializing the DebuggerView editor
DBG-FRONTEND: Finished loading the DebuggerView editor
Whiteboard: [b2g]
Sounds like a TypeError being silently swallowed somewhere, possibly in DVS_addSource.
Copious bisecting pointed out bug 859569 as the culprit. I'll look into it tomorrow.
Any luck?
Attached patch Patch v1 (obsolete) — Splinter Review
It was a dumb mistake on my part. Tab attachment should now be automatic even in the remote case.
Assignee: nobody → past
Status: NEW → ASSIGNED
Attachment #739519 - Flags: review?(vporof)
Comment on attachment 739519 [details] [diff] [review]
Patch v1

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

I would have moved the attachTab callback into a reusable function, but this is fine too.
Attachment #739519 - Flags: review?(vporof) → review+
Attached patch Patch v2Splinter Review
(In reply to Victor Porof [:vp] from comment #5)
> I would have moved the attachTab callback into a reusable function, but this
> is fine too.

Good idea, done.

While running mochitests I discovered that this change breaks the browser console tests, so I had to fix them, too. The problem was that the browser console was exploiting a loophole in TabTarget.makeRemote, which was causing this bug.

The browser console is the first tool to do chrome debugging using a Target object, but without going through the toolbox and the remote connection screen. This is a combination that I wasn't handling properly in makeRemote previously. The second part of the fix was to make the options object that HUDService passes to forRemoteTab conform to the expected format. This entailed adding the |chrome| property and trimming the tabs array from the listTabs response, the same way we do it in the remote connection screen.

I've manually tested the simulator and the browser console and ran all mochitests and xpcshell tests. Everything works as expected.

I'm asking Mihai to review the new changes mainly as a heads up.
Attachment #739519 - Attachment is obsolete: true
Attachment #739657 - Flags: review?(mihai.sucan)
Comment on attachment 739657 [details] [diff] [review]
Patch v2

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

Looks good. Thanks for the heads-up!
Attachment #739657 - Flags: review?(mihai.sucan) → review+
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/6bb651b07ae1
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [b2g][fixed-in-fx-team] → [b2g]
Target Milestone: --- → Firefox 23
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.