Top
NetCOBOL V11.0 Debugging Guide
FUJITSU Software

2.6.2 Debug functions for signals handled by the exception handler

For the debugger, application errors (exceptions) such as invalid memory access or zero division that occur when an application is executed are called signals.

Signals occur when invalid processing is executed. However, signals can also be caused by calling a system API that, in turn, causes signals. Handling of signals can be described as an exception handler. These system mechanisms are referred to as structured exception handling.

If the caller of a COBOL program provides an exception handler, an application error that has occurred in the COBOL program will also be handled as a signal. As a result, invalid processing might not be known if it was executed. For example, if an application executed invalid processing for a server program such as a Web server, the exception handler may handle the signal to prevent the server program from being affected.

The debugger can also report the signals handled by the exception handler. The debugger reports the signals using the following two timings:

First signal reception

The debugger reports the signals before the system searches for the exception handler. This applies regardless of the presence or absence of an exception handler. Reporting using this timing is provided so that the signals handled by the exception handler can be known.

Signal reception

The debugger reports the signals when they are received. This applies when an exception handler is not provided or signals are not handled by an exception handler. The debugger does not report the signals if they are handled by an exception handler.

Use the Operation page in the Environments dialog box to set whether to suspend execution of applications at first signal reception. For signal reception, always suspend execution of applications.

Signals are not always problem signals (signals caused by exceptions). Examples are signals caused by calling system API for generating signals or signals that are handled by the exception handler so that processing can be continued. Thus, signals reported using the first signal reception are not always problem signals. Whether a signal is a problem signal must be determined from such items as the signal code and location where the signal occurred. Typically it should be set so that execution of applications will not be suspended for the first signal reception. It is recommended that execution of applications be suspended for the first signal reception only when the exception handler seems to be handling the problem signals.

After execution of an application has been suspended using signal reception, the signal will occur again when the application execution is resumed. This occurs because execution is resumed from the machine instruction that caused the signal.