When the navigator is first run, it creates a menu with several buttons on it, presenting the main options available to the user (see Figure 4.1). The ``Load Hierarchy'' button allows the user to load a program into the navigator. When clicked, it brings up a standard file chooser widget which asks the user for the makefile of a program. When the user selects the makefile, the navigator modifies the file so that any occurrence of ``g++'' is replaced by ``g++ -gMatsStufffilename'', where filename is a default pipe in the /tmp directory which will be used to send data from the compiler to the navigator. A comment is also added to the start of the file to ensure that a makefile is never modified more than once. The navigator then forks a process that invokes the standard make command on the modified makefile, which will invoke the modified version of g++ which parses the new argument and will use the pipe to send data to the navigator.
The data that is output by g++ is in an ASCII text format designed to be understandable to a human with some effort. Lines are printed that represent:
A sample section of output is shown in Figure 4.2. Each object such as a declaration or a type is given a unique identifier which is used in cross-references.
The navigator parses this simplified representation of the program and organises it into its own data structures. The navigator then automatically displays a function window that represents the global group for the program, as a starting point for further exploration by the user. The global group remains during the rest of the user's exploration.
Matthew Exon 2004-05-28