Previous Topic Next topic Print topic


Debugging COBOL Projects Using a Remote Machine

You need to create a debug configuration before you start debugging a program. Different types of COBOL debug configurations are available for different types of debug sessions, but remote projects use the same debug configuration types as local projects - you just need to specify connection properties such as machine name and port number.

If you have developed a COBOL remote project on a machine using a local Eclipse installation and a remote UNIX machine running Micro Focus Visual COBOL Development Hub, use debug configurations in the same way as locally-developed projects. However you do not need to start the cobdebugremote (Windows) or cobdebugremote32 (UNIX) process (or cobdebugremote64 for a 64-bit process) or identify a port for it to listen on, merely select the remote project in the debug configuration.

Projects developed on a local machine

You can debug local projects while running them on a remote machine, or while your local project interacts with applications running on a remote machine.

The remote machine can be a Windows or UNIX environment, with either the COBOL development system or COBOL Server installed. The two systems must be networked using TCP/IP. The remote machine requires access to the debug symbol (.idy) files in your project, which are normally in the output directory of your project (a location specified in the build configuration). To do this, set up the project subdirectory on the local machine as a network share with the remote machine. Alternatively, you can copy or ftp the dictionary files to a directory on the remote machine. You then need to configure the directory paths that are used to search for the application's .idy files.

Remote debugging of local projects is handled by the cobdebugremote (Windows) or cobdebugremote32 (UNIX) process (or cobdebugremote64 for a 64-bit process), located in $COBDIR/bin of the remote machine.

Note: If you intend to remote debug callable shared objects (.so), you must set the COBIDY environment variable to the location of the .idy file before you start cobdebugremote32 or cobdebugremote64.
You must start the process before communication can be established. This program terminates automatically when you terminate the debug session either by disconnecting from or stopping the debugged application. You can use the following options:
no options
Starts the process and opens a random port for remote connections. The port number is displayed in the console.
machine=name
Specify the machine that the process is running on. Only valid with the stop option.
port
port=nnnnn
Specify the port to use to listen for connection requests.
port=nnnnn-yyyyy
Specify the range of ports to use. If port nnnnn is in use, the next port is tried until a free port is found. If no free ports are found in the range, the utility returns an error.
repeat
After the debug session has been completed, start listening for another connection. If no option is specified, the process exits after the debug session has completed.
stop
Causes the process that is listening on the port to exit. Must be used with the port option. This is only valid when the process is waiting for a connection.

You must enter the same number you set as the port option in the cobdebugremote port field of your debug configuration.

Tip: Because you need to start the process for every debug session, Micro Focus recommends you use the repeat parameter, as this ensures the process listens for another connection after the debug session has completed.

Projects developed on a remote UNIX machine

To enable remote debugging using a COBOL Application debug configuration, you need to have an X window implementation installed and running before you start to debug, so that the output of a remote application running on a UNIX machine can be viewed on your local machine. You do not need X window for other debug configuration types.

Windows:

Micro Focus ViewNow X is provided as part of the Visual COBOL installation.

UNIX:
Ensure the local X11 server can receive connections from the remote machine. You can do this using the xhost + command or by enabling SSH port forwarding. Alternatively, enable TCP/IP connections for X11 by setting a value in a configuration file in a manner appropriate to your operating system. For example:
  • Red Hat: run the gdmsetup utility and deselect Deny TCP connections to Xserver in the Security tab (this configures DisallowTCP=false in /etc/gdm/custom.conf)
  • SUSE: set DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="yes" in /etc/sysconfig/displaymanager

You need to specify the details about the display that the X11 server tries to contact in the IDE preferences:

  1. Click Windows > Preferences > Micro Focus > Debug.
  2. Type the display details in the Default X Server (DISPLAY) field.

    The default Default X Server (DISPLAY) value is clientMachineName:0.0.

Previous Topic Next topic Print topic