
Exemplar C and Fortran 77 Programmer's Guide
Debugging and profiling
[ Previous Page ] [ Next Page ] [ Contents ]
This chapter provides an overview of the debugging and performance analysis tools available on Exemplar systems. The programs discussed in this chapter are optional products. If you are unsure whether a product is installed on your system, check with your system administrator.
See the following documents for more information on these tools:
NOTE: Debugging with theddeandxdbdebuggers is not supported with code compiled using the Exemplar compilers.
CXdb is a window-based, symbolic debugger that lets you debug Fortran, C, and C++ programs compiled with the Fortran 77, C, and C++ compilers on Exemplar systems.
To debug using CXdb, you must:
-g option to produce
debugging information in the executable file for CXdb to read-g option using the Exemplar
linker by means of the compiler driverNOTE: If-gis specified, the Exemplar C and Fortran 77 compilers restrict optimizations to the+O0level.
With CXdb, you can:
CXdb has an X/Motif graphical user interface and a command-line interface for supporting line-oriented terminals.
To use CXdb in X window mode, follow these steps:
-g option:
% f77 -g prog.f -Wl,-aarchive_shared
In this example, the Exemplar linker is automatically used by f77.
If you do not use the Exemplar linker, you will not be able to use
CXdb on the resulting executable. The -Wl,-aarchive_shared
option links in archive libraries; if an archive version of a library
is not found, the shared version is used. CXdb does not currently
support debugging of shared libraries.
DISPLAY environment variable (if it is not already set).
For example if your display's name is mydisplay, in C shell,
enter:
% setenv DISPLAY mydisplay:0.0
% cxdb a.out &
For additional information on using CXdb, refer to the cxdb(1) man page, the CXdb online help system, or the CXdb Quick Reference.
CXpa is a performance analysis tool for monitoring program performance at user-selectable source code regions, such as routines, loops, and compiler-generated parallel loops.
Types of performance data you can collect include:
Features of CXpa include the ability to:
For more information about these events, see the cxpa(1) man page, the CXpa online help system, or the CXpa Reference.
The basic steps in the profiling process are as follows:
+pa option or instrumenting it with the cxoi
utility (refer to the cxoi(1) man page for more information).
+pa option using the
Exemplar linker by means of the compiler driver.
cxpa), specifying the name of the executable
you want to profile.
or
writing instrumentation selections to the executable file, exiting CXpa, and then running the executable outside CXpa to generate performance data files for later analysis with CXpa.
NOTE: The+paoption is not compatible with-por-Goptions or with the+O4or+Oalloptimization levels.