[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.1 Support for Cross-References 6.2 The Navigate Menu 6.3 Contextual Menus for Source Navigation
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GPS provides cross-reference navigation for program entities, such as types, procedures, functions, variables, ..., defined in your application. The cross-reference support in GPS relies on language-specific tools as explained below.
If you need to navigate through sources that do not compile (e.g after
modifications, or while porting an application), GNAT can still generate
partial cross-reference information if you specify the -gnatQ
compilation option. Along with the -k
option of gnatmake, it is
then possible to generate as much relevant information as possible for
your non compilable sources.
There are a few special cases where GPS cannot find the external file (called `ALI file') that contains the cross-reference information. Most likely, this is either because you haven't compiled your sources yet, or because the source code has changed since the `ALI file' was generated.
It could also be that you haven't included in the project the object directories that contain the `ALI files'.
In addition, one special case cannot be handled automatically. This
is for separate units, whose file names have been crunched through the
gnatkr
command. To handle this, you should force GPS to parse
all the `ALI files' in the appropriate object directory. This is
done by right-clicking on the object directory in the explorer
(left-side panel on the main window), and selecting the menu "Parse
all xref information".
In some cases, GPS won't be able to determine the exact function involved
in a cross-reference. This will typically occur for overloaded functions,
or if multiple functions with the same name, but under different
#ifdef
sections, are defined. In this case, GPS will display a
dialog listing the possible choices to resolve the ambiguity.
In addition, the C/C++ parser has the following limitations: namespaces are currently ignored (no specific processing is done for namespaces); minimal support for templates; no attempt is made to process the macros and other preprocessor defines. Macros are considered as special entities, so it is possible to navigate from a macro use to its definition, but the macro content is ignored, which means for example that function calls made through macros won't be detected.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This capability requires support for cross-references. This item is also accessible through the editor's contextual menu
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This contextual menu is available from any source editor. If you right click over an entity, or first select text, the contextual menu will apply to this selection or entity.
Entity calls
Entity is called by
Note that this capability requires a global look up in the project cross-references, which may take a significant amount of time the first time. After a global look up, information is cached in memory, so that further global queries will be faster.
Find all references to entity
Find all local references to entity
Find all writes to entity
Find all reads of entity
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |