DevTools/Features/Debugger: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 191: Line 191:


=== Execution ===
=== Execution ===
* throw hook (Debug.hooks.throw) - jorendorff
* throw hook (Debug.hooks.throw) - jorendorff - Done.
* error hook (Debug.hooks.error) - jorendorff
* error hook (Debug.hooks.error) - jorendorff
* resume (resumption values - already implemented) - jorendorff
* resume (resumption values) - jorendorff - Done.
* work out low-level stepping support with the JM team - jorendorff/jimb
* work out low-level stepping support with the JM team - jorendorff/jimb
* implement Debug object stepping support (Debug.hooks.interrupt, Debug.Script.prototype.singleStepMode, etc.) - jorendorff
* implement Debug object stepping support (Debug.hooks.interrupt, Debug.Script.prototype.singleStepMode, etc.) - jorendorff
* step into/step out/finish
* step into/step out/finish - dcamp


=== Frame Tree Support ===
=== Frame Tree Support ===

Revision as of 22:58, 16 May 2011

Feature Status ETA Owner
DevTools/Features/Debugger initial remote protocol work+stack trace display) 2011-05-27 Kevin Dangoor

Summary

Initial take on an integrated JavaScript debugger for Firefox.

Team

Have some thoughts on what you want out of a debugger? Inspiration on how to do it? Join us on #devtools on irc.mozilla.org

  • Jim Blandy (irc: jimb): Remote debugging protocol, jsd2.
  • Dave Camp (irc: dcamp): Firefox integration/UI, Remote debugging protocol.
  • Jason Orendorff (irc: jorendorff): jsd2.

Repositories

Related Bugs & Dependencies

See the status page for the bug list and current status.

Designs

DevTools/Features/Debugger/Notes has further implementation notes.

Planning

What follows is some plan-related sketching, please update appropriately. List of milestones/sprints is roughly in order.

Bootstrapping/Stack Traces

  • Working remote protocol, exposing stack frames with JSD2.
  • Relying on debugger statement, no breakpoints.
  • Only "continue" after stopping in debugger.
  • UI shell in firefox
  • UI for stack traces (without arguments)
  • No iframe support just yet.
Description Area Bug Owner Best Likely Worst Status
Debugging global/Root actor registration/Socket Listener Remote Proto dcamp 2d 3d 5d
Browser root actor/tab actors (not as thread-like actors) Browser Proto dcamp 2d 2d 4d
Protocol handler thread (socket transport) Remote Proto dcamp ? ? ?
Debug Object creation and debuggerHook JSD2 jorendorff In jsdbg2 branch.
Debug Object loader JSD2ish dcamp Similar to ctypes loader?
Debug Object support for frame inspection JSD2 jorendorff type, this, older, live, callee, generator, arguments complete.
Debug Object support for the toplevel globals in tab actor - debuggerHook spawning a nested event loop. Browser Proto dcamp 2d 2d 4d
New execution model specification in the remote protocol Remote Proto jimb
debuggerHook and "continue" exposed over remote protocol as specified. Remote Proto dcamp 3d 3d 5d Need to see what new spec looks like...
Client JS API (socket transport) UI Shell dcamp 1d 2d 3d
HTML UI shell per tab, in its own window UI Shell dcamp 2d 2d 5d
UI responding to pauses (from debugger keyword) Execution Handling dcamp 2d 2d 4d
HTML Stack frame viewer (no locals/environment yet, just Execution Handling dcamp 2d 3d 5d

Source Viewer

  • Enough to visualize current line/stack frames/etc.
    • Debug.Script.prototype.{url,startLine,length,getAllOffsets,getLineOffsets,getOffsetLine} - jorendorff
    • Debug.Frame.prototype.{callee,script,offset} - jorendorff
  • No source list yet, will only reflect sources handed to it in pause states.
  • Can use normal view source/firebug method (loading from necko preferring the cache) for getting static script sources (in-document <script> etc).
  • Needs the engine to provide sources for exotic script sources (eval/appendNode/etc.)
  • Very simple source viewer, improving the source viewer can happen outside the critical path.

Execution

  • throw hook (Debug.hooks.throw) - jorendorff - Done.
  • error hook (Debug.hooks.error) - jorendorff
  • resume (resumption values) - jorendorff - Done.
  • work out low-level stepping support with the JM team - jorendorff/jimb
  • implement Debug object stepping support (Debug.hooks.interrupt, Debug.Script.prototype.singleStepMode, etc.) - jorendorff
  • step into/step out/finish - dcamp

Frame Tree Support

  • Debug.prototype.{add,remove}Debuggee() - jorendorff
  • Frame tree support in the tab actors.

Environment/Property Viewer

  • JSD2 support:
    • Debug.Object.prototype.{prototype,class,isFunction,name, getOwnPropertyDescriptor,getOwnPropertyNames,decompile} - jorendorff
    • Debug.Frame.prototype.environment - jorendorff
    • Debug.Environment.prototype.{type,outerEnvironment,object, boundIdentifiers,getVariableDescriptor,findBinding} - jorendorff
  • Protocol Support (actors for environments and objects)
    • Pause-lifetime grips.
    • Thread-lifetime grip promotion? Maybe can wait?
  • UI panel - simple tree view for objects?

By the time this milestone is complete, we'll have a somewhat competent debugger if you're willing to use debugger; statements instead of breakpoints.

Source Selector

  • JSD2 support
    • newScript hook
    • enumerate scripts? Maybe not - since we need currently need to reload anyway to recompile scripts for debugging, might be ok to always just watch the newScript hook.
  • Protocol support
    • new script notification.
  • UI support: dropdown of available scripts, triggering loads in the source viewer.

Breakpoints

  • JSD2 support.
  • Protocol-side breakpoints will set physical breakpoints at each script (including newly-added scripts)
  • Need to work out breakpoint persistence across reloads (needs to be done early enough to catch scripts run during the load).
  • Set breakpoints in the source gutter
  • Set breakpoints from a command line (?)
  • Disable/Enable/Delete breakpoints

More Milestones

In no particular order...

  • Web Worker debugging (might not be needed for an initial release, but would be really nice)
  • Chrome debugging (probably not be needed for an initial release)

Floating Tasks

Here are a few tasks that I haven't slotted into any specific milestone, and could be tackled separately alongside the other milestones. At least some of these would block a final release of a capable debugger.


Description Area Bug Owner Best Likely Worst Status
E10S content process support Remote Proto dcamp? 1w 3w 2w
Improved script origin information JSD2 bug 637572 jimb
Waive slow script dialog (jorendorff was seeing them after resuming) JSD2
Improve source viewer (after basic source viewer is added) Firefox UI No Owner