Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Documentation/Developer Guide/Debugger"

(Add setup instructions)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
= Development Setup =  
 
= Development Setup =  
  
Since this code is so new at the moment, you need to do a cherry pick from the gerrit patch on top of the existing Orion node server code.
+
The code is in master!!
  
 
Instructions to follow!
 
Instructions to follow!
  
* Get code
+
* Go to '''ORION_PATH/modules/orionode''' and run '''npm install'''
    * You need Node.js v4.4.6+ to run Orion node server
+
    * Checkout Orion client code (See https://wiki.eclipse.org/Orion/Getting_the_source)
+
    * Go to https://git.eclipse.org/r/#/c/93161/
+
    * Find "Download" at the top right corner and apply this patch to your Orion code
+
* Go to ```ORION_PATH/modules/orionode``` and run ```npm install```
+
 
* (optional) Configure debug adapters
 
* (optional) Configure debug adapters
    * By default, node, python, java and lldb adapters are configured
+
# By default, node, python, java and lldb adapters are configured
    * If you don't need more or less adapters, you can skip this part
+
# If you don't need more or less adapters, you can skip this part
    * Open ```ORION_PATH/modules/orionode.debug.server/adapters.json```
+
# Open '''ORION_PATH/modules/orionode.debug.server/adapters.json'''
    * Add new adapters in this json file. You can find available adapters and their git repositories in VSCode marketplace by searching "debugger"
+
# Add new adapters in this json file. You can find available adapters and their git repositories in VSCode marketplace by searching "debugger"
 
* Enable debug server
 
* Enable debug server
    * Go to ```ORION_PATH/modules/orionode.debug.server```
+
# Go to '''ORION_PATH/modules/orionode.debug.server'''
    * Run ```npm install```
+
# Run '''npm install'''
* Enable debug UI
+
    * Go to ```ORION_PATH/bundles/org.eclipse.orion.client.ui/web/defaults.pref```
+
    * Add ```"debug/plugins/debugPlugin.html": true```
+
 
* Run Orion node server
 
* Run Orion node server
    * Go to ```ORION_PATH/modules/orionode```
+
# Edit '''ORION_PATH/modules/orionode/orion.conf'''
    * Run ```node server.js```
+
# Set '''orion.debug.enabled''' to true
 +
# Set '''debug.server.module''' to '''../orionode.debug.server''' (by default it's there already)
 +
# Edit '''ORION_PATH/bundles/org.eclipse.orion.client.ui/web/defaults.pref'''
 +
# Add '''"/general/settings":{"generalSettings": {"enableDebuggerVisible": true}}'''
 +
# Go to '''ORION_PATH/modules/orionode'''
 +
# Run '''npm install'''
 +
# Run '''node server.js'''
 +
* Enable debug frontend
 +
# Open http://localhost:8081 (or other port you are listening to)
 +
# Go to settings page by clicking the gear button on the left
 +
# Go to general settings
 +
# Enable debugger
 
* Create a sample program
 
* Create a sample program
    * Open http://localhost:8081 (or other port you are listening to)
+
# Open http://localhost:8081 (or other port you are listening to)
    * Create a new folder at the root of your workspace
+
# Create a new folder at the root of your workspace
    * Create a new file called ```server.js``` in this new folder
+
# Create a new file called '''server.js''' in this new folder
    * Type in ```console.log('Hello World!');```
+
# Type in '''console.log('Hello World!');'''
    * Click the run bar at the top, and click "+Native"
+
# Click the run bar at the top, and click "+Native"
    * Change "Debug Adapter Type" to "node"
+
# Change "Debug Adapter Type" to "node"
    * Click "Select a Template" and select "Default"
+
# Click "Select a Template" and select "Default"
    * Press "Save"
+
# Press "Save"
    * Click the play button in the run bar
+
# Click the play button in the run bar
    * Now you can see the debug UI and the output from the hello world program
+
# Now you can see the debug UI and the output from the hello world program
 
* More tips
 
* More tips
    * Double click a line number to add or remove a breakpoint
+
# Double click a line number to add or remove a breakpoint
    * Hold alt and double click a line number to add or remove a conditional breakpoint, although some debug adapters don't support conditional breakpoints
+
# Hold alt and double click a line number to add or remove a conditional breakpoint, although some debug adapters don't support conditional breakpoints
    * Third-party adapters might not work as good as adapters like node
+
# Third-party adapters might not work as good as adapters like node
 +
 
 +
[[Category:Orion]]

Latest revision as of 09:02, 20 September 2017

Development Setup

The code is in master!!

Instructions to follow!

  • Go to ORION_PATH/modules/orionode and run npm install
  • (optional) Configure debug adapters
  1. By default, node, python, java and lldb adapters are configured
  2. If you don't need more or less adapters, you can skip this part
  3. Open ORION_PATH/modules/orionode.debug.server/adapters.json
  4. Add new adapters in this json file. You can find available adapters and their git repositories in VSCode marketplace by searching "debugger"
  • Enable debug server
  1. Go to ORION_PATH/modules/orionode.debug.server
  2. Run npm install
  • Run Orion node server
  1. Edit ORION_PATH/modules/orionode/orion.conf
  2. Set orion.debug.enabled to true
  3. Set debug.server.module to ../orionode.debug.server (by default it's there already)
  4. Edit ORION_PATH/bundles/org.eclipse.orion.client.ui/web/defaults.pref
  5. Add "/general/settings":{"generalSettings": {"enableDebuggerVisible": true}}
  6. Go to ORION_PATH/modules/orionode
  7. Run npm install
  8. Run node server.js
  • Enable debug frontend
  1. Open http://localhost:8081 (or other port you are listening to)
  2. Go to settings page by clicking the gear button on the left
  3. Go to general settings
  4. Enable debugger
  • Create a sample program
  1. Open http://localhost:8081 (or other port you are listening to)
  2. Create a new folder at the root of your workspace
  3. Create a new file called server.js in this new folder
  4. Type in console.log('Hello World!');
  5. Click the run bar at the top, and click "+Native"
  6. Change "Debug Adapter Type" to "node"
  7. Click "Select a Template" and select "Default"
  8. Press "Save"
  9. Click the play button in the run bar
  10. Now you can see the debug UI and the output from the hello world program
  • More tips
  1. Double click a line number to add or remove a breakpoint
  2. Hold alt and double click a line number to add or remove a conditional breakpoint, although some debug adapters don't support conditional breakpoints
  3. Third-party adapters might not work as good as adapters like node

Back to the top