Last Comment Bug 808588 - Cannot debug script files included in a xul file
: Cannot debug script files included in a xul file
Status: RESOLVED FIXED
[chrome-debug]
:
Product: Firefox
Classification: Client Software
Component: Developer Tools: Debugger (show other bugs)
: Trunk
: All All
: P2 normal with 1 vote (vote)
: ---
Assigned To: Panos Astithas [:past]
:
:
Mentors:
Depends on: 820012
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-05 08:22 PST by Mihai Sucan [:msucan]
Modified: 2013-09-03 05:24 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
dbug.log (4.59 KB, text/plain)
2013-02-25 16:05 PST, Rob Campbell [:rc] (:robcee)
no flags Details

Description Mihai Sucan [:msucan] 2012-11-05 08:22:35 PST
STR:

1. Open the Web Console.
2. Open the Browser Debugger.
3. Select webconsole.js from the scripts drop-down.
4. Search for JSTF_keyPress().
5. Set a breakpoint inside the function you found.
6. Start typing the Web Console input.

Expected result: execution pauses in JSTF_keyPress at the breakpoint you add.

Actual result: nothing happens. Execution is not paused.
Comment 1 Rob Campbell [:rc] (:robcee) 2012-11-16 14:47:59 PST
I'm morphing this bug a little as we've found some more information.

It looks like we're also unable to debug scripts loaded in XUL files in general. I tested both the webconsole.js case and the debugger-controller.js case. I can set a breakpoint in those files but am unable to trigger the breakpoint even though I am exercising that line of code.
Comment 2 Jim Blandy :jimb 2012-12-04 13:01:48 PST
For what it's worth:

Our sole onNewScript handler is ThreadActor.prototype.onNewScript, which calls ThreadActor.prototype._addScript, which calls ThreadActor.prototype._allowScript to decide whether to add the script to our tables.

_allowScript ignores scripts that have no url, or whose urls begin with "chrome://" or "about:". Would any of that be a problem here?
Comment 3 Panos Astithas [:past] 2012-12-04 23:27:37 PST
(In reply to Jim Blandy :jimb from comment #2)
> _allowScript ignores scripts that have no url, or whose urls begin with
> "chrome://" or "about:". Would any of that be a problem here?

The Browser Debugger attaches to the ChromeDebuggerActor, which overrides _allowScript ignoring only scripts without a URL.
Comment 4 omri.baumer 2013-01-01 04:46:02 PST
Any update on this?
Comment 5 Rob Campbell [:rc] (:robcee) 2013-02-25 16:02:50 PST
Mihai's testcase in Comment #0 is still valid, despite the scripts in question showing up in the debugger. See attached debug log from my session.
Comment 6 Rob Campbell [:rc] (:robcee) 2013-02-25 16:05:02 PST
Created attachment 718153 [details]
dbug.log

walking through the testcase in comment #0.

note the inner connection when I open the webconsole. See the breakpoint get set at line 52.

DBG-SERVER: Got: {
  "to": "conn2.chromeDebugger2",
  "type": "setBreakpoint",
  "location": {
    "url": "chrome://browser/content/devtools/webconsole.js",
    "line": 3112
  }
}
Comment 7 Jim Blandy :jimb 2013-02-25 17:42:59 PST
Why does that log contain only the packets sent from client to server, and not the server's responses?
Comment 8 Panos Astithas [:past] 2013-02-26 01:07:18 PST
(In reply to Jim Blandy :jimb from comment #7)
> Why does that log contain only the packets sent from client to server, and
> not the server's responses?

To get logs from both sides in chrome debugging, one needs to additionally set devtools.debugger.log in the automatically-created profile for the browser debugger. That is called something like blahblah_chrome-debugger-profile. Adding it to prefs.js (or user.js) before starting the debugger will work.
Comment 9 Panos Astithas [:past] 2013-02-26 01:09:23 PST
I should add that my hope is that the fix for bug 820012 will take care of this one, too.
Comment 10 Panos Astithas [:past] 2013-03-14 18:01:38 PDT
(In reply to Panos Astithas [:past] from comment #9)
> I should add that my hope is that the fix for bug 820012 will take care of
> this one, too.

It actually does!
Comment 11 Panos Astithas [:past] 2013-03-19 03:17:27 PDT
Fixed by bug 820012.

Note You need to log in before you can comment on or make changes to this bug.