TOC PREV NEXT INDEX DOC LIST MASTER INDEX



Display_Expanded_Type_Structure

This command recursively expands all components of composite types into an indented hierarchy for easy structural understanding and traversal.

The hypertable output displays all component types with the type size if it is statically computable. This can be useful for visualizing the internal structure and memory usage of complex type structures that become highly nested with object-oriented programming techniques.

Note: At present, the locator section of the dialog box for this command has no effect. The Of_Type field at the top of the dialog box identifies the type for which an expanded display should be generated. Use of selection in an Ada window is the best way to fill this field with a valid reference. Name references can also have the form "Package_Name.5D." This references the fifth declaration in the package named Package_Name. Note that use clauses and representation specifications are not counted as declarations, but pragmas are counted. Apex will often use these name references to specify a particular declaration.

Command-Line Interface

Display_Expanded_Type_Structure
  -To_Depth [positive-expression, default = 999]
  -Expand_Access_Types
  -Full_Expansion
  -Display_In_Bytes
  -Display_In_Words
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/type_hierarchy]
  -Of_Type [string-expression, default = ""]

Nonstandard Parameters

Note: Only one of the Display_In_Bytes and Display_In_Words options should be enabled at any one time. If both are present, the last one in the option string takes precedence.

Sample Output

Display_Inter_Subsystem_References

This command displays all inter-subsystem references (that is, library units in one subsystem that with units in other subsystems). For each subsystem in the specified configuration or view list, all references to library units in other subsystems are listed. A second output section provides a list of all referenced units. Each unit is followed by a list of units that reference (that is, with) that unit and the subsystem in which those referencing units are located.

This report shows a cross-referenced list of inter-subsystem dependencies, as specified by with clauses. It can serve as reference material for new developers, testers, managers, or others who are not familiar with the subsystem structure. More importantly, it can reveal architectural anomalies that may have been unintentionally introduced during development or maintenance. These can include undesirable reverse dependencies, from a lower layer (base subsystem) to a higher layer (application subsystem), as well as less severe layer-skipping downward dependencies. Portability issues can also be identified via references to compiler-supplied units that may be unique to the vendor.

Command-Line Interface

Display_Inter_Subsystem_References
  -In_Configuration [string-expression, default = ""]
  -Sort_Subsystems_In_Dependency_Order
  -To_Report_Named [string-expression, default =
      <default_output_directory>/inter_subsystem_references]
  <list of views>

Nonstandard Parameters

Sample Output

Units Referenced in Other Subsystems
Table 1 - Units Referenced by ada_analyzer.ss/rev2.wrk:

  In subsystem rule_library:
        Compatibility_Checks
        Standards_Conformance_Checks
  In subsystem utilities:
        Ada_Element_Counting
        Ada_Hyper_Table_Generic
        Ada_Hyper_Tables_Generic
        Ada_Object_Traversal

Note: Because of the large number of references, no traversal is enabled for this report. It is primarily intended as reference material.

Units Referencing a Specific Unit
Table 2 - Unit Dependency Cross-References

    Boolean_Expressions (Utilities):
      Case_On_Discriminant_Enclosed_By_If (Rule_Library)
      Equality_Operators_For_Real_Types (Rule_Library)
      If_Replaceable_By_Case (Rule_Library)
      Locate_Potential_Programming_Errors (Ada_Analyzer)
      Locate_Short_Circuit_Opportunities (Ada_Analyzer)
      Negative_Condition_Usage (Rule_Library)
      Non_Short_Circuit_Operators (Rule_Library)
    Bounds_Utilities (Utilities):
      Divide_By_Zero (Rule_Library)
      If_Replaceable_By_Case (Rule_Library)
      Locate_Expressions (Ada_Analyzer)
      Locate_Others_Clauses (Ada_Analyzer)
      Locate_Potential_Programming_Errors (Ada_Analyzer)
      Locate_Type_Declarations (Ada_Analyzer)

Note: Because of the large number of references, no traversal is enabled for this report. It is primarily intended as reference material.

Display_Set_Twice_Before_Use

This command traverses a subprogram or set of subprograms and identifies local variables that are set twice before they are ever used. A variable can be set in any of the following ways:

An uninitialized variable is a program error that is very difficult to find. Multiple initialization of a variable before its value is used can increase code size and execution time. This command will locate areas where these inefficiencies can be reduced. The Display_Set_Use_Problems command should be used in conjunction with this command to locate variables that are used before they are set.

Command-Line Interface

Display_Set_Twice_Before_Use
  -Track_All_Record_Components
  -Include_All_Path_Violations
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/set_twice_before_use_analysis]
  <list of units>

Nonstandard Parameters

Sample Output

The output on the previous page was generated from the following input program:

procedure Set_Twice_Variables is
    type Rec_With_Init is
       record
          A : Integer := 9;
          B : Boolean;
       end record;
    type Rec_No_Init is
       record
          A : Integer;
       end record;
    B    : Boolean;
    Var1 : Integer;
    Var2 : Integer;
    Var3 : Integer := 6;
    Var4 : Rec_No_Init;
    Var5 : Rec_With_Init;
    Var6 : Rec_With_Init;
    procedure P (A : out Integer) is
    begin
        null;
    end P;
begin
    if B then
        Var1 := 8;       -- no problem
        Var2 := 6;
        P (Var2);        -- problem
    else
        Var3   := 8;     -- problem
        Var4.A := 8;     -- no problem
        Var5.A := 9;     -- problem
        Var5.B := True;  -- no problem
        Var4.A := 88;    -- problem
        P (Var6.A);      -- problem
    end if;
end Set_Twice_Variables;

Display_Set_Use_Problems

This command traverses a subprogram or set of subprograms and identifies the following potential problems:

Uninitialized variables are one of the most difficult program errors to locate. When they occur in fielded systems, they are even more difficult to isolate. This command locates such variables using a program-interpretation technique to walk all paths and account for each variable read and updated along that path.

Command-Line Interface

Display_Set_Use_Problems
  -Include_In_Out_Parameters
  -Track_All_Record_Components
  -Include_All_Path_Violations
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/set_use_problem_analysis]
  <list of units>

Nonstandard Parameters

Note: An in out parameter that is not set does not necessarily indicate a problem with the code.

Sample Output

The output on the previous page was generated from the following program:

An_Exception_1 : exception;
An_Exception_2 : exception;
type Rec_1 is
    record
       Bool_1 : Boolean := True;
    end record;
type Rec_2 is
    record
       Bool_2 : Boolean;
    end record;
type Acc is access Rec_2;

procedure Proc (B : out Character; Bool : in out Boolean) is
    Local_A : Integer := 7;
    Local_B, New_C : Character;
    R1      : Rec_1;
    R2      : Rec_2;
    An_Acc  : Acc;
    Int     : Integer;
begin
    if An_Acc = null then
        if Local_A = Int then
            Local_B := '6';
            B       := '7';
            if Local_B = New_C then
                raise An_Exception_1;
            else
                Bool := True;
                raise An_Exception_2;
            end if;
        elsif Local_B = New_C then
            if R1.Bool_1 then
                B := '9';
            elsif R2.Bool_2 then
                while Bool = False loop
                    B := 'h';
                end loop;
            end if;
        end if;
    end if;
exception
    when An_Exception_1 =>
       null;
end Proc;

Display_Subprogram_Branch_Points

This command locates all branch points in a subprogram or set of subprograms. A branch point is a case, if, exit, loop, return, or raise statement. The output is presented in indented form to show nesting of branch points.

This output can help in the construction of coverage tests. The branching information can be used to locate each path and the set/used information can be used to understand the input variables for each path and the items updated along that path.

Command-Line Interface

Display_Subprogram_Branch_Points
  -Expanded_Output
  -Include_Value_Ranges
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/branching_analysis]
  -In_Unit_Or_Subprogram [string-expression, default = ""]

Nonstandard Parameters

Sample Output

Expanded Format

Display_Subprogram_Execution_Problems

This command traverses a subprogram or set of subprograms and identifies the following potential problems:

Functions with no return statement on each path may not be caught during testing and therefore can be a very costly bug in fielded systems. The use of nonvisible exceptions is not a bug and may even be the best implementation strategy in some cases, but it can be high risk to future maintenance and update efforts.

Command-Line Interface

Display_Subprogram_Execution_Problems
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/subprogram_execution_problem_analysis]
  <list of units>

Nonstandard Parameters

All parameters are standard parameters.

Sample Output

Nonvisible Exception Raise

Note: The above output was generated from the input program example for the Display_Set_Use_Problems command.

Return Not Found on Path

Note: The output in this table was generated from the input program example given for the Display_Set_Twice_Before_Use command.

Display_Subsystem_Import_Closure

This command displays the complete import closure of all subsystems in a configuration or view. The importing structure is displayed in an indented hierarchy with all imports listed for each view in the configuration. Output is sorted into a hierarchy with the topmost subsystems in the import closure at the beginning (top) of the output. All views are placed in a hypertable for easy location and traversal.

Command-Line Interface

Display_Subsystem_Import_Closure
  -Full_Expansion
  -To_Report_Named [string-expression, default =
      <default_output_directory>/subsystem_import_expansion]
 <list of views>

Nonstandard Parameters

Sample Output

Display_Unit_Construct_Counts

This command generates hypertables containing counts of various Ada constructs that appear in the specified set of units. The following major constructs are counted:

Within the major classes, the following subclasses of Ada constructs are counted:

The Display_Unit_Construct_Counts procedure counts each selected construct in each unit and displays unit counts in rows of the output table.

This command can be used to profile software and recognize patterns in the development constructs used most frequently in the project.

Command-Line Interface

Display_Unit_Construct_Counts
  -Include_Unit_Totals
  -Display_Totals_Only
  -Include_Major_Element_Counts
  -Include_Comp_Unit_Kind_Counts
  -Include_Declaration_Kind_Counts
  -Include_Statement_Kind_Counts
  -Include_Pragma_Kind_Counts
  -Include_Context_Clause_Kind_Counts
  -Include_Rep_Clause_Kind_Counts
  -Include_Length_Clause_Kind_Counts
  -Include_Parameter_Mode_Counts
  -Include_Generic_Parameter_Mode_Counts
  -Include_Loop_Kind_Counts
  -Include_Select_Alternative_Kind_Counts
  -Include_Expression_Kind_Counts
  -Include_Type_Definition_Kind_Counts
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/unit_construct_counts]
  <list of units>

Nonstandard Parameters

Sample Output

Note: Because of the high volume of information in these reports, no traversal connections are included.

Display_Unit_Declarations

This command displays the declarations of an Ada unit but filters out the clutter that is often associated with full code. Declarations are presented in a hierarchical format similar to the code itself. Comments, blank lines, and other extraneous details are not included. This provides a high-level representation of code that is easy to scan for overall structure. Traversal to the actual code is always available when more detail is necessary. Use clauses, pragmas, and representation specifications can be included by selecting command options. Additional abbreviated information about each declaration is provided in other columns of the report.

Subprogram and task bodies can also be expanded with the Expand_Bodies option. This will display the overall structure of the bodies including all local and nested declarations, exception handlers, and all accept statements in the case of tasks.

The output provides a condensed view of a unit or set of units. This can be very useful to get an overview of a unit's definition. Traversal is available to the code to see more detail or associated comments.

Command-Line Interface

Display_Unit_Declarations
  -To_Depth [positive-expression, default = 999]
  -Include_Pragmas
  -Include_Rep_Specs
  -Include_Use_Clauses
  -Expand_Bodies
  -Verbose
  -Use_Configuration [string-expression, default = ""]
  -To_Report_Named [string-expression, default =
      <default_output_directory>/unit_declarations]
  <list of units>

Nonstandard Parameters

Sample Output


Rational Software Corporation  http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2000, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX DOC LIST MASTER INDEX