Top
NetCOBOL V11.0 Debugging Guide
FUJITSU Software

5.6.3 Starting the COBOL Error Report

5.6.3.1 Starting the COBOL Error Report for applications that generate application errors and U-level runtime messages

When an application error or U-level runtime message occurs, the COBOL Error Report detects the error and starts automatically.

Environment variable @CBR_JUSTINTIME_DEBUG can be used to control starting of the COBOL Error Report. When @CBR_JUSTINTIME_DEBUG has not been set, the COBOL Error Report will be started as the default. Refer to "@CBR_JUSTINTIME_DEBUG (Specify inspection using the debugger or the COBOL Error Report at abnormal termination)" in the "NetCOBOL User’s Guide."

The format of the start parameters is shown below. In the example below, the COBOL Error Report is directed to change the output folder of the report file and report event occurrence to an event log file.

Example

@CBR_JUSTINTIME_DEBUG=ALLERR, SNAP -r c:\log -l 

5.6.3.2 Starting the COBOL Error Report for applications that do not respond

To start the COBOL Error Report for applications that do not respond, start the COBOL Error Report manually. When starting the COBOL Error Report, the process ID of the application to be diagnosed must be specified in start parameter -p. Refer to "5.6.3.4 Start parameters".

To obtain the application process IDs, enter the following at the command prompt:

COBSNAP

When the command is run, a listing of the process IDs and applications will be displayed as shown below. The process IDs appear in hexadecimal. The application names are file names only.

PID      Application

     0  [System Process]
     4  System
   3F0  smss.exe
   430  csrss.exe
   448  winlogon.exe
   474  services.exe
   480  lsass.exe
   52C  testpgm.exe
           :

Search the list for the name of the application that does not respond to obtain its process ID.

The specification format for starting the COBOL Error Report for applications that do not respond is shown below.

Example

COBSNAP -p 0x52C

5.6.3.3 Starting the COBOL Error Report for applications that cause area destruction

To start the COBOL Error Report for an application that causes area destruction, specify starting of the COBOL Error Report in environment variable information @CBR_ATTACH_TOOL. The address of the area to be watched must be specified using the start parameter -w. . For the watch area address, specify the address of the destroyed area reported by the memory check function of the runtime system.

The specification format for starting the COBOL Error Report for applications that cause area destruction is shown below:

Example

@CBR_ATTACH_TOOL=SNAP -w 0xDC1198

For details about the format of environment variable @CBR_ATTACH_TOOL, refer to "@CBR_ATTACH_TOOL (Invoke debugger or COBOL Error Report from application)" in the "NetCOBOL User’s Guide". For details about the check function, refer to "5.5 Using the Memory Check Function".

Note

If environment variable @CBR_JUSTINTIME_DEBUG has been set, delete the setting before starting the COBOL Error Report.

5.6.3.4 Start parameters

"Table 5.4 Start parameters" lists the start parameters of the COBOL Error Report. Where the start parameters are specified depends on the method used to start the COBOL Error Report.

  1. Starting the COBOL Error Report for applications that generate application errors and U-level runtime messages with the start parameters in environment variable @CBR_JUSTINTIME_DEBUG.

  2. Starting the COBOL Error Report for applications that do not respond, specifying the start parameters in the COBSNAP command.

  3. Starting the COBOL Error Report for applications that cause area destruction, specifying the start parameters in environment variable @CBR_ATTACH_TOOL.

In "Table 5.4 Start parameters" a circle indicates that the listed start parameter is valid for the method, a, b, or c above.

Table 5.4 Start parameters

Specification format

a

b

c

Description

-d {YES | NO}

Yes

-

-

Specifies whether to output the dump.

YES : Output the dump.

NO : Do not output the dump.

Omitting this start parameter defaults to YES.

-i {0 | 1 | 2}

Yes

Yes

-

Specifies the output contents.

2 : Output the environment variable information, initial file name and the contents of various information files.

1 : Output the environment variable information and initial file name.

0 : Do not output the environment variable information or initial file name.

Omitting this start parameter defaults to 2.

-o folder-name

Yes

-

-

Specifies the output destination folder for the dump file as either an absolute path or a relative path.

Specify an existing folder. (*)

A relative path specifies a folder relative to where the executable file exists.

If the specified folder does not exist and output is not possible, the dump file is output to the standard output destination folder.

If this start parameter is omitted, the dump file is output to the standard output destination folder.

Refer to "5.6.5.2 Dump output destination" for information concerning the standard output destination folder.

-r folder-name

Yes

Yes

Yes

Specifies the output destination folder for the diagnostic report file as either an absolute path or a relative path.

Specify an existing folder. (*)

A relative path locates the diagnostic report file output destination folder relative to the folder in which the executable file exists.

If the specified output destination folder does not exist and output is not possible, the diagnostic report file is output to the standard output destination folder.

Similarly, if this start parameter is omitted, the diagnostic report file is output to the standard output destination folder.

Refer to "5.6.4.1 Diagnostic report output destination" for information concerning the standard output destination folder.

-l [computer-name]

Yes

-

-

Specifies that the occurrence of each application error or runtime message be written to an event log file.

If computer-name is specified, the occurrence of each application error or runtime message is written to the event log file of the named computer.

If computer-name is not specified, the occurrence of each application error or runtime message is written to the event log file of the computer on which the problem has occurred.

-t parameter-count

Yes

Yes

-

Specifies the number of parameters output to the stack summary. The number of parameters must be used from 1 to 16.

Omitting this start parameter defaults to 8.

-s output-unit-count

Yes

Yes

-

Specifies the size for outputting to the stack dump as the output unit count (1 unit: 1024 bytes).

Specify a value greater than 0 for the output unit count.

0: Output all stack contents.

1 or greater: Output stack contents having a size of the specified value ´ 1024 bytes.

Omitting this start parameter defaults to 2.

-p process-ID

-

Yes

-

Specifies the process ID of the application that does not respond.

Specify the process ID as a hexadecimal value beginning with 0x.

-w address [,length]

-

-

Yes

Specifies the address and length of the area to be watched.

Specify the address as a hexadecimal value beginning with 0x.

Specify 4, 8, 12, or 16 as the length. Omitting the length defaults to 4.

* : The following access authority to Everyone group is necessary for the folder.

Note

  • Start parameters are handled the same way whether they are preceded with a hyphen (-) or slash (/).

  • The parameter name that follows the first character of an initial name is case-insensitive.

  • Spaces may or may not intervene between a parameter name and the character string that follows the parameter name.

  • When two or more start parameters are specified, they must be separated from one another by at least one blank.

  • When a folder name appearing in a parameter contains a blank, the folder name must be enclosed with quotation marks ("). When a folder name begins with a hyphen (-), it must also be enclosed with quotation marks (").

  • When the length is specified in start parameter -w, specify the address and length without inserting a space before or after the comma.

Information

If the start parameters -m and -l are omitted, the occurrence of an application error or a runtime message will be reported to the computer on which the problem occurred via the message box.