Top
NetCOBOL V11.0 NetCOBOL Studio User's Guide
FUJITSU Software

9.6.2 Attach Debug

The remote debugger can be used for attachment-type remote debugging. In the attach format, once the remote debugger is started on the local PC, it stays in the standby state until a COBOL application is executed on the server. Remote debugging is started when a COBOL application is executed and the environment variable for requesting the start of attachment debugging has been set on the server.

Note

When multiple NetCOBOL Studio is a standby state of attached debugging, attached debugging is not supported.

9.6.2.1 Starting the remote debugger

  1. Select a COBOL project from the Dependency or Structure view.

  2. Select "Run" > "Debug Configurations..." from the menu bar, or click of on the toolbar and select "Debug Configurations...". The "Debug Configurations" dialog box appears.

  3. Select "Remote COBOL Application" in the left pane.

  4. Click at the top of the left pane. The startup configuration settings page is displayed in the right pane.

  5. The default startup configuration name is displayed in "Name". The startup configuration name can be changed.

  6. Click the "Main" tab, check each setting item, and change it as necessary.

    item

    Description

    Project name

    The selected project name is displayed.

    Debug Style

    Select Attach Debug.

    Debug Information Directory

    If the debugging information file is placed in a directory that is different from the server directory (Server directory of Remote Development page of project property), specify the directory path.

    Multiple directories can be specified as follows:

    • For Solaris or Linux server, connect directory paths with ":" (colon).

    • For Windows server, connect directory paths with ";" (semicolon).

  7. Start the debugger by selecting "Debug". The debugger stays in the standby state until an application to be debugged is reported to have started. Once debugging is started with a particular configuration, the startup configuration is registered as a shortcut in the toolbar and you can restart debugging by selecting "Run" > "Debug History" or using the shortcut.

Note

If the server operating system is Solaris or Linux and the debug target is a COBOL application that uses a dynamic link library stored in a directory other than the one containing the executable file, start debugging after copying the debugging information file (extension "svd") of the dynamic link library to the directory containing the executable file.

Point

The debugger can be started with the default settings by selecting the project in the Dependency or Structure view, and then selecting "Run" > "Debug As" > "Remote COBOL Application" from the menu bar.

9.6.2.2 Remote debugger connector

After the remote debugger connector starts, the following icon is displayed in the task tray, and the settings are the same as those the previous time the remote debugger connector was started. The order from the server to start debugging is monitored.

Note

When the debugger ends, the remote debugger connector is not automatically closed. To close the remote debugger connector, right-click the task tray icon, and then select Exit from the displayed menu.

Remote Debugger Connector dialog box

Parameter

Description

Connect Information

Network Condition:

IP address of the machine or hostname where the remote debugger connector is activating, and the port number monitored by the remote debugger connector are displayed.

When you select Change Port Number, Change Port Number dialog box opens.

Connect Restriction

Connect Allowed Target:

Set the connect-allowed targets.

If you select Allow All the Connection, all computers are allowed to connect.

Allow Target displays the list of the connect-allowed targets. Using each button, Add, Edit and Remove, you can modify the list of connect-allowed targets.

Connect Denied Target:

Set the connect-denied target.

If you select Deny All the Connection, all computers are denied to connect.

Deny target displays the list of the connect-denied targets.

Using each button, Add, Edit and Remove, you can modify the list of the connect-denied targets.

9.6.2.3 Restricting connection to computers that allow remote debugging

The way to restrict connections to computers that allow remote debugging is shown in table below. This table uses the IPv4 address. The IPv6 address can also be used.

In this table, the server remote debugger connector is expressed by "server", and the client remote debugger connector is expressed by "client".

The connect restriction file is used in the server. For details, refer to "Format of connect restriction file".

In the client, make the settings in the Connect Restriction page of the Remote Debugger Connector dialog box. For details, refer to "Remote Debugger Connector dialog box ".

Table 9.5 Typical examples of restricting connection

Format

Server

Client

This allows connection for only a specific target.

The IP address to be allowed connection is as follows:

192.168.0.1

ALLOW=192.168.0.1

DENY=ALL

Setting for "Connect Allowed Target":

  • Select "Allow Target".

  • Set as follows in the edit box:

    192.168.0.1

Setting for "Connect Denied Target":

  • Select "Deny All the Connection".

This allows connection for several specific targets.

The IP addresses to be allowed connection are as follows:

192.168.0.1

192.168.0.2

192.168.0.10

ALLOW=192.168.0.1 \

192.168.0.2 192.168.0.10

DENY=ALL

Setting for "Connect Allowed Target":

  • Select "Allow Target".

  • Set as follows in the edit box:

    192.168.0.1
    192.168.0.2
    192.168.0.10

Setting for "Connect Denied Target":

  • Select "Deny All the Connection".

This allows connection for a specific range.

The range of IP addresses to be allowed connection is as follows:

Lower limit: 192.168.0.1

Upper limit: 192.168.0.10

ALLOW=192.168.0.1-192.168.0.10

DENY=ALL

Setting for "Connect Allowed Target":

  • Select "Allow Target".

  • Set as follows in the edit box:

    192.168.0.1-192.168.0.10

Setting for "Connect Denied Target":

  • Select "Deny All the Connection".

This allows connection in octet units.

The range of IP addresses to be allowed connection is as follows:

Lower limit: 192.168.0.0

Upper limit: 192.168.0.255

ALLOW=192.168.*

DENY=ALL

Setting for "Connect Allowed Target":

  • Select "Allow Target".

  • Set as follows in the edit box:

    192.168.0.*

Setting for "Connect Denied Target":

  • Select "Deny All the Connection".

This allows connection for all computers.

ALLOW=ALL

DENY=ALL

Setting for "Connect Allowed Target":

  • Select "Allow All the Connection".

Setting for "Connect Denied Target":

  • Select "Deny All the Connection".

9.6.2.4 Executing an application on the server

On the server, set the environment variable required for reporting the start of execution of a debug target application to the remote debugger as shown in the table below. Specify the IP address or host name of the local PC for "connection-destination" and specify its port number. For details on how to set the environment variable, see the NetCOBOL User's Guide.

COBOL application

Server

Environment variable

Windows(Itanium)

@CBR_ATTACH_TOOL= connection-destination/STUDIO [path-list]

Windows(x64)

Solaris

CBR_ATTACH_TOOL= connection-destination/STUDIO [path-list]

Linux(Itanium)

Linux(x64)

Canceling the standby state

To stop debugging with the remote debugger in the standby state after it was started in the attach format, click in the bottom right of the window, and then click in the displayed Progress view.

Attached debugging for a COBOL application on the client

Attached debugging can also be performed for a COBOL application built on the client. To perform attachment debugging on the client, set an environment variable on the client. This variable is used to report the start of an application to the debugger.

To perform attachment debugging on the client:

  1. Set the environment variable shown below on the local PC. This variable is used for reporting the start of an application to the debugger.

    @CBR_ATTACH_TOOL=localhost/STUDIO
  2. Select a COBOL project from the Dependency or Structure view.

  3. Select "Run" > "Debug Configurations..." from the menu bar, or click of on the toolbar and select "Debug Configurations..." . The "Debug Configurations" dialog box appears.

  4. Select "Remote COBOL Application" in the left pane.

  5. Click at the top of the left pane. The startup configuration setting page is displayed in the right pane.

  6. The default startup configuration name is displayed in "Name". The startup configuration name can be changed.

  7. Click the "Main" tab, check each setting item, and change it as necessary.

    item

    Description

    Project name

    Displays the selected project name.

    Debug Style

    Select "Attach Debug".

    Debug Information Directory

    Specify the storage folder for the debugging information file. When it is stored in the folder displayed by the Location on the Resource page (*), it is omissible.

    If you specify more than one directory, the folder is delimited by the semicolon (;).

    *: The resource page is in the properties dialog box of the project.

  8. Start the debugger by selecting "Debug". The debugger stays in the standby state until an application to be debugged is reported to have started.

  9. Execute a COBOL application to start debugging.