Startup JS debugging (sometimes) possible via Browser Toolbox

35 views
Skip to first unread message

J. Ryan Stinnett

unread,
Mar 8, 2017, 2:09:49 PM3/8/17
to dev-platform, Firefox Dev, dev-developer-tools
With bug 1275942 in Firefox 55, a new Firefox CLI option was added:
`--wait-for-jsdebugger`.

Example usage:

1. Add "debugger;" to top of browser/base/content/browser.js
2. $ ./mach run --jsdebugger --wait-for-jsdebugger
3. Browser Toolbox opens, pausing Firefox startup at the added line

This triggers Firefox to wait until the debugger connects, which makes it
possible to debug some Firefox startup JS code paths. (Some startup paths
might run before the DevTools command line handler, so for the moment they
won't pause. This could be improved in the future by moving the CLI handler
earlier in startup.)

(If you're wondering why an extra flag was added, this mode makes the
Browser Toolbox use a different default window in the Inspector, which
might confuse people if it was the default.)

Let me know if it's useful and / or you see room for improvement.

- Ryan

Dave Townsend

unread,
Mar 8, 2017, 2:12:10 PM3/8/17
to J. Ryan Stinnett, dev-platform, dev-developer-tools, Firefox Dev
This is awesome, thanks for implementing this!
> _______________________________________________
> firefox-dev mailing list
> firef...@mozilla.org
> https://mail.mozilla.org/listinfo/firefox-dev
>
>

Jared Wein

unread,
Mar 8, 2017, 2:16:47 PM3/8/17
to Dave Townsend, J. Ryan Stinnett, dev-platform, Firefox Dev, dev-developer-tools
This is very useful! Thank you for adding this!

Kris Maglione

unread,
Mar 8, 2017, 2:22:36 PM3/8/17
to J. Ryan Stinnett, dev-platform, dev-developer-tools, Firefox Dev
On Wed, Mar 08, 2017 at 01:09:10PM -0600, J. Ryan Stinnett wrote:
>With bug 1275942 in Firefox 55, a new Firefox CLI option was added:
>`--wait-for-jsdebugger`.
>
>...
>
>Let me know if it's useful and / or you see room for improvement.

To put it one way: if we are ever in the same room, I owe you
all of your drinks for the night.

Panos Astithas

unread,
Mar 9, 2017, 3:18:59 AM3/9/17
to Kris Maglione, J. Ryan Stinnett, dev-platform, Firefox Dev, dev-developer-tools
You almost completely resolved the 4-year-old bug 814298, yay! I now wonder
if this makes it easier to improve mochitest debugging per bug 929535.

J. Ryan Stinnett

unread,
Mar 13, 2017, 12:49:20 PM3/13/17
to Panos Astithas, Kris Maglione, dev-platform, Firefox Dev, dev-developer-tools
On Thu, Mar 9, 2017 at 2:18 AM, Panos Astithas <pa...@mozilla.com> wrote:

> You almost completely resolved the 4-year-old bug 814298, yay! I now
> wonder if this makes it easier to improve mochitest debugging per bug
> 929535.


Thanks for the pointers to these bugs.

Bug 814298 stills needs breakpoint persistence to be fully resolved, but
this will hopefully appear soon in the new debugger UI.

For mochitest debugging (bug 929535), this new flag does seem to be
sufficient to allow the tests to run automatically while still debugging,
so I've just landed a fix there.

- Ryan

Gijs Kruitbosch

unread,
Mar 13, 2017, 12:50:53 PM3/13/17
to J. Ryan Stinnett, Panos Astithas, Kris Maglione, dev-platform, dev-developer-tools, Firefox Dev
On 13/03/2017 16:48, J. Ryan Stinnett wrote:
>
> On Thu, Mar 9, 2017 at 2:18 AM, Panos Astithas <pa...@mozilla.com
> <mailto:pa...@mozilla.com>> wrote:
>
> You almost completely resolved the 4-year-old bug 814298, yay! I
> now wonder if this makes it easier to improve mochitest debugging
> per bug 929535.
>
>
> Thanks for the pointers to these bugs.
>
> Bug 814298 stills needs breakpoint persistence to be fully resolved,
> but this will hopefully appear soon in the new debugger UI.
The new debugger UI isn't enabled for chrome debugging, though. What's
blocking that? (And do we support watches in the new debugger UI yet? :-) )

~Gijs

Jared Wein

unread,
Mar 13, 2017, 3:05:46 PM3/13/17
to Gijs Kruitbosch, J. Ryan Stinnett, Kris Maglione, Firefox Dev, dev-platform, dev-developer-tools
Yes, we support watches in the new debugger UI now. The new debugger UI is
used by default in the Browser Content Toolbox, and it is pretty nice and
shiny.

Cheers,
Jared

On Mon, Mar 13, 2017 at 12:50 PM, Gijs Kruitbosch <gijskru...@gmail.com>
wrote:

J. Ryan Stinnett

unread,
Mar 13, 2017, 3:26:31 PM3/13/17
to Jared Wein, Kris Maglione, Gijs Kruitbosch, Firefox Dev, dev-platform, dev-developer-tools
On Mon, Mar 13, 2017 at 2:04 PM, Jared Wein <jw...@mozilla.com> wrote:

> Yes, we support watches in the new debugger UI now. The new debugger UI is
> used by default in the Browser Content Toolbox, and it is pretty nice and
> shiny.


New debugger UI is on for Browser Content Toolbox, but at the moment, it's
still off for Browser Toolbox.

It was disabled for Browser Toolbox ~6 months ago in bug 1300820, but those
issues appear to have been resolved since then.

I filed bug 1346902 to enable it again for Browser Toolbox.

- Ryan
Reply all
Reply to author
Forward
0 new messages