Chapter 6. The Cross-Reference Utilities

Table of Contents
6.1. Command Line of gnatxref
6.2. Switches for gnatxref
6.3. Command Line of gnatfind
6.4. Example of the Use of gnatxref

The compiler generates cross-referencing information (unless you set the -gnatx switch), which is saved in the .ali files. This information indicates where in the source each entity is declared and referenced.

The two tools gnatxref and gnatfind take advantage of this information to provide the user with the capability to easily locate the declaration and references to an entity. These tools are quite similar, the difference being that gnatfind is intended for locating definitions and/or references to a specified entity or entities, whereas gnatxref is oriented to generating a full report of all cross-references.

6.1. Command Line of gnatxref

The gnatxref command line is of the following form:


$ prefix-gnatxref [switches] files