Next: , Previous: Call Graph, Up: Source Browsing


10.3 Dependency Browser

The dependency browser shows the dependencies between source files. Each item in the browser represents one source file.

dependency-browser.jpg

In this browser, clicking on the right arrow in the title bar will display the list of files that the selected file depends on. A file depend on another one if it explicitly imports it (with statement in Ada, or #include in C/C++). Implicit dependencies are currently not displayed in this browser, since the information is accessible by opening the other direct dependencies.

Clicking on the left arrow in the title bar will display the list of files that depend on the selected file.

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

Show dependencies for file
This has the same effect as clicking on the right arrow for a file already in the browser, and will display the direct dependencies for that file.
Show files depending on file
This has the same effect as clicking on the left arrow for a file already in the browser, and will display the list of files that directly depend on that file.

The background contextual menu in the browser adds a few entries to the standard menu:

Open file...
This menu entry will display an external dialog in which you can select the name of a file to analyze.
Recompute dependencies
This menu entry will check that all links displays in the dependency browser are still valid. If not, they are removed. The arrows in the title bar are also reset if necessary, in case new dependencies were added for the files.

The browser is not refreshed automatically, since there are lots of cases where the dependencies might change (editing source files, changing the project hierarchy or the value of the scenario variables, ...)

It also recomputes the layout of the graph, and will change the current position of the boxes.

Show system files
This menu entry indicates whether standard system files (runtime files for instance in the case of Ada) are displayed in the browser. By default, these files will only be displayed if you explicitly select them through the Open file menu, or the contextual menu in the project view.
Show implicit dependencies
This menu entry indicates whether implicit dependencies should also be displayed for the files. Implicit dependencies are files that are required to compile the selected file, but that are not explicitly imported through a with or #include statement. For instance, the body of generics in Ada is an implicit dependency. Any time one of the implicit dependencies is modified, the selected file should be recompiled as well.

The contextual menu available by right clicking on an item also adds a number of entries:

Analyze other file
This will open a new item in the browser, displaying the complement file for the selected one. In Ada, this would be the body if you clicked on a spec file, or the opposite. In C, it depends on the naming conventions you specified in the project properties, but you would generally go from a .h file to a .c file and back.
Show dependencies for file
These play the same role as in the project view contextual menu