Skip to main content
Jump to: navigation, search

Difference between revisions of "JSDT/Debug/Rhino"

< JSDT‎ | Debug
(Rhino Debug Wire Protocol)
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{JSDT-Debug}}
 
{{JSDT-Debug}}
= Overview =
+
== Overview ==
  
 
Support for the Rhino JavaScript interpreter is available in the JSDT feature and is provided to allow local and remote debugging of JavaScript using Rhino.
 
Support for the Rhino JavaScript interpreter is available in the JSDT feature and is provided to allow local and remote debugging of JavaScript using Rhino.
Line 6: Line 6:
 
The bundles provided by JSDT debug for the Rhino support include:
 
The bundles provided by JSDT debug for the Rhino support include:
  
*<code>org.eclipse.wst.jsdt.debug.rhino</code> - the core Rhino implementation, provides the Rhino-specific implementation of [[JSDT/Debug/JavaScript Debug Interface|JSDI]]
+
*[http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.debug.rhino/?root=WebTools_Project org.eclipse.wst.jsdt.debug.rhino] - the core Rhino implementation, provides the Rhino-specific implementation of [[JSDT/Debug/JavaScript Debug Interface|JSDI]]
*<code>org.eclipse.wst.jsdt.debug.rhino.ui</code> - the Rhino-specific user interface bits
+
*[http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.debug.rhino.debugger/?root=WebTools_Project org.eclipse.wst.jsdt.debug.rhino.debugger] - the Rhino debugger that can be embedded in a server for remote debugging
*<code>org.eclipse.wst.jsdt.debug.rhino.debugger</code> - the Rhino debugger that can be embedded in a server for remote debugging
+
*[http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jsdt/tests/org.eclipse.wst.jsdt.debug.rhino.tests/?root=WebTools_Project org.eclipse.wst.jsdt.debug.rhino.tests] - contains Rhino specific tests
 +
*[http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.debug.rhino.ui/?root=WebTools_Project org.eclipse.wst.jsdt.debug.rhino.ui] - the Rhino-specific user interface bits
  
= Local Rhino Debugging =
+
== Local Rhino Debugging ==
 
New to 1.3 is the ability to locally launch and debug JavaScript file(s) using Rhino. This new launching support includes context-sensitive launching from the platform and automatic source / script path updating.
 
New to 1.3 is the ability to locally launch and debug JavaScript file(s) using Rhino. This new launching support includes context-sensitive launching from the platform and automatic source / script path updating.
  
 
The related New and Noteworthy entry is [http://www.eclipse.org/webtools/development/news/3.3M2/sourceediting.php here].
 
The related New and Noteworthy entry is [http://www.eclipse.org/webtools/development/news/3.3M2/sourceediting.php here].
  
== Launch Options ==
+
The details about using and setting up local Rhino debugging can be found on [[JSDT/Debug/Rhino/Local Rhino Debugging|this page]].
  
The options on the '''Main''' tab allow you to specify the script you want to debug and the parameters use to configure the Rhino interpreter. The default options
+
== Embedding the Rhino Debugger ==
specified for a new configuration will provide you with the most general debugging experience, but you can tailor how the interpreter runs to reproduce specific scenarios.
+
  
There are a few options for Rhino which are as follows:
+
One of the more powerful usages of the Rhino debug support is that it can easily be embedded into your existing server. Embedding
 +
the Rhino Debugger allows you to remotely debug the loading and execution of scripts from the Eclipse IDE.
  
;<code>Script</code> : The script option is required and points to the JavaScript file in you workspace that you wish to debug. The file is checked for existence, so a manually entered path will be validated
+
To learn how to embed the Rhino Debugger please go to [[JSDT/Debug/Rhino/Embedding_Rhino_Debugger|this page]].
;<code>ECMA script version to interpret with</code> : This option allows you to set the ECMA compliance level that Rhino will interpret the script using. For more information on how Rhino uses this option see [https://developer.mozilla.org/en/Rhino_Shell this link] about the option to Rhino and [https://developer.mozilla.org/en/Rhino/Overview#JavaScript_Language_Versions this link] about JavaScript language levels.
+
;<code>Rhino optimization level</code> : Rhino can make certain optimizations when it interprets the script. To find out more about what each optimization means / does check [https://developer.mozilla.org/en/Rhino/Optimization this link].
+
;<code>Strict mode</code> : This option puts Rhino in strict mode. When in strict mode Rhino will treat some warnings as errors and will report all warnings. It can be a challenge to debug scripts in strict mode, as many more problems are found, most of which terminate interpreting the script.
+
;<code>Log interpreter exceptions</code> : In certain cases, usually a fatal problem from the interpreter, exceptions will be thrown from Rhino. This option allows them to be forwarded to the Eclipse error log.
+
  
<gallery widths="340px" heights="260px" perrow="1">
+
== Rhino Debug Console ==
Image:Local_rhino_main.png|The main tab for a local Rhino launch configuration
+
</gallery>
+
 
+
== Include Paths ==
+
 
+
The '''Include''' tab for a Rhino configuration allows you to quickly and easily add additional scripts to be run before the main script.
+
 
+
You have the option to add one or more scripts from the workspace or from the local or extended file system.
+
 
+
Using the '''Up''' and '''Down''' buttons you can place the scripts in the order you would like them to be run. The script at the top of the listing will be run first. You can also use the '''Remove''' button to remove the selected included scripts from the listing.
+
 
+
Any scripts that are added to the include path also have their containing folder automatically added to the source lookup path. For example if you added the script <code>/home/user/myscript.js</code> to the include path, the folder entry for <code>/home/user/</code> would be added to the source lookup path for you automatically.
+
 
+
<gallery widths="340px" heights="260px" perrow="1">
+
Image:Local_rhino_include.png|The include tab for a local Rhino launch configuration
+
</gallery>
+
 
+
== Source Lookup ==
+
 
+
The '''Source''' tab allows you to customize where the launch will look for your source. This tab is automatically updated to track the script specified on the '''Main''' tab as well as entries on the '''Include''' tab.
+
 
+
Any automatically added entries can be changed / removed as you like and and new entries can be added from one of the following locations:
+
*Archive
+
*External Archive
+
*File System Directory
+
*Java Classpath Variable
+
*Java Library
+
*Java Project
+
*Project
+
*Working Set
+
*Workspace
+
*Workspace Folder
+
 
+
To modify the source lookup path simply use the '''Add...''', '''Remove...''' or '''Edit...''' buttons. The <code>Default</code> project source lookup entry cannot be modified, as it it directly tied to the script specified on the '''Main''' tab. But you can modify and edit any child entries of the <code>Default</code> project entry.
+
 
+
<gallery widths="340px" heights="260px" perrow="1">
+
Image:Local_rhino_source.png|The source tab for a local Rhino launch configuration
+
</gallery>
+
 
+
= Embedding the Rhino Debugger =
+
 
+
One of the more powerful usages of the Rhino debug support is that it can easily be embedded into your existing server. Embedding
+
the Rhino Debugger allows you to remotely debug the loading and execution of scripts from the Eclipse IDE.
+
  
To learn how to embed the Rhino Debugger please go to [[JSDT/Debug/Embedding_Rhino_Debugger|this page]].
+
Launching the Rhino debugger with the Rhino console available is a very powerful tool that allows developers to perform many operations, one notable operation
 +
is loading scripts on demand. [[JSDT/Debug/Rhino/Using_Rhino_Console|This page]] describes how to launch with the Rhino console and some common usage scenarios.
  
= Rhino Debug Wire Protocol =
+
== Rhino Debug Wire Protocol ==
  
 
To provide support for the Rhino interpreter, we had to create both sides of the coin - the debugger and the client. To facilitate communication between the debugger and the client we created an adapted version of v8 (JSON-based) packet communication.  
 
To provide support for the Rhino interpreter, we had to create both sides of the coin - the debugger and the client. To facilitate communication between the debugger and the client we created an adapted version of v8 (JSON-based) packet communication.  
  
The complete specification for the [[JSDT/Debug/Rhino_Debug_Wire_Protocol|RDWP]] can be found [[JSDT/Debug/Rhino_Debug_Wire_Protocol|here]].
+
The complete specification for the [[JSDT/Debug/Rhino/Rhino_Debug_Wire_Protocol|RDWP]] can be found [[JSDT/Debug/Rhino/Rhino_Debug_Wire_Protocol|here]].

Latest revision as of 20:44, 14 January 2011

JSDT Debug
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse SourceProject Set File

Overview

Support for the Rhino JavaScript interpreter is available in the JSDT feature and is provided to allow local and remote debugging of JavaScript using Rhino.

The bundles provided by JSDT debug for the Rhino support include:

Local Rhino Debugging

New to 1.3 is the ability to locally launch and debug JavaScript file(s) using Rhino. This new launching support includes context-sensitive launching from the platform and automatic source / script path updating.

The related New and Noteworthy entry is here.

The details about using and setting up local Rhino debugging can be found on this page.

Embedding the Rhino Debugger

One of the more powerful usages of the Rhino debug support is that it can easily be embedded into your existing server. Embedding the Rhino Debugger allows you to remotely debug the loading and execution of scripts from the Eclipse IDE.

To learn how to embed the Rhino Debugger please go to this page.

Rhino Debug Console

Launching the Rhino debugger with the Rhino console available is a very powerful tool that allows developers to perform many operations, one notable operation is loading scripts on demand. This page describes how to launch with the Rhino console and some common usage scenarios.

Rhino Debug Wire Protocol

To provide support for the Rhino interpreter, we had to create both sides of the coin - the debugger and the client. To facilitate communication between the debugger and the client we created an adapted version of v8 (JSON-based) packet communication.

The complete specification for the RDWP can be found here.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.