Contents

Legal Notices

Chapter 1:
  Quick Start


Chapter 2:
  Introduction and Installation


Chapter 3:
  About Memory Analysis


Chapter 4:
  Finding Memory Leaks


Chapter 5:
  Finding Memory Errors


Chapter 6:
  Startup Options


Chapter 7:
  Viewing Error Messages


Chapter 8:
  Viewing Source Code


Chapter 9:
  Tips and Techniques


Chapter 10:
  Troubleshooting


Chapter 11:
  Obtaining Support


Chapter 8:  Viewing Source

ZeroFault allows you to display, edit and direct where to search for the target program's source files.

Source Code Display

ZeroFault displays the source code responsible for the last selected error, if it can find the source file in one of the specified source directories. The line in the source closest to the error is underlined in the source display pane, and the error type is displayed at the top of the pane.

If ZeroFault cannot find the source file, it will report "File not found (filename)" at the top of the pane for three (3) seconds and then the last file found will be redisplayed, or the pane will be blank if no file was found before.

Source Code Editing

When a source file is displayed, the Edit button in the source display pane will be highlighted. Press this button to bring up an xterm running vi, opened upon the file at the source line which generated the error. The xterm will be displayed according to the value of the DISPLAY environment variable at the time that zf (or zf_ui) was started.

Changes made to any source will not be reflected in the executable until it is recompiled and ZeroFault is run on it again.

Source File Search Path

ZeroFault uses the source file search path to find the source files that correspond to displayed error messages. The search path can be defined on the command line, in an environment variable, or in a file. ZeroFault uses the following process to define the search path:
  • Use the value of the -p flag if it is defined.
  • Use the contents of the ZF_SOURCE_PATH environment variable if it is defined.
  • Load the contents of the search path file specified by the ZF_PATH_FILE environment variable if it exists.
  • Load the contents of the $HOME/.zf_srcpath search path file if it exists.
  • Load the contents of the $ZF_HOME/.zf_srcpath search path file if it exists.
  • Load the contents of the ./.zf_srcpath search path file if it exists.

The format of the search path is a list of directory names separated by whitespace (spaces, tabs, newlines). For example, a search path file can be created by using the find command as follows:

  find <src_top> -name '*.c' -print | xargs -n1 dirname | sort -u > .zf_srcpath
The source path may be modified via the GUI's Source Path pulldown menu:
  • Load path file brings up the standard file selection box and allows you to load a new path file to replace the existing source path.
  • Append path file brings up the standard file selection box and allows you to load a new path file to append to the existing source path.
  • Edit current path brings up a dialog window that allows you to directly modify the current search path. Note that any changes made do not get saved for use with future ZeroFault sessions.

 

© Copyright 2013 The ZeroFault Group, LLC. All rights reserved. All logos and trademarks are property of their respective owners.