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.
Select a COBOL project from the Dependency or Structure view.
Select "Run" > "Debug Configurations..." from the menu bar, or click of on the toolbar and select "Debug Configurations...". The "Debug Configurations" dialog box appears.
Select "Remote COBOL Application" in the left pane.
Click at the top of the left pane. The startup configuration settings page is displayed in the right pane.
The default startup configuration name is displayed in "Name". The startup configuration name can be changed.
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:
|
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.
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. |
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 ".
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":
Setting for "Connect Denied Target":
|
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":
Setting for "Connect Denied Target":
|
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":
Setting for "Connect Denied Target":
|
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":
Setting for "Connect Denied Target":
|
This allows connection for all computers. | ALLOW=ALL DENY=ALL | Setting for "Connect Allowed Target":
Setting for "Connect Denied Target":
|
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) |
For "connection-destination", specify the client side port number for the remote debugger connector and the operating computer in the following format:
{IP address | host name}[:port number]
Specify the IP address in IPv4 or IPv6 format.
Specify a port number in the range 1024 to 65535. If the port number is omitted, it defaults to 59999.
The IPv6 format can specify the scope address. The scope address specifies the scope identifier after the address.
If a port number is specified in an IPv6 address, enclose the address part with "[ ]".
Example:
Specification with IPv4 address (192.168.0.1) and port number (2000)
@CBR_ATTACH_TOOL=192.168.0.1:2000/STUDIO
Specification with IPv6 address (fe80::1:23:456:789a) and port number (2000)
@CBR_ATTACH_TOOL=[fe80::1:23:456:789a]:2000/STUDIO
Specification with IPv6 address (fe80::1:23:456:789a) and scope identifier (%eth0)
@CBR_ATTACH_TOOL= fe80::1:23:456:789a%eth0/STUDIO
Specification with IPv6 address (fe80::1:23:456:789a), scope identifier (%5) and port number (2000)
@CBR_ATTACH_TOOL=[fe80::1:23:456:789a%5]:2000/STUDIO
Specification with host name (client-1) and port number (2000)
@CBR_ATTACH_TOOL=client-1:2000/STUDIO
Specification with port number omitted (IPv4 address)
@CBR_ATTACH_TOOL=192.168.0.1/STUDIO
Specification with port number omitted (IPv6 address)
@CBR_ATTACH_TOOL=fe80::1:23:456:789a/STUDIO
An IPv6 address cannot be specified if the server OS is Linux(Itanium).
Note
For the Linux (Itanium) operating system, the IPv6 address cannot be specified.
Remote debugging corresponds to the IPv6 address within the following scopes.
item | Specification |
---|---|
Network | It corresponds to the following environments.
|
IPv6 address | The following IPv6 addresses are used.
|
IPv4/IPv address selection | In the IPv4/IPv6 dual stack environment, IPv6 is used by priority. The following are not supported
|
IP address notation | The following not supported
In the following cases, use the IPv4 address notation
|
Note
Privacy Extensions are not supported. When an IP address is changed, it is necessary to restart a remote debugger connector and a remote debugger.
For path-list, specify the directory that contains the debugging information file. The debugging information is retrieved in the following order, and is used for debugging.
The specified order of the additional path list (delimit by semicolon ";" and enter the full path name when you specify two or more folders).
The current folder when the COBOL program began to run.
The folder that contains the COBOL program.
Note
2. and 3. do not need to be added to PATHLIST.
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:
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
Select a COBOL project from the Dependency or Structure view.
Select "Run" > "Debug Configurations..." from the menu bar, or click of on the toolbar and select "Debug Configurations..." . The "Debug Configurations" dialog box appears.
Select "Remote COBOL Application" in the left pane.
Click at the top of the left pane. The startup configuration setting page is displayed in the right pane.
The default startup configuration name is displayed in "Name". The startup configuration name can be changed.
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.
Start the debugger by selecting "Debug". The debugger stays in the standby state until an application to be debugged is reported to have started.
Execute a COBOL application to start debugging.