Oracle® Solaris Studio 12.4: Code Analyzer User's Guide

Exit Print View

Updated: October 2014
 
 

codean Work Flow Example

This section provides an example of monitoring the effect of a bug fix.

  1. Compile the target source before the fix.

    % cc -g *.c
  2. Instrument the binary using Discover and make sure it generates Analytics output.

    % discover -a a.out
  3. Run the instrumented binary.

  4. Use codean to store the analytics output. The history archive is created at a.out.analyze/history/before_bugfix and a history file called dynamic is created in this directory.

    % codean --save --tag before_bugfix -d a.out
  5. Fix the bug.

  6. Compile the target source again.

    % cc -g *.c
  7. Instrument the binary again using discover.

    % discover -a a.out
  8. Run the instrumented binary.

    % a.out
  9. Show comparison results and ensure that the invalid memory access caused by the bug is fixed.

    % codean --whatisfixed --tag before_bugfix -d a.out

    This produces a new Analytics output file at a.out.analyze/dynamic/fixed_before_bugfix and that contains only fixed dynamic issues. You can use codean or the Code Analyzer GUI to view these fixed issues.

  10. (Optional) Run codean to ensure you did not introduce any new bugs.

    % codean --whatisnew --tag before_bugfix -d a.out

    This command produces a new analytics file at a.out.analyze/dynamic/new_before_bugfix that contains only new dynamic issues.