3.12. Controlling Entry/Exit Hooks

The c29clang compiler tools do not support entry/exit hooks in the same way as the cl2000 compiler. However, c29clang does support an -finstrument-functions option, which inserts calls to __cyg_profile_func_enter() and __cyg_profile_func_exit() at the entry and exit of each function. This feature has not been adequately tested and may be problematic for C++ applications.

cl2000 Option

c29clang Option

--entry_hook=<func>

-finstrument_functions

The cl2000 compiler’s --entry_hook option allows you to specify the name of a function to be called on entry.

The c29clang compiler provides the capability to instrument functions via its -finstrument-functions option, inserting a call to __cyg_profile_func_enter() at the entry of each function defined in a compilation unit. While the c29clang compiler does not provide an option to allow you to name the entry function, the definition of __cyg_profile_func_enter() can be customized to serve as an entry hook function.

The c29clang compiler tools package does not provide an implementation of the __cyg_profile_func_enter(). If you specify the -finstrument_functions option on the command-line, you will need to supply a definition of the __cyg_profile_func_enter() function to be linked with your application.

See Function Entry/Exit Hook Options for more information about c29clang’s -finstrument-functions option.

cl2000 Option

c29clang Option

--entry_parm=<none|name|address>

not supported

When using entry hook functions with the cl2000 compiler, you can pass the name or the address of the calling function as an argument to the entry hook function.

The c29clang compiler does not support an analogous capability.

cl2000 Option

c29clang Option

--exit_hook=<func>

-finstrument_functions

The cl2000 compiler’s --exit_hook option allows you to specify the name of a function to be called before exiting.

The c29clang compiler provides the capability to instrument functions via its -finstrument-functions option, inserting a call to __cyg_profile_func_exit() prior to exiting from each function defined in a compilation unit. While the c29clang compiler does not provide an option to allow you to name the entry function, the definition of __cyg_profile_func_exit() can be customized.

The c29clang compiler tools package does not provide an implementation of the __cyg_profile_func_exit(). If you specify the -finstrument_functions option on the command-line, you will need to supply a definition of the __cyg_profile_func_exit() function to be linked with your application.

See Function Entry/Exit Hook Options for more information about c29clang’s -finstrument-functions option.

cl2000 Option

c29clang Option

--exit_parm=<none|name|address>

not supported

When using exit hook functions with the cl2000 compiler, you can pass the name or the address of the calling function as an argument to the exit hook function.

The c29clang compiler does not support an analogous capability.

cl2000 Option

c29clang Option

--remove_hooks_when_inlining

not supported

If the cl2000 compiler inlines a function, the --remove_hooks_when_inlining option can be used to remove entry/exit hook function calls from the inlined function.

The c29clang compiler does not provide an analogous option.