This chapter provides an overview of the Program Visualizer's features and capabilities. For more detailed information on how to use this tool, choose Help: On Program Visualizer. You can print Help topics using the HyperHelp Viewer.
The Program Visualizer provides the ability to display large amounts of data in a condensed format. The Program Visualizer main window uses file pictographs (vertical, rectangular graphics) to give a visual representation of the size and content of source files.
Figure Figure 19-1 shows the Program Visualizer main window.
Key elements are the major window panes running from the top to the bottom of the window:
Displays the current project and the working directory.
Shows the pictographs of the files you are examining. These pictographs give a visual representation of the size and content of the files.
Displays information messages and Quick Help on menu items when you press and hold MB1 on the item.
You can use the Program Visualizer to do the following:
Display large amounts of data (up to 30,000 lines) in a nontextual manner
Display events (See Section Section 19.6) generated by:
Heap Analyzer
Profiler
Search
Display source code using FUSE Editor, Emacs, or vi
Provide the ability to filter which events to visualize
Track which events have been reviewed and which have not been reviewed
You can use the Program Visualizer with a number of the FUSE tools. For example, you might want to run the Heap Analyzer to find any memory leaks in your code. If you have the Program Visualizer running simultaneously, you can have the results from the Heap Analyzer go directly to the Program Visualizer, thus producing a visualized graphic highlighting the location of the memory leaks within your source code files.
You can use the Program Visualizer with the Heap Analyzer to:
Highlight memory leaks and their locations within the source code
Highlight memory accessing errors
You can use the Program Visualizer with the Profiler to:
Display line and function execution coverage. A file pictograph of execution coverage can be shown, highlighting all the non-executed lines or functions.
Display CPU cycle data. A file pictograph can be displayed, showing the CPU time spent on each line of code or function that exceeds a user-specified value.
You can use the Program Visualizer with the Search tool in these ways:
The Search tool produces a list indicating each location in a file that contains the search text. You can have this list sent directly to the Program Visualizer where each occurrence of the search text is highlighted in the Program Visualizer display.
You can restrict a search operation to only those files currently displayed in the Program Visualizer.
You can use the Program Visualizer with the editors by double clicking on any line in a file pictograph and displaying the source code for that line in an editor.
You can start the Program Visualizer in several ways:
Use the command line.
If you have CDE installed, use the Program Visualizer icon.
Use the FUSE Control Panel once FUSE is running.
Use the Tools menu from most FUSE tools.
You can start the Program Visualizer from the command line using the following command:
% fusepv [-Xt-options] [-cwd] [path...]
See Appendix Appendix D and the specific reference pages for the command syntax and options.
If the Control Panel is not running, it starts automatically as a minimized icon. If FUSE is already running, the Program Visualizer is placed in the current project.
When you have CDE installed, FUSE provides a FUSE application group icon and icons for the individual tools that make up the FUSE environment.
To invoke the Program Visualizer:
Double click on the Application Manager icon in the CDE Front Panel to display the application group icons.
Double click on the FUSE application group icon to display the icons in the FUSE application group.
Double click on the Program Visualizer icon to start the tool.
To start the Program Visualizer from the FUSE Control Panel, select Porting Assistant from the Tools menu in the Control Panel. FUSE first lists the tool in the Control Panel under the current project. Then the tool main window appears.
Like all tools, the Program Visualizer inherits its working directory from that set for the current project.
Most FUSE tools have a Tools menu. To start a tool, select the tool from the Tools menu.
The Program Visualizer uses some terminology with which you might not be familiar. The following table defines some Program Visualizer terms:
Term | Definition |
File Pictograph |
A vertical, rectangular graphic that represents information about a file in a nontextual manner. Each pictograph represents a single file. The size of a pictograph is scaled to the size of the source file, that is, the number of lines within the file. |
DataSet |
A container file used for grouping data that is passed to the Program Visualizer for display. FUSE tools that send data to the Program Visualizer logically group and encapsulate their data into a DataSet. The Program Visualizer can display multiple DataSets in the display area. |
Event |
The results of some action. For example, if you perform a search inquiry that searches each source file for a particular string, each instance in which the string is found is considered an event. |
You can visualize data in two ways: using the Program Visualizer in conjunction with another FUSE tool, or opening the Program Visualizer and specifying the data that you want to visualize.
When you use the Program Visualizer in conjunction with another FUSE tool, that tool performs its operation, creates a DataSet file that contains the results of its operation, and then starts the Program Visualizer and opens the DataSet file it created. When you start the Program Visualizer without using another FUSE tool, the Program Visualizer's display area is blank. After you start the Program Visualizer, you must specify the data you want to visualize.
The Program Visualizer can visualize multiple DataSets and multiple files at one time:
To open a DataSet,
choose Open DataSet from the DataSet menu and choose the desired
DataSet from the selection dialog box.
A DataSet has a
.vds
file extension.
To open a single file, choose Open File from the File menu and choose the desired file from the selection dialog box.
To open all the files in a directory, choose Open Directory and choose the desired directory.
The Program Visualizer can visualize data from the following file types:
C programming source files
C++ programming source files
FORTRAN programming source files
Pascal programming source files
COBOL programming source files
DEC Ada programming source files
ASCII text files
When you open a file or a DataSet, the Program Visualizer uses file pictographs to represent your source files. If you have a color monitor, the file pictographs might have a number of colored lines within them. These colored lines represent the different data objects within the source files. Table Table 19-1 lists the data objects that can be displayed and their corresponding default color.
This data object... | Displays as this color... |
Start of a function |
Red |
Comments |
Green |
Executable code |
Gray |
Events |
Colors differ depending on the type of event and the color settings in the DataSet Control window |
In addition to the color coding of data objects, the Program
Visualizer indents the gray executable code to help identify programming
structures, such as
if-then-else
statements.
The
Program Visualizer allows you to save the current contents of the
Program Visualizer display area to a DataSet file.
All the DataSets
and files currently being displayed are saved into the specified
DataSet, without affecting the original DataSets or files.
For example,
if you have the DataSets
memoryleaks.vds
and
search1.vds
open, you can save this display into
a new DataSet file called
searchleaks.vds
.
When
you open the DataSet
searchleaks.vds
, it contains
everything you were viewing from
memoryleaks.vds
and
search1.vds
at the time you performed the
save.
To save the current display to a DataSet file, choose Save DataSet from the DataSet menu and enter the desired name and directory for the new DataSet file you want to create.
When you open the new DataSet, you must use the Open DataSet option on the DataSet menu.
Events are the results of some action. Examples are:
Memory access error
Memory leak above a certain size
Executed line whose CPU time exceeds a user-defined value
Program function not executed in a test run of the program
Occurrence of a text string
An event is typically associated with a single line in a file. However, an event could be associated with a range of lines or a complete function.
The following sections discuss how you can display information about an event and how you can easily keep track of those events that you have reviewed.
When you press MB1 while the cursor is over an event, a small, horizontal, rectangular flyby window is displayed. The flyby window usually gives you a one-line description of the event.
When multiple events are associated with a line, only the top event is displayed.
Figure Figure 19-2 is an example of the Event Description Flyby window.
When you choose the Open DataSet Control window option from the Control menu, the DataSet Control window is displayed. This window allows you to choose which events you want displayed in the main window. The DataSet Control window also allows you to turn on and turn off syntax coloring.
To turn on or turn off the display of events, click on the toggle button next to the desired event. When the event is turned on, the toggle button is depressed.
When you choose the Open Event Window... option from the Control menu, all the events for the first file shown in the main window are displayed in the Event window along with the following information:
The name of the file containing the events (displayed at the top of the Event window)
The line number on which the event occurred
A check mark toggle button after the line number used for event-tracking purposes (see Section Section 19.6.4 for additional information on tracking events)
A brief description of the event
When the Event window is displayed, an Event Selection slider also appears in the main window display area. When you press and hold MB1 while dragging the slider over an event, the Event window is updated to contain information about the events within the file that the slider is on.
The Program Visualizer allows you to maintain a status on which events you marked and which events you have not marked. You can see the status of an event from the Event window. Marked events have a check mark between the line number and the event description.
To mark an event, click on the check box beside the event in the Event window. To change a marked event to an unmarked status, click on the check box beside the event. The check mark should disappear.