Debugger Architecture: Difference between revisions

Jump to navigation Jump to search
Removed 2 obviously outdated sections. The rest is outdated too, but it makes more sense to keep it and fix it instead.
(mention the remote Web Console)
(Removed 2 obviously outdated sections. The rest is outdated too, but it makes more sense to keep it and fix it instead.)
 
Line 10: Line 10:


Outside of the <tt>server/</tt> directory, we can find 3 separate things. The first is <tt>dbg-client.jsm</tt>, a module for hiding the remote debugging protocol behind an easy to use [https://wiki.mozilla.org/Debugger_Client_API JavaScript API]. The second is <tt>dbg-transport.js</tt>, which contains the low-level code that handles the [https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport protocol connection] for both client and server. And the last thing is <tt>nsIJSInspector</tt>, a native helper component for entering and exiting nested event loops.
Outside of the <tt>server/</tt> directory, we can find 3 separate things. The first is <tt>dbg-client.jsm</tt>, a module for hiding the remote debugging protocol behind an easy to use [https://wiki.mozilla.org/Debugger_Client_API JavaScript API]. The second is <tt>dbg-transport.js</tt>, which contains the low-level code that handles the [https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport protocol connection] for both client and server. And the last thing is <tt>nsIJSInspector</tt>, a native helper component for entering and exiting nested event loops.
== The Debugger UI ==
The client part of the client-server architecture (modulo the <tt>dbg-client.jsm</tt> library) resides in <tt>browser/devtools/debugger</tt>. There we can find the <tt>DebuggerUI.jsm</tt> module that serves as the main entry point from the browser to the Script Debugger, as well as the home for supplementary functions that interface with the rest of the browser (storing preferences, loading files, etc.). The main UI document, <tt>debugger.xul</tt> loads two more scripts, <tt>debugger-controller.js</tt> and <tt>debugger-view.js</tt>: <tt>debugger-controller.js</tt> contains the controller functions, while <tt>debugger-view.js</tt> contains the view functions in a traditional MVC separation. In other words, <tt>debugger-view.js</tt> handles all things visual and <tt>debugger-controller.js</tt> mediates between user actions and protocol messages to control the debugged script.
== The Remote Web Console ==
Closely related to the remote debugger, we have the [https://developer.mozilla.org/en-US/docs/Tools/Web_Console/remoting remote Web Console] project.
The UI is implemented in <tt>browser/devtools/webconsole/</tt>. There you can find <tt>HUDService.jsm</tt> which ties the Web Console UI into the Firefox UI. The actual UI is implemented in the <tt>webconsole.js</tt> script, which loads inside <tt>webconsole.xul</tt>.
The Web Console actors are implemented in <tt>dbg-webconsole-actors.js</tt> which lives in <tt>toolkit/devtools/webconsole</tt>, along with its dependencies.
You can [https://developer.mozilla.org/en-US/docs/Tools/Web_Console/remoting learn more about the remote Web Console on Mozilla Developer Network].
130

edits

Navigation menu