Previous Topic Next topic Print topic


Catch

Use

Returns process control to the debugger when the given signal is generated.

Command Syntax

CATCH {/DEFAULT | [/NIGNORE|/IGNORE] signal}

where:

signal
Can be either a signal name mnemonic (such as SIGALRM, SIGINT, and so on) or the signal number corresponding to that mnemonic. Signal names may be specified in either uppercase or lowercase letters

Description

The occurrence of a signal that is set to be caught and ignored will cause process control to return to the debugger. When the child (user) process is subsequently resumed (for example, by using Step or Continue), it will continue as if it had not incurred the given signal. The occurrence of a signal that is set to be caught and not ignored (/NIGNORE), will cause process control to return to the debugger. When the child process is subsequently resumed, it will continue as if it had incurred the given signal. The occurrence of a signal that is not set to be caught will not cause process control to return to the debugger.

By default, certain signals are caught by the debugger. The Default option will reset all CATCH settings back to the debugger's default settings.

Use the command LCATCH /ALL to get a list of current signal settings.

Note: The signals SIGILL and SIGTRAP are permanently set to be ignored by the debugger. These are special signals because they are used by the debugger for breakpointing. You cannot modify the settings for these two signals.

Example

In the following example, process control will return from the child process to the debugger when SIGALRM is generated.

CodeWatch> CATCH /IGNORE SIGALRM
Changing SIGALRM to be caught and ignored.

When the child process resumes, it will ignore the SIGALRM and continue as if it had never generated a SIGALRM.

In the following example, the number 28 represents the signal SIGWINCH. Process control will return from the child process to the debugger when a SIGWINCH is generated.

CodeWatch> CATCH /NIGNORE 28
Changing SIGWINCH to be caught and not ignored.

When the child process resumes, it will recognize the signal SIGWINCH and continue as if it had incurred a SIGWINCH.

Previous Topic Next topic Print topic