The command invocation for
$ gnatxref [ switches ] sourcefile1 [ sourcefile2 ... ]
identify the source files for which a report is to be generated. The
withed units will be processed too. You must provide at least one file.
These file names are considered to be regular expressions, so for instance
source*.adb is the same as giving every file in the current
directory whose name starts with
source and whose extension is
You shouldn’t specify any directory name, just base names.
gnatfind will be able to locate these files by themselves using
the source path. If you specify directories, no result is produced.
The following switches are available for
Display Copyright and version, then exit disregarding all other options.
--version was not used, display usage, then exit disregarding
all other options.
If this switch is present,
gnatxref will parse
the read-only files found in the library search path. Otherwise, these files
will be ignored. This option can be used to protect Gnat sources or your own
libraries from being parsed, thus making
much faster, and their output much smaller. Read-only here refers to access
or permissions status in the file system for the current user.
When looking for source files also look in directory DIR. The order in which
source file search is undertaken is the same as for
When -searching for library and object files, look in directory
DIR. The order in which library files are searched is the same as for
Do not look for sources in the system default directory.
Do not look for library files in the system default directory.
Specify an alternate ali file extension. The default is
ali and other
gli for C/C++ sources) may be specified via this switch.
Note that if this switch overrides the default, only the new extension will
Specifies the default location of the runtime library. Same meaning as the
gnatmake flag (Switches for gnatmake).
If this switch is set
gnatxref will output the parent type
reference for each matching derived types.
If this switch is set, the output file names will be preceded by their directory (if the file was found in the search path). If this switch is not set, the directory will not be printed.
If this switch is set, information is output only for library-level
entities, ignoring local entities. The use of this switch may accelerate
Specify a configuration file to use to list the source and object directories.
If a file is specified, then the content of the source directory and object
directory lines are added as if they had been specified respectively
See Configuration Files for gnatxref and gnatfind for the syntax of this configuration file.
Output only unused symbols. This may be really useful if you give your
main compilation unit on the command line, as
gnatxref will then
display every unused entity and ’with’ed package.
Instead of producing the default output,
gnatxref will generate a
tags file that can be used by vi. For examples how to use this
feature, see Examples of gnatxref Usage. The tags file is output
to the standard output, thus you will have to redirect it to a file.
All these switches may be in any order on the command line, and may even
appear after the file names. They need not be separated by spaces, thus
you can say
gnatxref -ag instead of
gnatxref -a -g.