![]() |
![]() HP OpenVMS Systems |
![]() |
DEC Ada
|
Previous | Contents | Index |
Tools and utilities of particular importance are as follows:
The compiler generates a debugger symbol table as part of the object module for use with the host system debugger for full symbolic debugging. Optionally, it also generates a data analysis file for use with the source code analyzer or cross-reference tool and a diagnostic file for use with the language-sensitive editor (LSE).
Table E-7 lists some of the development tools and utilities on the DEC Ada and GNAT.
Tool or Utility Type | Product Name on DEC Ada for OpenVMS | Product Name on GNAT for OpenVMS Alpha |
---|---|---|
Code management system | DIGITAL CMS 3 | DIGITAL CMS 1 |
Editor | DIGITAL LSE 3 | emacs or DIGITAL LSE 2 |
Debugger | OpenVMS Debugger | gdb |
Source code analyzer/cross referencer | DIGITAL SCA 3 | GNAT XREF |
Test manager | DIGITAL Test Manager 3 | DIGITAL Test Manager |
Performance analyzer | DIGITAL PCA 3 | DIGITAL PCA |
Module management | DIGITAL MMS 3 | Not applicable for GNAT |
Example F-1 is a listing from the compilation of a function that computes factorials and shows the format used for generated code.
Example F-2 is a listing from the compilation of a procedure containing a variety of errors and shows the kinds of error reporting provided.
Examples F-1 and F-2 show aspects of the listings available from the DEC Ada compiler. These listings were created on an OpenVMS VAX system.
Example F-1 Generated Code for Factorial Program |
---|
FACTORIAL 16-Sep-1998 14:04:50 DEC Ada V3.5-1 Page 1 01 11-Sep-1998 09:55:30 FACTORIAL.ADA;2 (1) 1 function FACTORIAL (VAL : LONG_INTEGER) return LONG_INTEGER is 2 begin 3 4 if VAL = 0 then 5 return 1; 6 7 elsif VAL < 0 then 8 raise CONSTRAINT_ERROR; 9 10 end if; 11 12 return VAL * FACTORIAL (VAL - 1); 13 14 end; %ADAC-I, Function body FACTORIAL added to library LIB50$:[CMC.ADA.ADALIB.VAXADA_V35_LIB] PORTABILITY SUMMARY ----------- ------- Source program elements which may effect porting this program to other targets and the source line numbers where these elements were detected. Please refer to the manual in ADA$EXAMPLES:DEC_ADA_OVERVIEW_AND_COMPARISON.*. Type STANDARD.LONG_INTEGER is 32 bits on VAX and 64 bits long on Alpha targets 1 4 7 12 FACTORIAL 16-Sep-1998 14:04:50 DEC Ada V3.5-1 Page 2 01 Ada Compilation Statistics 11-Sep-1998 09:55:30 FACTORIAL.ADA;2 (1) VERSION DEC Ada V3.5-1 with the Professional Development Option COMMAND QUALIFIERS ADA/LIST FACTORIAL QUALIFIERS USED /NOANALYSIS_DATA/CHECK/COPY_SOURCE/DEBUG=ALL/ERROR_LIMIT=30/LIST /NOMACHINE_CODE /NODESIGN /NODIAGNOSTICS/LIBRARY=ADA$LIB /LOAD=REPLACE/SMART_RECOMPILATION/NOTE_SOURCE /OPTIMIZE=(TIME,INLINE=NORMAL,SHARE=NORMAL)/SHOW=PORTABILITY /NOSYNTAX_ONLY /WARNINGS=(NOCOMPILATION_NOTES,STATUS=LIST,SUPPLEMENTAL=ALL, WARNINGS=ALL,WEAK_WARNINGS=ALL) INTERNAL TIMING Phase CPU Elapsed Page I/O seconds seconds faults count Initialization 0.33 4.31 1291 12 Accessing Adalib 0.05 0.72 129 6 Parser 0.06 0.81 396 3 Static semantics 0.07 2.28 210 0 IL generation 0.09 2.23 432 4 Code generation 0.02 1.74 220 0 Smart Recompilation 0.04 0.18 74 0 Listing generation 0.01 0.06 28 2 Program library 0.06 0.46 99 10 Analysis data collection 0.00 0.03 7 0 Totals 0.77 13.13 2915 54 COMPILATION STATISTICS Weak warnings: 0 Warnings: 0 Errors: 0 NYIs: 0 Peak working set: 4188 Virtual pages used: 16962 Virtual pages free: 283038 CPU time: 00:00:00.77 (1090 Lines/Minute) Elapsed time: 00:00:13.13 Compilation complete |
Example F-2 Sample Errors |
---|
SAMPLE_ERRORS Project ADADEMO 16-Sep-1998 14:09:19 DEC Ada V3.5-1 Page 1 01 Sample 2 11-Sep-1998 09:57:15 SAMPLE_ERRORS.ADA;2 (1) 1 pragma TITLE("Project ADADEMO", "Sample 2"); 2 3 -- SAMPLE_ERRORS.ADA 4 -- 5 -- A simple program containing a sampling of errors to show the error 6 -- reporting facilities of the DEC Ada compiler 7 -- 8 with SYSTEM; 9 with TEXT_IO; use TEXT_IO; 10 procedure SAMPLE_ERRORS is 11 12 OBJ1 : NO_SUCH_TYPE := 1; ..................1...............2 %ADAC-E, (1) NO_SUCH_TYPE is not declared [LRM 8.3] %ADAC-I, (2) Type checking is not complete; the type required from context is unknown due to a prior error 13 OBJ2 : STRING(1..4) := "a"; 14 OBJ3 : STRING := "abcd"; ..................1 %ADAC-E, (1) Array type STRING in predefined STANDARD is not constrained [LRM 3.2.1(1), 4.8(4)] 15 16 type E is (E1, E2, E3); 17 OBJE : E; ...........1 %ADAC-I, (1) The representation of type E at line 16 is forced here 18 for E use (-1, 5, 18); ...............1 %ADAC-E, (1) The representation of type E at line 16 has already been forced at line 17 [LRM 13.1(6)] 19 20 type T is range 0..255; 21 subtype ST is T range 0.0 .. 10.; .................................1......2..3 %ADAC-E, (3) Missing digit; inserted "0" after "." [LRM 2.4.1(2), 2.4.2(2)] %ADAC-E, (1) Result type of expression is inconsistent with its context, which requires integer type T at line 20 [LRM 8.7] %ADAC-I, (1) For literal 0.0 the result type is any real type (discarded) %ADAC-E, (2) Result type of expression is inconsistent with its context, which requires integer type T at line 20 [LRM 8.7] %ADAC-I, (2) For literal 10.0 the result type is any real type (discarded) 22 23 OBJ4, OBJ5 : array(1..2) := (others => '*'); ....................................1 %ADAC-E, (1) Found ":=" when expecting "of" %ADAC-I, (1) Declaration ignored due to syntactic errors 24 OBJ6 : ADDRESS; ..................1 %ADAC-E, (1) ADDRESS is not declared [LRM 8.3] %ADAC-I, (1) Possibly a selected component of (or use clause for) package SYSTEM in predefined SYSTEM is intended; this would make type ADDRESS in predefined SYSTEM visible 25 26 FILE : FILE_TYPE; SAMPLE_ERRORS Project ADADEMO 16-Sep-1998 14:09:19 DEC Ada V3.5-1 Page 2 01 Sample 2 11-Sep-1998 09:57:15 SAMPLE_ERRORS.ADA;2 27 28 function F (X : E := E'FIRST) return E; ...........1 %ADAC-E, (1) Function specification F has neither a corresponding body nor an INTERFACE pragma [LRM 6.3(3), 13.9(3)] 29 function F (Y : INTEGER := 0) return E is ...........1 %ADAC-E, (1) Function body F does not include any return statements [LRM 6.5(1)] 30 begin 31 OBJE := E'VAL(Y); 32 end; 33 34 pragma PACK(T); .......................1 %ADAC-W, (1) Subtype T at line 20 is not an array or record type; pragma PACK ignored [LRM 13.1(11,12)] 35 pragma UNKNOWN_PRAGMA(T, T+1, OPTION => MAGIC_NUMBER-2); ..................1 %ADAC-W, (1) Pragma UNKNOWN_PRAGMA is not known to DEC Ada; pragma ignored [LRM B] 36 37 begin ........1 %ADAC-I, (1) Function specification F at line 28 has no corresponding body [LRM 6.3(3), 7.1(4), 9.1(1), 12.2(2)] 38 39 OBJ1 := -1 .....................1 %ADAC-E, (1) Inserted ";" at end of line 40 OBJ2 := 'a'; ................1 %ADAC-E, (1) Result type STRING in predefined STANDARD of variable OBJ2 at line 13 is not the same as type CHARACTER in predefined STANDARD of enumeral 'a' in predefined STANDARD [LRM 5.2(1)] 41 42 case OBJE is ...........1 %ADAC-E, (1) Missing values in the range of enumeration type E at line 16 [LRM 3.7.3(3), 4.3(5), 5.4(4)] E3 43 when E1 => null; ..............1 %ADAC-I, (1) Choice E1 overlaps choice E1 .. E2 at line 45 [LRM 3.7.3(3), 4.3(5), 5.4(4)] 44 when E2 => E = 1; ..............1..............2.3 %ADAC-E, (3) Replaced "=" with ":=" %ADAC-E, (2) Type E at line 16 is not a variable [LRM 5.2(1)] %ADAC-I, (1) Choice E2 overlaps choice E1 .. E2 at line 45 [LRM 3.7.3(3), 4.3(5), 5.4(4)] 45 when E1..E2 => null; ..............1 %ADAC-E, (1) E1 from choice E1 .. E2 overlaps another choice for E1 at line 43 [LRM 3.7.3(3), 4.3(5), 5.4(4)] %ADAC-E, (1) E2 from choice E1 .. E2 overlaps another choice for E2 at line 44 [LRM 3.7.3(3), 4.3(5), 5.4(4)] SAMPLE_ERRORS Project ADADEMO 16-Sep-1998 14:09:19 DEC Ada V3.5-1 Page 3 01 Sample 2 11-Sep-1998 09:57:15 SAMPLE_ERRORS.ADA;2 (1) 46 end case; 47 48 OBJE := E'SUCC(F); ..........................1 %ADAC-E, (1) Ambiguous expression; the required type is enumeration type E at line 16, but more than one possible meaning has this type [LRM 8.7] %ADAC-I, (1) For F the meanings considered are call of function specification F (E) with all default parameters returning E declared at line 28 call of function body F (INTEGER) with all default parameters returning E declared at line 29 function specification F (E) returning E declared at line 28 (discarded) function body F (INTEGER) returning E declared at line 29 (discarded) 49 50 LOOPNAME1: 51 loop 52 goto LOOPNAME2; ......................1 %ADAC-E, (1) Block or loop identifier LOOPNAME2 at line 55 is not a label 53 end loop; ......................1 %ADAC-E, (1) Name LOOPNAME1 not specified at end of loop starting at line 50 [LRM 5.5(3), 5.6(3)] 54 55 LOOPNAME2: 56 for I in -1 .. 10 loop ..........................1 %ADAC-E, (1) Type {universal_integer} is not allowed for the discrete range of a constrained array definition, an iteration rule, or an index of an entry family [LRM 3.6.1(2)] %ADAC-I, (1) Default resolution to the type INTEGER does not apply because one or both expressions is not a literal, named number, or attribute; however, the type INTEGER is assumed [LRM 3.6.1(2)] 57 exit LOOPNAME1; ......................1 %ADAC-E, (1) Block or loop identifier LOOPNAME1 at line 50 is not for a loop that encloses this exit statement [LRM 5.7(3)] 58 end loop LOOP2; .......................1 %ADAC-E, (1) Name LOOP2 does not match LOOPNAME2 at line 55 [LRM 5.5(3), 5.6(3), 6.3(4), 7.1(3), 9.5(7)] 59 60 OPEN(FILE, IN_FILE, NAM => "SOME_FILE"); ...............1 %ADAC-E, (1) Inconsistency detected during overload resolution [LRM 8.7] %ADAC-I, (1) For procedure call OPEN the meaning is a call of procedure specification OPEN (FILE : FILE_TYPE; MODE : FILE_MODE; NAME : STRING; FORM : STRING) declared in TEXT_IO at line 32 (discarded because NAM is not the name of any formal parameter) For FILE the meaning is variable FILE at line 26 of limited private type FILE_TYPE in TEXT_IO at line 8 For IN_FILE the meaning is enumeral IN_FILE in TEXT_IO at line 10 of enumeration type FILE_MODE in TEXT_IO at line 10 For literal "SOME_FILE" the result type is any one-dimensional character array type SAMPLE_ERRORS Project ADADEMO 16-Sep-1998 14:09:19 DEC Ada V3.5-1 Page 4 01 Sample 2 11-Sep-1998 09:57:15 SAMPLE_ERRORS.ADA;2 (1) 61 PUT(1); ..............1 %ADAC-E, (1) Inconsistency detected during overload resolution [LRM 8.7] %ADAC-I, (1) For procedure call PUT the meanings considered are call of procedure specification PUT (ITEM : STRING) declared in TEXT_IO at line 123 (discarded because type STRING of formal ITEM is not a possible type of the corresponding actual) call of procedure specification PUT (ITEM : CHARACTER) declared in TEXT_IO at line 116 (discarded because type CHARACTER of formal ITEM is not a possible type of the corresponding actual) call of procedure specification PUT (FILE_TYPE; STRING) declared in TEXT_IO at line 122 (discarded because of too few actual parameters: number of actuals is 1, number of formals is 2) call of procedure specification PUT (FILE_TYPE; CHARACTER) declared in TEXT_IO at line 115 (discarded because of too few actual parameters: number of actuals is 1, number of formals is 2) For literal 1 the result type is any integer type 62 CLOSE(); ...........1....2 %ADAC-E, (2) Empty parentheses ignored %ADAC-E, (1) Inconsistency detected during overload resolution [LRM 8.7] %ADAC-I, (1) For procedure call CLOSE the meaning is a call of procedure specification CLOSE (FILE_TYPE) declared in TEXT_IO at line 37 (discarded because of too few actual parameters: number of actuals is 0, number of formals is 1) 63 64 end; PORTABILITY SUMMARY ----------- ------- Source program elements which may effect porting this program to other targets and the source line numbers where these elements were detected. Please refer to the manual in ADA$EXAMPLES:DEC_ADA_OVERVIEW_AND_COMPARISON.*. Predefined package SYSTEM contains entities which may not be implemented on other targets 8 Enumeration representation clause 18 Unknown pragma(s) 35 Pragma PACK 34 SAMPLE_ERRORS Project ADADEMO 16-Sep-1998 14:09:19 DEC Ada V3.5-1 Page 5 01 Ada Compilation Statistics 11-Sep-1998 09:57:15 SAMPLE_ERRORS.ADA;2 (1) VERSION DEC Ada V3.5-1 with the Professional Development Option COMMAND QUALIFIERS ADA/LIST SAMPLE_ERRORS.ADA QUALIFIERS USED /NOANALYSIS_DATA/CHECK/COPY_SOURCE/DEBUG=ALL/ERROR_LIMIT=30/LIST /NOMACHINE_CODE /NODESIGN /NODIAGNOSTICS/LIBRARY=ADA$LIB /LOAD=REPLACE/SMART_RECOMPILATION/NOTE_SOURCE/OPTIMIZE=(TIME, INLINE=NORMAL,SHARE=NORMAL)/SHOW=PORTABILITY/NOSYNTAX_ONLY /WARNINGS=(NOCOMPILATION_NOTES,STATUS=LIST,SUPPLEMENTAL=ALL, WARNINGS=ALL,WEAK_WARNINGS=ALL) INTERNAL TIMING Phase CPU Elapsed Page I/O seconds seconds faults count Initialization 0.37 2.90 1293 13 Accessing Adalib 0.03 0.49 134 4 Parser 0.22 2.61 558 39 Static semantics 0.61 8.91 327 152 Listing generation 0.04 0.12 29 3 Program library 0.07 0.58 117 18 Analysis data collection 0.00 0.02 6 0 Totals 1.40 15.92 2410 227 COMPILATION STATISTICS Weak warnings: 0 Warnings: 2 Errors: 27 NYIs: 0 Peak working set: 5238 Virtual pages used: 17001 Virtual pages free: 282999 CPU time: 00:00:01.40 (2742 Lines/Minute) Elapsed time: 00:00:15.92 Compilation complete |
Index | Contents |