Difference between revisions of "VMS IDE Developing"

From VSI OpenVMS Wiki
Jump to: navigation, search
(Debugging)
 
(23 intermediate revisions by 7 users not shown)
Line 1: Line 1:
* Bulleted list item
+
==Loading Existing Project==
=Developing=
+
If you start working on an existing project that resides on your OpenVMS machine, you need to download the source files to your local machine. Use the '''Synchronizer''' tool as described below to download the source files.
 +
# Change the [[Synchronize Configuration#Settings Description|'''downloadNewFiles''']] option to ''overwrite''.
 +
# Run the <code>VMS-IDE: Synchronize project files with VMS</code> command.
 +
# After all project files are downloaded, change the '''downloadNewFiles''' option to ''skip'' or ''edit'' to prevent silent overwriting of local files.
  
==Syncing Source Code==
+
==Managing Project Source Files==
When you start working on a project that resides on an OpenVMS machine, you need to download source files to your local machine. For this,
+
You can view and edit all project files from the Visual Studio Code '''Explorer'''. Refer to Visual Studio Code [https://code.visualstudio.com/docs/getstarted/userinterface documentation] to learn more about '''Explorer''' view features.
# Change the <code>downloadNewFiles</code> option to "overwrite" or "edit"
 
# Run "VMS-IDE: Synchronize project files with VMS" command
 
# After all project files are downloaded, change the <code>downloadNewFiles</code> option to "skip" or "edit" to prevent silent overwriting of local files.
 
  
==Managing Project Source Files==
+
The OpenVMS project structure may look like shown below:
You can view and edit all project files from the Explorer view of Visual Studio Code.
+
[[File:Vms ide explorer.png|200px|thumb|none|VMS IDE Explorer]]
  
 
==Managing the Project==
 
==Managing the Project==
You can manage your VMS project from the Project Explorer view. To open the view, click Project Explorer icon on the Activity Bar  
+
You can manage your OpenVMS project from the [[VMS_IDE_Project_Explorer|'''Project Explorer''']] view. To open the view, click ''Project Explorer'' icon on the Activity Bar.
  
 
===Managing Dependencies===
 
===Managing Dependencies===
Use the Project Dependencies panel to manage project dependencies.  
+
If you work on a complex project and you need to add dependencies, use the '''PROJECT DEPENDENCIES''' section. <br>
 
Assuming that you want to add "Project B" to "Project A" dependencies, <br>
 
Assuming that you want to add "Project B" to "Project A" dependencies, <br>
# Select "Project A" in the Project Dependencies panel
+
# Select "Project A" in the '''PROJECT DEPENDENCIES''' panel.
# Right-click "Project B", and select "Add in dependencies to selected" item from the context menu.
+
# Right-click "Project B", and select ''Add to dependencies of selected'' item from the context menu.
 +
<br>
 +
To remove a project from dependencies
 +
# Open the '''PROJECT DEPENDENCIES''' section.
 +
# Right-click the project, then select ''Remove from dependencies''.
  
 
=Building=
 
=Building=
 +
 +
===Build Configurations===
 +
To build your projects you can use a default build configuration or create a custom one. See [[Build Configurations]] for details.
 +
 +
===Build MMS===
 +
Before building your project, create the '''MMS''' file by pressing <code>F1</code> and running <code>VMS-IDE: Create MMS</code>. See [[Auto-generated MMS]] for more information.
 +
 +
===Building VMS Project===
 
To build a project in VMS IDE:  
 
To build a project in VMS IDE:  
# Open the Project Explorer view.
+
# Open the [[VMS_IDE_Project_Explorer|'''Project Explorer''']] view.
# Select the project you want to build in the Project Dependencies panel.
+
# Select the project you want to build in the '''PROJECT DEPENDENCIES''' section.
# In the Project Description panel, select the required build type (<code>DEBUG</code> or <code>RELEASE</code>) simply by clicking the '''buildType''' parameter.
+
# In the '''PROJECT DESCRIPTION''' section, choose the required [[Build Configurations|build configuration]] by right-clicking the '''buildName''' parameter and selecting '''Change'''.
 
# Right-click the project and select ''Build with dependencies'' from the context menu.
 
# Right-click the project and select ''Build with dependencies'' from the context menu.
  
To build a project using a custom build procedure, edit the ''task.json'' file
+
If there are any changes to the project, the updated files will be uploaded to the OpenVMS system. Previously created object and listing files (.OBJ, .LIS) will be removed from the OpenVMS system. This guarantees that up-to-date files are uploaded to the OpenVMS system.
<pre>{
 
  "type": "task2cmd",
 
  "command": "vmssoftware.synchronizer.buildProject",
 
  "extension": "vmssoftware.synchronizer",
 
  "parameter": "time.com",
 
  "label": "VMS: Time",
 
  "problemMatcher": []
 
}</pre>
 
where
 
* '''parameter''' is the name of your build procedure (COM file)
 
* '''label''' meaningful task name
 
All other parameters must be as shown in example.
 
  
=Running=
+
'''NOTE''': you can manually upload all new and updated files by using the [[VMS_IDE_Commands|'''VMS-IDE: Upload all''']] command.
  
 
=Debugging=
 
=Debugging=
To debug your application, press <code>F5</code>. If there is no "launch.json" file in the project directory, you will be asked to select environment. Select VMS Debugger from the popup list.
+
Use [[VMS_IDE_Debugger|'''Debugger''']] view to debug OpenVMS projects.
 +
 
 +
To debug JVM based projects see [[VMS IDE for Java (Kotlin, Scala)]]
  
The "launch.json" file will be created and filled with the required information. There are two types of launch - '''DEBUG''' and '''RUN'''.
+
'''NOTE''': Before running the debugger, make sure that you have actual DEBUG builds on the OpenVMS system. Also do the command "Prepare to debug" in context menu of Project explorer.
For the "program" field, specify the relative path to the executable (from home directory), for example "[.project.bin.release]hello.exe".
 
If the field is empty, VMS IDE will try to fill it with data from project settings.
 
  
To choose which configuration will take action go to "Debug" (Ctrl-Shift-D) and select the appropriate configuration from the drop-down list.
+
To start a debugging session, press <code>F5</code>. If there is no "launch.json" file in the project directory, you will be asked to select the environment. Select <code>VMS Debugger</code> from the popup list.
 +
The '''launch.json''' file will be created and filled with the required information. There are two types of launch configuration - '''DEBUG''' and '''RUN'''.
 +
<pre>"configurations": [
 +
        {
 +
            "type": "vms_dbg",
 +
            "request": "launch",
 +
            "name": "Debug",
 +
            "program": "",
 +
            "arguments": "",
 +
            "stopOnEntry": true,
 +
            "typeRun": "DEBUG"
 +
        }
 +
]
 +
</pre>
 +
For the '''program''' field, specify the relative path to the executable, for example <code>[.project.bin.release]hello.exe</code>.
 +
If the field is empty, '''VMS IDE''' will try to fill it with data from the project settings.
  
 +
'''NOTE''': The debugger uses two terminals - one for the program being debugged and one for the debugger itself. Therefore the user has to have additional privileges: LOG_IO, PHY_IO, SHARE and OPER.
 +
 +
To choose which configuration to use, go to "Debug" (<code>Ctrl-Shift-D</code>) and select the appropriate configuration from the drop-down list.
 
Press <code>F5</code> again to run debugger.
 
Press <code>F5</code> again to run debugger.
 +
 +
[https://www.youtube.com/watch?v=7IRYBQS0C8Y&list=PLewDXk9a8laO3cAZFPyZ4bbgcKsJ1qgPo&index=3 Video tutorial: VMS IDE 3 Building a Project]
 +
 +
[https://www.youtube.com/watch?v=CjUciv1Da6Y&list=PLewDXk9a8laO3cAZFPyZ4bbgcKsJ1qgPo&index=4 Video tutorial: VMS IDE 4 Debugging a Project]
 +
 +
[[Category:VMS IDE]]

Latest revision as of 04:10, 10 July 2020

Loading Existing Project

If you start working on an existing project that resides on your OpenVMS machine, you need to download the source files to your local machine. Use the Synchronizer tool as described below to download the source files.

  1. Change the downloadNewFiles option to overwrite.
  2. Run the VMS-IDE: Synchronize project files with VMS command.
  3. After all project files are downloaded, change the downloadNewFiles option to skip or edit to prevent silent overwriting of local files.

Managing Project Source Files

You can view and edit all project files from the Visual Studio Code Explorer. Refer to Visual Studio Code documentation to learn more about Explorer view features.

The OpenVMS project structure may look like shown below:

VMS IDE Explorer

Managing the Project

You can manage your OpenVMS project from the Project Explorer view. To open the view, click Project Explorer icon on the Activity Bar.

Managing Dependencies

If you work on a complex project and you need to add dependencies, use the PROJECT DEPENDENCIES section.
Assuming that you want to add "Project B" to "Project A" dependencies,

  1. Select "Project A" in the PROJECT DEPENDENCIES panel.
  2. Right-click "Project B", and select Add to dependencies of selected item from the context menu.


To remove a project from dependencies

  1. Open the PROJECT DEPENDENCIES section.
  2. Right-click the project, then select Remove from dependencies.

Building

Build Configurations

To build your projects you can use a default build configuration or create a custom one. See Build Configurations for details.

Build MMS

Before building your project, create the MMS file by pressing F1 and running VMS-IDE: Create MMS. See Auto-generated MMS for more information.

Building VMS Project

To build a project in VMS IDE:

  1. Open the Project Explorer view.
  2. Select the project you want to build in the PROJECT DEPENDENCIES section.
  3. In the PROJECT DESCRIPTION section, choose the required build configuration by right-clicking the buildName parameter and selecting Change.
  4. Right-click the project and select Build with dependencies from the context menu.

If there are any changes to the project, the updated files will be uploaded to the OpenVMS system. Previously created object and listing files (.OBJ, .LIS) will be removed from the OpenVMS system. This guarantees that up-to-date files are uploaded to the OpenVMS system.

NOTE: you can manually upload all new and updated files by using the VMS-IDE: Upload all command.

Debugging

Use Debugger view to debug OpenVMS projects.

To debug JVM based projects see VMS IDE for Java (Kotlin, Scala)

NOTE: Before running the debugger, make sure that you have actual DEBUG builds on the OpenVMS system. Also do the command "Prepare to debug" in context menu of Project explorer.

To start a debugging session, press F5. If there is no "launch.json" file in the project directory, you will be asked to select the environment. Select VMS Debugger from the popup list. The launch.json file will be created and filled with the required information. There are two types of launch configuration - DEBUG and RUN.

"configurations": [
        {
            "type": "vms_dbg",
            "request": "launch",
            "name": "Debug",
            "program": "",
            "arguments": "",
            "stopOnEntry": true,
            "typeRun": "DEBUG"
        }
]

For the program field, specify the relative path to the executable, for example [.project.bin.release]hello.exe. If the field is empty, VMS IDE will try to fill it with data from the project settings.

NOTE: The debugger uses two terminals - one for the program being debugged and one for the debugger itself. Therefore the user has to have additional privileges: LOG_IO, PHY_IO, SHARE and OPER.

To choose which configuration to use, go to "Debug" (Ctrl-Shift-D) and select the appropriate configuration from the drop-down list. Press F5 again to run debugger.

Video tutorial: VMS IDE 3 Building a Project

Video tutorial: VMS IDE 4 Debugging a Project