Script Panel Refactoring

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
m (moved Script Panel Remoting to Script Panel Refactoring: It's not just about remoting)
(Added known JSD2 functions related to our requirements)
Line 1: Line 1:
-
This page summarizes support for remote JS debugging in Firebug (based on JSD2).
+
This page summarizes refactoring the Firebug debugger to use JSD2 and adding support for remote JavaScript debugging. [http://code.google.com/p/fbug/issues/detail?id=5421 Issue 5421] tracks the actual changes done.
== Goals ==
== Goals ==
* Adopt JSD2 (get rid of all JSD1 APIs)
* Adopt JSD2 (get rid of all JSD1 APIs)
-
* Support Remote Debugging
+
* Support remote debugging
== JSD2 API Requirements ==
== JSD2 API Requirements ==
-
The following list summarizes list of high-level features that Firebug needs to support. It should be verified that all the features can re-implemented on top of JSD2 before starting the refactoring.
+
The following list summarizes the high-level features that Firebug needs to support. It should be verified that all the features can re-implemented on top of JSD2 before starting the refactoring.
-
* List of scripts available on selected tab (including static, events and evaluated scripts) including iframes
+
* List of scripts available on selected tab (including static, events and evaluated scripts) including iframes &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger#findScripts%28%29 Debugger.findScripts()]</code>
-
* Stepping (into, over, out, resume, current line)  
+
* Stepping (into, over, out, resume, current line)
-
* Support for <code>debugger;</code> keyword
+
* Support for <code>debugger;</code> keyword &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger#onDebuggerStatement%28%29 Debugger.onDebuggerStatement()]</code>
-
* Support for breakpoints (add, remove, enable, disabled, conditional, list of existing breakpoints)
+
* Support for breakpoints (add, remove, enable, disabled, conditional, list of existing breakpoints) &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger.Script#Methods Debugger.Script methods]</code>
* Recognize executable lines
* Recognize executable lines
-
* Dynamic eval in a frame (used e.g. by the Watch panel when the debugger is halted)
+
* Dynamic eval in a frame (used e.g. by the [[Watch Side Panel]] when the debugger is halted) &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger.Frame#eval%28%29 Debugger.Frame.eval()]</code> and <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger.Frame#evalWithBindings%28%29 Debugger.Frame.evalWithBindings()]</code>
-
* Get stack frames (including passed arguments)
+
* Get stack frames (including passed arguments) &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger#getNewestFrame%28%29 Debugger.getNewestFrame()]</code> and <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger.Frame#Accessor_properties Debugger.Frame.older]</code>
-
* Scope chain variable exploring (with & closure scopes). It should be possible to see all values.
+
* Scope chain variable exploring (with & closure scopes). It should be possible to see all values. &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger.Frame#Accessor_properties Debugger.Frame.environment]</code>
* Break on next call
* Break on next call
* Profiling (was part of JSD1)
* Profiling (was part of JSD1)
-
* Tracking (break on) throw/catch/error
+
* Tracking (break on) throw/catch/error &rarr; <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger#onThrow%28%29 Debugger.onThrow()]</code> and <code>[https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger#onError%28%29 Debugger.onError()]</code>
* Tracking (monitoring) function calls
* Tracking (monitoring) function calls
* Freezing page UI if debugger is halted (including timeouts, intervals and worker threads)
* Freezing page UI if debugger is halted (including timeouts, intervals and worker threads)
Line 24: Line 24:
=== Not Ready in JSD2 ===
=== Not Ready in JSD2 ===
* There is not source for evals.
* There is not source for evals.
-
* new Function scripts?
+
* [https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference/Debugger#onNewScript%28%29 new Function scripts?]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=676586 Meta bug]: Implement a script Debugger
* [https://bugzilla.mozilla.org/show_bug.cgi?id=676586 Meta bug]: Implement a script Debugger
** As soon as this one is fixed
** As soon as this one is fixed
-
** Profiling is unrelated to JSD2. What it the plan here?
+
** Profiling is unrelated to JSD2. What is the plan here?
-
** Tracking (break on) throw/catch/error, also what is that plan?
+
** Tracking (break on) throw/catch/error; also what is the plan?
== Script Panel Architecture ==
== Script Panel Architecture ==
-
The Script panel needs to be built on top of JSD2, remote protocol and Firebug remote architecture. Remoting is already supported by [HTTP Monitor] and both components should share the same approaches and API
+
The Script panel needs to be built on top of JSD2, remote protocol and Firebug remote architecture. Remoting is already supported by [[HTTP Monitor]] and both components should share the same approaches and API.
TBD
TBD
Line 37: Line 37:
== Resources ==
== Resources ==
* [https://wiki.mozilla.org/Debugger Debugger]
* [https://wiki.mozilla.org/Debugger Debugger]
 +
* [https://wiki.mozilla.org/Debugger_Client_API Debugger Client API]
* [https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Guide JS Debugger API Guide]
* [https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Guide JS Debugger API Guide]
* [https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference JS Debugger API Reference]
* [https://developer.mozilla.org/en/SpiderMonkey/JS_Debugger_API_Reference JS Debugger API Reference]
* [https://wiki.mozilla.org/DevTools/Features/Debugger DevTools Debugger]
* [https://wiki.mozilla.org/DevTools/Features/Debugger DevTools Debugger]
* [https://wiki.mozilla.org/Remote_Debugging_Protocol Remote Debugging Protocol]
* [https://wiki.mozilla.org/Remote_Debugging_Protocol Remote Debugging Protocol]

Revision as of 23:12, 19 May 2012

This page summarizes refactoring the Firebug debugger to use JSD2 and adding support for remote JavaScript debugging. Issue 5421 tracks the actual changes done.

Contents

Goals

  • Adopt JSD2 (get rid of all JSD1 APIs)
  • Support remote debugging

JSD2 API Requirements

The following list summarizes the high-level features that Firebug needs to support. It should be verified that all the features can re-implemented on top of JSD2 before starting the refactoring.

Not Ready in JSD2

  • There is not source for evals.
  • new Function scripts?
  • Meta bug: Implement a script Debugger
    • As soon as this one is fixed
    • Profiling is unrelated to JSD2. What is the plan here?
    • Tracking (break on) throw/catch/error; also what is the plan?

Script Panel Architecture

The Script panel needs to be built on top of JSD2, remote protocol and Firebug remote architecture. Remoting is already supported by HTTP Monitor and both components should share the same approaches and API.

TBD

Resources

Personal tools