To instrument your program with discover to collect data for Code Analyzer, you must have compiled the program with Oracle Solaris Studio version 12.3 or 12.4 C or C++ compiler. Compiling with the –g option generates debug information that enables Code Analyzer to display source code and line number information for dynamic memory access errors and warnings.
discover provides the most complete detection of memory errors at the source code level if you compile your program without optimization. If you compile with optimization, some memory errors will not be detected.
For information about specific types of binaries that Discover can or cannot instrument, see Prepare Binaries Correctly in Oracle Solaris Studio 12.4: Discover and Uncover User’s Guide and Binaries That Use Preloading or Auditing Are Incompatible in Oracle Solaris Studio 12.4: Discover and Uncover User’s Guide .
% cp a.out a.out.save