Eclipse - script debugging

To debug scripts in operation you have to start a process with running Java Virtual Machine ((JVM) (which executes a script (EVENT.EXE/HI.EXE)) by parameter "--java-debug". It activates JVM as a remote debugging.
This parameter is an equivalent of "abbreviation" of the parameter entry "---JVM-OPTION=-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n".

The debugging works in such a way that Eclipse connects to JVM on a defined port (default setting is the port 8000, it may be changed by parameter "address") via TCP/IP protocol layer and executes debugging of the program.

**This holds: the one JVM working on one computer can have a connection on one port. Hence, if you want to debug more pictures/events running on different EVENT.EXE/HI.EXE, you have to set different TCP/IP port for each of processes via the parameters from a command line.

For example:

hi.exe --JVM-OPTION=-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n
event.exe --JVM-OPTION=-agentlib:jdwp=transport=dt_socket,server=y,address=8001,suspend=n

A debug configuration needs to be created in Eclipse if the process is in debug mode.

Follow these directions:

  1. Open picture/event which is to be debugged (in our example it is S$TEST1).
    Debug configuration - opening the picture
  2. Choose the item Debug configurations from Run in the main menu, a dialog window opens, and then create a new debug configuration as Remote Java Application.
    Debug configuration - new configuration
  3. Insert the port number, it must be the same like it has been set at activating of event.exe/hi.exe (or it can be 8000 if a shorten parameter "--java-debug" was used). Click on Debug button.
    Debug configuration - port number
  4. Place breakpoint (1) on a required row.
    Debug configuration - breakpoint
  5. Script executing stops on the row and you can debug (by buttons - 1), browse the values of the variables, ... Debug configuration - stepping

Note: You need not create the new configuration for next debugging of the same script (steps 1, 2, 3).

Napíšte komentár