DevTools/Features/Debugger: Difference between revisions

no edit summary
(Stack trace notes.)
No edit summary
 
(127 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{FeatureStatus
|Feature name=Debugger
|Feature stage=Complete
|Feature status=In progress
|Feature version=Firefox 15
|Feature health=OK
}}
{{FeatureTeam
|Feature product manager=Kevin Dangoor
|Feature feature manager=Rob Campbell
|Feature lead engineer=Panos Astithas
|Feature security lead=Mark Goodwin
|Feature qa lead=Ioana Budnar
|Feature ux lead=Stephen Horlander
|Feature additional members=Jason Orendorff, Jim Blandy, Victor Porof, Mihai Sucan
}}
{{FeaturePageBody
|Feature overview=New JavaScript debugger.
|Feature users and use cases=JavaScript developers
}}
{{FeatureInfo
|Feature priority=P1
|Feature rank=6
|Feature roadmap=Developer Tools
|Feature list=Desktop
|Feature engineering team=DevTools
}}
{{FeatureTeamStatus
|Feature security status=sec-review-complete
|Feature security health=OK
|Feature security notes=[[Security/Reviews/Firefox/RemoteDebug|Notes]]
|Feature qa status=work in progress
|Feature qa notes=[https://wiki.mozilla.org/index.php?title=DevTools/Features/Debugger/TestPlan Test Plan]
}}
== Designs ==
* [[JSInspector]]
* [[Remote_Debugging_Protocol]]
* [[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.
{| class="fullwidth-table"
{| class="fullwidth-table"
|-
|-
| style="font-weight: bold; background: #DDD;" | Feature
| style="font-weight: bold; background: #DDD;" | Description
| style="font-weight: bold; background: #DDD;" | Area
| style="font-weight: bold; background: #DDD;" | Bug
| style="font-weight: bold; background: #DDD;" | Owner
| style="font-weight: bold; background: #DDD;" | Best
| style="font-weight: bold; background: #DDD;" | Likely
| style="font-weight: bold; background: #DDD;" | Worst
| style="font-weight: bold; background: #DDD;" | Status
| style="font-weight: bold; background: #DDD;" | Status
| style="font-weight: bold; background: #DDD;" | ETA
| style="font-weight: bold; background: #DDD;" | Owner
|-
|-
<section begin="status" />
| Debugging global/Root actor registration/Socket Listener
| [[DevTools/Features/Debugger]]
| Remote Proto
| {{StatusHealthy|status=planning}}
|
| YYYY-MM-DD
| dcamp
| Kevin Dangoor
| 2d
<section end="status" />
| 3d
| 5d
| In remote-debug.
|-
| Browser root actor/tab actors (not as thread-like actors)
| Browser Proto
|
| dcamp
| 2d
| 2d
| 4d
| In remote-debug.
|-
| Protocol handler thread (socket transport)
| Remote Proto
|
| dcamp
| ?
| ?
| ?
| Put off for now.
|-
| Debug Object creation and debuggerHook
| JSD2
|
| jorendorff
| 1d
| 1d
| 2d
| In jsdb2
|-
| Debug Object loader
| JSD2ish
|
| dcamp
|
|
|
| In remote-debug
|-
| 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
| In remote-debug
|-
| New execution model specification in the remote protocol
| Remote Proto
|
| jimb
|
|
|
| Complete
|-
| debuggerHook and "continue" exposed over remote protocol as specified.
| Remote Proto
|
| dcamp
| 3d
| 3d
| 5d
| In remote-debug.
|-
| Client JS API (socket transport)
| UI Shell
|
| dcamp
| 1d
| 2d
| 3d
| In remote-debug.
|-
| HTML UI shell per tab, in its own window
| UI Shell
|
| dcamp
| 2d
| 2d
| 5d
| In remote-debug
|-
| UI responding to pauses (from debugger keyword)
| Execution Handling
|
| dcamp
| 2d
| 2d
| 4d
| In remote-debug
|-
|-
| HTML Stack frame viewer (no locals/environment yet, just
| Execution Handling
|
| dcamp
| 2d
| 3d
| 5d
| In patch queue
|}
|}


== Summary ==
=== Property Viewer ===


Initial take on an integrated JavaScript debugger for Firefox.
* A simple property viewer, limited to viewing frame arguments for now.


== Team ==
{| class="fullwidth-table"
|-
| style="font-weight: bold; background: #DDD;" | Description
| style="font-weight: bold; background: #DDD;" | Area
| style="font-weight: bold; background: #DDD;" | Bug
| style="font-weight: bold; background: #DDD;" | Owner
| style="font-weight: bold; background: #DDD;" | Best
| style="font-weight: bold; background: #DDD;" | Likely
| style="font-weight: bold; background: #DDD;" | Worst
| style="font-weight: bold; background: #DDD;" | Status
|-
| Debug.Object.prototype.{proto, class, isFunction, name, getOwnPropertyDescriptor, getOwnPropertyNames}
| JSD2
|
| jorendorff/jimb
|
|
|
|
|-
| Primitive data grips for frame arguments
| Remote Proto
|
| dcamp
| 1d
| 1d
| 2d
| In remote-debug
|-
| Pause-lifetime object grips
| Remote Proto
|
| dcamp
| 1d
| 1d
| 2d
| In remote-debug
|-
| Thread-lifetime grip promotion
| Remote Proto
|
| dcamp
| 1d
| 2d
| 4d
| In remote-debug
|-
| Object grip enumeration
| Remote Proto
|
| dcamp
| 1d
| 2d
| 4d
| Waiting on jsd2
|-
| Property UI design
| UI
|
| past/dcamp
| 1d
| 1d
| 2d
|
|-
| Property Inspector UI
| UI
|
| past
| ?
| ?
| ?
| Split up as needed.
|}


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
=== 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


* '''Feature Manager''': Kevin Dangoor (irc: kdangoor)
In this timeframe, we also want to be able to:
* '''Lead Developer''': Dave Camp (irc: dcamp)
* Show native calls on the stack - jorendorff, luke
* '''Product Manager''': Kevin Dangoor (irc: kdangoor)
* Show debugger frames on the stack - jorendorff
* '''QA''': TBD
* '''UX''': TBD
* '''Security''': TBD


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


== Release Requirements ==
=== Environment/Property Viewer ===


TBD
* JSD2 support
** Debug.Frame.prototype.environment - jorendorff
** Debug.Environment.prototype.{type,outerEnvironment,object, boundIdentifiers,getVariableDescriptor,findBinding} - jorendorff


== Next Steps ==
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.


* scope out the project
=== Source Selector ===


== Related Bugs & Dependencies ==
* 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.


See the [http://mozilla.github.com/devtools/2011/status.html#debugger status page] for the bug list and current status.
* UI support: dropdown of available scripts, triggering loads in the source viewer.


== Designs ==
=== Breakpoints ===


TBD
* 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


== Planning ==
=== More Milestones ===


What follows is some plan-related sketching, please update appropriately.
In no particular order...


== Basic Protocol Support ==
* 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)


Basic implementation of the [[Remote Debugging Protocol]].
=== Floating Tasks ===


=== Protocol Transports ===
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.
* Simple TCP socket protocol - Needed for remote debugging.
* Shouldn't need sockets for in-process debugging, can probably just post events directly to/from the handler thread.
* Need to figure out transport between chrome/content for e10s (See inter-process dispatch, below).
* WebSockets (not needed for an initial implementation).


=== Protocol Handler Thread ===
* Handles incoming protocol requests on a thread, needed to interrupt running script on other threads.
* Will handle transport IO as needed (for socket/websocket/etc transports).
* Handle inter-thread dispatching
** Dispatching incoming protocol messages to actors on the proper thread.
** An actor's parent or child might be on a different thread (for example when a browser tab actor might have a WebWorker actor as a child).  Releasing a parent actor needs to release children, including on the other threads.
* Handle inter-process dispatching
** Similar issues to inter-thread dispatch, but communicating to content processes using the debugging protocol.
=== Actor registration API ===
* Including maintenance of the actor tree.
=== Client API ===
* With appropriate client-side transport support.
=== Debugging compartments ===
* The debugger must be in a separate compartment from the debuggee, some sort of sandbox/new global-and-compartment for hosting a given thread's debugging actors.
== Browser Protocol Integration ==
Firefox-specific integration of the remote protocol.
=== Root Actor ===
=== Content Tab Contexts ===
* Will need to maintain a list of compartments needing debugging for the document tree loaded in the tab.
* Manage lifetimes and notifications related to navigation.
* Tabs exposed as a thread-like actor (or maybe with an immediate child for the main thread running in that tab?)
=== Chrome Context ===
* For debugging firefox.
=== WebWorker/ChromeWorker ===
* Related to inter-thread dispatch above.  Likely to require some platform work on webworkers to get them to load the debug protocol implementation on startup?
== Stack Traces ==
=== JSD2 support ===
* [[Debug_Object#Debug.Frame]]
=== Remote Protocol Support ===
* [[Remote_Debugging_Protocol#Listing_Stack_Frames]]
=== UI Notes: Other Debuggers ===
* Firebug
** Stack frame shows function name/source/line num, args
** Expand frames to view function args
** Selecting stack frame moves source view
** Right-clicking stack frames allowed viewing properties of function objects in the DOM tab.
** Breadcrumb view of the stack in the source view.
* Chrome
** Stack frame shows function name/source/line
** Scope variables/environment in a different pane (see Environments)
** Selecting stack frame moves source view
=== UI Plan ===


{| class="fullwidth-table"
|-
| style="font-weight: bold; background: #DDD;" | Description
| style="font-weight: bold; background: #DDD;" | Area
| style="font-weight: bold; background: #DDD;" | Bug
| style="font-weight: bold; background: #DDD;" | Owner
| style="font-weight: bold; background: #DDD;" | Best
| style="font-weight: bold; background: #DDD;" | Likely
| style="font-weight: bold; background: #DDD;" | Worst
| style="font-weight: bold; background: #DDD;" | 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
|
|
|
|
|}
__NOTOC__
__NOTOC__
[[Category:Features]]
[[Category:Firefox]]
canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,093

edits