If your program encounters a signal (exception) at run time, you may want to recompile and relink with certain command-line options before debugging the cause. The following will make it easier to debug the program:
Use the -fpen (Linux and Mac OS) or /fpe:n (Windows) option to control the handling of floating point exceptions.
As with other debugging tasks, use the -g (Linux and Mac OS) or /debug:full (Windows) compiler option to generate sufficient symbol table information and debug unoptimized code.
If requested, IDB will catch and handle signals before the Intel Fortran run-time library (RTL) does. You can use the IDB commands catch and ignore to control whether IDB catches signals or ignores them:
When IDB catches a signal, an IDB message is displayed and execution stops at that statement line. The error-handling routines provided by the RTL are not called. At this point, you can examine variables and determine where in the program the signal has occurred.
When IDB ignores a signal, the signal is passed to the RTL. This allows the handling and display of run-time signal messages in the manner requested during compilation.
To obtain the appropriate run-time error message when debugging a program that generates a signal (especially one that allows program continuation), you may need to use the ignore command before running the program. For instance, use the following command to tell the debugger to ignore floating-point signals and pass them through to the RTL:
(idb) ignore fpe
In cases where you need to locate the part of the program causing a signal, consider using the where command.
The following applies to Windows* systems.
You can request that the program always stop when a certain type of exception occurs. Certain exceptions are caught by default by the Intel Visual Fortran run-time library, so your program stops in the run-time library code. In most cases, you want the program to stop in your program's source code instead .
To change how
an exception is handled in the Microsoft debugger:
For machine exceptions, you can use the just-in-time debugging feature to debug your programs as they run outside of the visual development environment. To do this, set the following items: