Next: Dependency Browser, Previous: General Issues, Up: Source Browsing

### 10.2 Call Graph

The call graph shows graphically the relationship between subprogram callers and callees. A link between two items indicate that one of them is calling the other.

A special handling is provided for renaming entities (in Ada): if a subprogram is a renaming of another one, both items will be displayed in the browser, with a special hashed link between the two. Since the renaming subprogram doesn't have a proper body, you will then need to ask for the subprograms called by the renamed to get the list.

In this browser, clicking on the right arrow in the title bar will display all the entities that are called by the selected item.

Clicking on the left arrow will display all the entities that call the selected item (i.e. its callers).

This browser is accessible through the contextual menu in the project view and source editor, by selecting one of the items:

All boxes in this browser list several information: the location of their declaration, and the list of all their references in the other entities currently displayed in the browser. If you close the box for an entity that calls them, the matching references are also hidden, to keep the contents of the browser simpler.

`Browsers->Entity calls`
  Display all the entities called by the selected entity. This has the same effect as clicking on the right title bar arrow if the item is already present in the call graph.
`Browsers->Entity is called by`
  Display all the entities called by the selected entity. This has the same effect as clicking on the left title bar arrow if the item is already present in the call graph.

The contextual menu available by right-clicking on the entities in the browser has the following new entries, in addition to the ones added by other modules of GPS.

`Entity calls`
  Same as described above.
`Entity is called by`
  Same as described above.
`Go To Spec`
  Selecting this item will open a source editor that displays the declaration of the entity.
`Go To Body`
  Selecting this item will open a source editor that displays the body of the entity.
`Locate in Project View`
  Selecting this menu entry will move the focus to the project view, and select the first node representing the file in which the entity is declared. This makes it easier to see which other entities are declared in the same file.