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.
The gnatxref command line is of the following form: