The Debugger client is responsible for managing the communication between the client application and JS server.
- When the server sends a notification to the client, the client receives an "event" and notifies the application via redux actions.
- When the application, wants to send a command to the server, it invokes "commands" in the client.
The Debugger supports a Firefox and a Chrome client, which lets it attach and
debug Firefox, Chrome, and Node contexts. The clients are defined in
src/client and have an onConnect function, and a commands and events
module.
Both clients implement client adapters for translating commands and events into JSON packets. The chrome client debugger adapter is defined in chrome-remote-interface. The Firefox client adapters are defined in two places:
- The launchpad client adapter is maintained in the package devtools-connection.
- The panel client adapter is maintained in devtools-client.js.
The Remote Debugger Protocol specifies the client / server API.
When the client wants to add a breakpoint, it avoids race conditions by doing temporary pauses called interrupts.
We want to do these interrupts transparently, so we've decided that the client should not notify the application that the thread has been paused or resumed.
The chrome debugger protocol is available here. And is maintained in the devtools-protocol repo.