gtpp1m1gProgram Development Support Reference

Controlling Traces

You can control C function trace by issuing appropriate commands or macros in user exits or in the real-time assembler code.

You can control various aspects of C function trace such as:

Selecting Programs to Be Traced at Compile Time

At compile time, select the ISO-C programs to be traced. Compile these programs using the TEST compiler option, any desired suboptions of the TEST compiler option, and the desired compiler optimization level, dependent on the features of the compiler being used. Load each of the compiled and linked programs into the system to become part of the base system.

Notes:

  1. The BLOCK, LINE, and PATH suboptions of the TEST compiler option are supported by C function trace, dependent on the features of the compiler being used.

  2. If you compile using the TEST compiler option and using an optimization level other than OPT(0) or NOOPTIMIZE, the compiler generates program entry breakpoints and program exit breakpoints only.

Setting System Wide Trace Options

Use the ZSTRC command to control tracing on a system wide level.

Using the ZSTRC Command

Use the ZSTRC command to:

Start C function trace and set trace options using these parameters.

CDEBUG
The CDEBUG parameter enables C function trace for ISO-C programs compiled using the TEST compiler option.

The NOCDEBUG parameter disables the C function trace for ISO-C programs compiled using the TEST compiler option.

STACK
Places up to 68 bytes of the C function stack data in the trace table when the CDEBUG parameter is active. The information is displayed in the dump.

If you specify NOSTACK, only the address of the stack area is placed in the trace table when the CDEBUG parameter is active.

If the CDEBUG parameter is not active, STACK or NOSTACK will not trace any information.

STATIC
Places up to 68 bytes of the C function static data in the trace table when the CDEBUG parameter is active. The information is displayed in the dump.

If you specify NOSTATIC, only the address of the static area is placed in the trace table when the CDEBUG parameter is active.

If the CDEBUG parameter is not active, STATIC or NOSTATIC will not trace any information.

XHOOKS
Enables the C function trace of breakpoints other than program entry breakpoints and program exit breakpoints, for ISO-C programs compiled using the suboptions of the TEST compiler option.

NOXHOOKS disables the C function trace of breakpoints other than program entry breakpoints and program exit breakpoints, for ISO-C programs compiled using the suboptions of the TEST compiler option.

If the CDEBUG parameter is not active, XHOOKS will not trace any information.

The tracing of breakpoints other than program entry breakpoints and program exit breakpoints can enhance your ability to debug problems in your C code.

See TPF Operations for more information about the ZSTRC command.

Controlling Specific ECBs

Use the SETTC and ENATC macros to set trace options and start tracing either the current ECB or other ECBs in the TPF 4.1 system. The C function trace environment is unique for each ECB.

Using the SETTC Macro

Issue the SETTC macro in the CDEB user exit to:

Using the ENATC Macro

Issue the ENATC macro to:

You can issue the ENATC macro at any time.

Using User Exits

The C function trace user exits provide additional flexibility for controlling tracing for specific ECBs. For example, you can issue the SETTC and ENATC macros from user exits to set options and start tracing a specific ECB. The C function trace user exits are as follows.

User Exit
Description

 CDEB 
Trace environment customization

 CEXP 
User trace area initialization

 CTRC 
Trace user data.

See Customizing Trace Information for more information about these user exits.

Activating Loadsets with the E-Type Loader

Use the ZOLDR ACTIVATE command to activate a loadset that contains C programs that have been compiled using the TEST compiler option.

E-type loader functions allow you to control the C function trace in production and test environments. By using the E-type loader you can set up C function trace for specific load modules or specific ECB origins (for example, terminals, lines, and user IDs).

Tracing in a Production Environment

To limit trace data to specific ISO-C programs, use the ZOLDR ACTIVATE command to activate a loadset that contains ISO-C programs compiled using the TEST compiler option.

Tracing by ECB Origin

To control which ECB has access to a specific load module, use the ZOLDR ACTIVATE command with the SEL parameter. This will selectively activate a loadset that contains ISO-C C programs that were compiled using the TEST compiler option. Selective activation allows you to control which ECB origins have access to the specific load module that contains the ISO-C C program. See TPF Operations for more information about the ZOLDR ACTIVATE command.