Difference between revisions of "VMS IDE Python"

From VSI OpenVMS Wiki
Jump to: navigation, search
(How to run)
m
 
(10 intermediate revisions by one other user not shown)
Line 15: Line 15:
  
 
# Setup SSH settings
 
# Setup SSH settings
# Setup project settings: because Python scripts do not need compilation, not all settings are required. Only those which are required for synchronization. So "outdir", "root" and include/exclude masks do matter. Outdir is used only for holding debugger own scripts. Masks used only for synchronization. There is no difference between whether it is a source, headers e.t.c.
+
# Setup project settings: because Python scripts do not need compilation, not all settings are required. Only those which are required for synchronization. So "outdir", "root" and include/exclude masks do matter. Outdir is used only for holding debugger own scripts (tracer and server). Masks used only for synchronization. There is no difference between whether it is a source, headers e.t.c.
 
# Setup launch: open launch.json, then "Add configuration" => "VMS IDE: Launch Python script".
 
# Setup launch: open launch.json, then "Add configuration" => "VMS IDE: Launch Python script".
 
{| class="wikitable"
 
{| class="wikitable"
Line 32: Line 32:
 
|-
 
|-
 
| "arguments": "" || script arguments
 
| "arguments": "" || script arguments
 +
|-
 +
| "pre_launch": "", || VMS command to execute before python (from project root folder)
 +
|-
 +
| "python_args": "", || Python arguments
 
|}
 
|}
  
Select this launch and press F5. Script always stops at the first line.
+
Select this launch configuration and press F5. Script always stops at the first line.
 +
 
 +
= Debugging =
 +
 
 +
To show debugger commands type 'h' in debugger console.
 +
 
 +
Not all files are traced by default. Only local files. To enable tracing non-local files do edit extension setting '''Vms_python_debug: Roots''' and add pairs of values<br>
 +
''VMS_PATH_in_UNIX_FORMAT'' : ''LOCAL_PATH_as_C_STRING''<br>
 +
The file will be traced if:
 +
* It is local
 +
* It has a break point
 +
* It is in VMS folder, selected by command 'y path' where path is VMS path in UNIX format (command 'y' with empty path clears current path)
 +
* Debugger is in developer mode, switched by command 'm 1' (to switch back use 'm 0') or defined in settings.
  
[[Category:VMS IDE]]
+
To change the radix for the variables view, use the 'x #' command in debugger console, where # is 8, 10, or 16
 +
[[Category:VMS IDE]] [[Category:VMS Python]]

Latest revision as of 07:53, 1 July 2021

Python

Python debugger allows debugging Python scripts on VMS.

Features

  1. Running python script on VMS side
  2. Breakpoints
  3. Displaying local variables in each accessible frame
  4. Multithreading
  5. Post-mortem information about unhandled exceptions.
  6. Changing variable value
  7. Jump to cursor inside a frame

How to run

  1. Setup SSH settings
  2. Setup project settings: because Python scripts do not need compilation, not all settings are required. Only those which are required for synchronization. So "outdir", "root" and include/exclude masks do matter. Outdir is used only for holding debugger own scripts (tracer and server). Masks used only for synchronization. There is no difference between whether it is a source, headers e.t.c.
  3. Setup launch: open launch.json, then "Add configuration" => "VMS IDE: Launch Python script".
Property Meaning
"type": "vms python debugger" do not change
"request": "launch" do not change
"name": "Launch Python Script" write an unique name
"script": "${file}" file name or "${file}" for currently opened file under cursor
"port": "55005-55025" range of local ports on VMS, used for communication between tracer and server scripts
"arguments": "" script arguments
"pre_launch": "", VMS command to execute before python (from project root folder)
"python_args": "", Python arguments

Select this launch configuration and press F5. Script always stops at the first line.

Debugging

To show debugger commands type 'h' in debugger console.

Not all files are traced by default. Only local files. To enable tracing non-local files do edit extension setting Vms_python_debug: Roots and add pairs of values
VMS_PATH_in_UNIX_FORMAT : LOCAL_PATH_as_C_STRING
The file will be traced if:

  • It is local
  • It has a break point
  • It is in VMS folder, selected by command 'y path' where path is VMS path in UNIX format (command 'y' with empty path clears current path)
  • Debugger is in developer mode, switched by command 'm 1' (to switch back use 'm 0') or defined in settings.

To change the radix for the variables view, use the 'x #' command in debugger console, where # is 8, 10, or 16