DevTools/Features/Debugger: Difference between revisions
Jump to navigation
Jump to search
(Some execution thoughts) |
(Breakpoints...) |
||
Line 180: | Line 180: | ||
** Has Rerun/Continue/Step Into/Step Over/Step Out (finish) | ** Has Rerun/Continue/Step Into/Step Over/Step Out (finish) | ||
** Calls pause Break-on-next (makes a bit more sense when spinning the event loop, and it can't actually pause?). | ** Calls pause Break-on-next (makes a bit more sense when spinning the event loop, and it can't actually pause?). | ||
== Breakpoints == | |||
=== JSD2 === | |||
[[Debug_Object#The_Debug_Object]] | |||
* setBreakpoint/clearBreakpoint/clearAllBreakpoints | |||
* Not implemented. | |||
=== Protocol Support === | |||
[[Remote_Debugging_Protocol#Breakpoints]] | |||
* Not implemented. | |||
* Looks like the protocol implementation will need to refcount breakpoints on the debug object (which has one-breakpoint-per-line) to support multiple breakpoints on a given line (potentially with different conditions). | |||
* The protocol will also aggregate breakpoints on multiple scripts (for example, if the same script is loaded twice, there might be two scripts covering the same source location) for a given breakpoint actor. | |||
* Protocol should be extended with breakpoint conditions? | |||
=== UI === | |||
Not implemented. | |||
=== UI Notes === | |||
XXX | |||
== Watchpoints == | |||
No thoughts yet. | |||
__NOTOC__ | __NOTOC__ |
Revision as of 01:37, 6 May 2011
Feature | Status | ETA | Owner |
DevTools/Features/Debugger | planning | YYYY-MM-DD | 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
- Feature Manager: Kevin Dangoor (irc: kdangoor)
- Lead Developer: Dave Camp (irc: dcamp)
- Product Manager: Kevin Dangoor (irc: kdangoor)
- QA: TBD
- UX: TBD
- Security: TBD
Release Requirements
TBD
Next Steps
- scope out the project
Related Bugs & Dependencies
See the status page for the bug list and current status.
Designs
TBD
Planning
What follows is some plan-related sketching, please update appropriately.
Basic Protocol Support
Basic implementation of the Remote Debugging Protocol.
Protocol Transports
- 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
- Mostly (?) implemented in jsdbg2 branch.
Remote Protocol Support
- Remote_Debugging_Protocol#Listing_Stack_Frames
- Not implemented.
UI
- Not implemented.
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
Lexical Environments
JSD2
- Debug_Object#Debug.Environment
- Not implemented.
Remote Protocol Support
- Remote_Debugging_Protocol#Lexical_Environments
- Not implemented.
UI
Not implemented.
UI Notes: Other Debuggers
- Firebug:
- XXX: I couldn't find where/if firebug exposes lexical scopes.
- Chrome:
- Scope chain exposed as a list, property viewers for each scope.
Execution Control
JSD2
- Debug_Object#Resumption_Values
- Debug_Object#Debug.Script (specifically "singleStepMode")
- Not implemented?
Remote Protocol Support
- Remote_Debugging_Protocol#Interacting_with_Thread-Like_Actors
- jimb mentioned on irc being unhappy with the pause/resume protocol, may need another spec iteration.
- Not implemented.
Implementation Notes
(this is a mess, ignore for now).
Pause Reasons:
- stepped
- pre-call
- pre-return
- pre-eval?
Breaking on exception:
- pre-throw/caught/uncaught
UI
Not implemented.
UI Notes
- Chrome
- Allows toggling of throw/caught/uncaught pause reasons during execution.
- Pause/Continue/Step Over/Step Into/Step Out (finish)
- Firebug
- Has Rerun/Continue/Step Into/Step Over/Step Out (finish)
- Calls pause Break-on-next (makes a bit more sense when spinning the event loop, and it can't actually pause?).
Breakpoints
JSD2
- setBreakpoint/clearBreakpoint/clearAllBreakpoints
- Not implemented.
Protocol Support
Remote_Debugging_Protocol#Breakpoints
- Not implemented.
- Looks like the protocol implementation will need to refcount breakpoints on the debug object (which has one-breakpoint-per-line) to support multiple breakpoints on a given line (potentially with different conditions).
- The protocol will also aggregate breakpoints on multiple scripts (for example, if the same script is loaded twice, there might be two scripts covering the same source location) for a given breakpoint actor.
- Protocol should be extended with breakpoint conditions?
UI
Not implemented.
UI Notes
XXX
Watchpoints
No thoughts yet.