[Top] [Contents] [Index] [ ? ]

GNAT User's Guide

GNAT User's Guide

GNAT, The GNU Ada 95 Compiler

GNAT Version 3.12p

Date: $Date: 1999/06/28 18:09:34 $

Ada Core Technologies, Inc.

(C) Copyright 1995-1999, Ada Core Technologies, Inc.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Silicon Graphics and IRIS are registered trademarks and IRIX is a trademark of Silicon Graphics, Inc.

IBM PC is a trademark of International Business Machines Corporation.

UNIX is a registered trademark of AT&T Bell Laboratories.

The following are trademarks of Compaq Computers: DEC, DEC Ada, DECthreads, DIGITAL, DECset, OpenVMS, and VAX.

The following are trademarks of Microsoft Corporation: Windows NT, Windows 95, Windows 98.

The following are trademarks of Wind River Systems: VxWorks, Tornado.

About This Guide  
1. Getting Started With GNAT  
2. The GNAT Compilation Model  
3. Compiling Using gnatgcc  
4. Binding Using gnatbind  
5. Linking Using gnatlink  
6. The GNAT Make Program gnatmake  
7. Renaming Files Using gnatchop  
8. Configuration Pragmas  
9. Elaboration Order Handling in GNAT  
10. The cross-referencing tools gnatxref and gnatfind  
11. File Name Krunching Using gnatkr  
12. Preprocessing Using gnatprep  
13. The GNAT library browser gnatls  
14. Rebuilding the GNAT Library  
15. Finding memory problems with gnatmem  
16. ASIS-Based Tools  
17. Creating Sample Bodies Using gnatstub  
18. Minimizing Executables for Ada Programs Using gnatelim  
19. Other Utility Programs  
20. Running and Debugging Ada Programs  
21. Performance Considerations  

 -- The Detailed Node Listing ---

About This Guide

What This Guide Contains  
What You Should Know Before Reading This Guide  
Related Information  

Getting Started With GNAT

1.1 Running GNAT  
1.2 Running a Simple Ada Program  
1.3 Running a Program With Multiple Units  
1.4 Using the gnatmake Utility  

The GNAT Compilation Model

2.1 Source Representation  
2.2 Foreign Language Representation  
2.3 File Naming Rules  
2.4 Using Other File Names  
2.5 Generating Object Files  
2.6 Source Dependencies  
2.7 The Ada Library Information Files  
2.8 Representation of Time Stamps  
2.9 Binding an Ada Program  
2.10 Mixed Language Programming  
2.11 Building mixed Ada & C++ programs  
2.12 Comparison between GNAT and C/C++ Compilation Models  
2.13 Comparison between GNAT and Conventional Ada Library Models  

Foreign Language Representation

2.2.1 Latin-1  
2.2.2 Other 8-Bit Codes  
2.2.3 Wide Character Encodings  

Compiling Ada Programs With gnatgcc

3.1 Compiling Programs  
3.2 Switches for gnatgcc  
3.3 Search Paths and the Run-Time Library (RTL)  
3.4 Order of Compilation Issues  
3.5 Examples  

Switches for gnatgcc

3.2.1 Output and Error Message Control  
3.2.2 Debugging and Assertion Control  
3.2.4 Run-time Checks  
3.2.3 Style Checking  
3.2.5 Using gnatgcc for Syntax Checking  
3.2.6 Using gnatgcc for Semantic Checking  
3.2.7 Compiling Ada 83 Programs  
3.2.8 Reference Manual Style Checking  
3.2.9 Character Set Control  
3.2.10 File Naming Control  
3.2.11 Subprogram Inlining Control  
3.2.12 Auxiliary Output Control  
3.2.13 Debugging Control  

Binding Ada Programs With gnatbind

4.1 Running gnatbind  
4.2 Consistency-Checking Modes  
4.3 Binder Error Message Control  
4.4 Elaboration Control  
4.5 Output Control  
4.6 Binding with Non-Ada Main Programs  
4.7 Binding Programs with no Main Subprogram  
4.8 Summary of Binder Switches  
4.9 Command-Line Access  
4.10 Search Paths for gnatbind  
4.11 Examples of gnatbind Usage  

Linking Using gnatlink

5.1 Running gnatlink  
5.2 Switches for gnatlink  

The GNAT Make Program gnatmake

6.1 Running gnatmake  
6.2 Switches for gnatmake  
6.3 Mode switches for gnatmake  
6.4 Notes on the Command Line  
6.5 How gnatmake Works  
6.6 Examples of gnatmake Usage  
6.7 Gnatmake in makefiles  

Renaming Files Using gnatchop

7.1 Handling Files with Multiple Units  
7.2 Operating gnatchop in Compilation Mode  
7.3 Command Line for gnatchop  
7.4 Switches for gnatchop  
7.5 Examples of gnatchop Usage  

Configuration Pragmas

8.1 Handling of Configuration Pragmas  
8.2 The Configuration Pragmas file  

Elaboration Order Handling in GNAT

9.1 Elaboration Code in Ada 95  
9.2 Checking the Elaboration Order in Ada 95  
9.3 Controlling the Elaboration Order in Ada 95  
9.4 Controlling Elaboration in GNAT - Internal Calls  
9.5 Controlling Elaboration in GNAT - External Calls  
9.6 Default Behavior in GNAT - Ensuring Safety  
9.7 What to do if the Default Elaboration Behavior Fails  
9.8 Elaboration for Access-to-Subprogram Values  
9.9 Summary of Procedures for Elaboration Control  

The cross-referencing tools gnatxref and gnatfind

10.1 Gnatxref switches  
10.2 Gnatfind switches  
10.3 Project files  
10.4 Regular expressions in gnatfind and gnatxref  
10.5 Examples of gnatxref usage  
10.6 Examples of gnatfind usage  

File Name Krunching Using gnatkr

11.1 About gnatkr  
11.2 Using gnatkr  
11.3 Krunching Method  
11.4 Examples of gnatkr Usage  

Preprocessing Using gnatprep

12.1 Using gnatprep  
12.2 Switches for gnatprep  
12.3 Form of definitions file  
12.4 Form of input text for gnatprep  

The GNAT library browser gnatls

13.1 Running gnatls  
13.2 Switches for gnatls  
13.3 Example of gnatls Usage  

Rebuilding the GNAT Library::

Finding memory problems with gnatmem

15.1 Running gnatmem  
15.2 Switches for gnatmem  
15.3 Example of gnatmem Usage  
15.4 Implementation note  

ASIS-Based Tools

16.1 The ASIS Implementation for GNAT (ASIS-for-GNAT)  
16.2 Tree Files  

Creating Sample Bodies Using gnatstub

17.1 Running gnatstub  
17.2 Switches for gnatstub  

Minimizing Executables for Ada Programs Using gnatelim

18.1 About gnatelim  
18.2 Eliminate pragma  
18.3 Preparing Tree and Bind Files for gnatelim  
18.4 Running gnatelim  
18.5 Correcting the List of Eliminate Pragmas  
18.6 Making your Executables smaller  
18.7 Summary of the gnatelim Usage Cycle  

Other Utility Programs

19.1 Using Other Utility Programs With GNAT  
19.2 The gnatpsys Utility Program  
19.3 The gnatpsta Utility Program  
19.4 The External Symbol Naming Scheme of GNAT  
19.5 Ada Mode for emacs  
19.9 Converting Ada files to html using gnathtml  

Running and Debugging Ada Programs

20.1 The GNAT Debugger GDB  
20.2 Running GDB  
20.3 Introduction to GDB Commands  
20.4 Using Ada Expressions  
20.5 Calling User-Defined Subprograms  
20.6 Breaking on Ada Exceptions  
20.7 Ada Tasks  
20.8 Debugging Generic Units  
20.9 GNAT Abnormal Termination  
20.10 Naming Conventions for GNAT Source Files  
20.11 Getting Internal Debugging Information  

Performance Considerations

21.1 Controlling Run-time Checks  
21.2 Optimization Levels  
21.3 Inlining of Subprograms  


This document was generated by Tom Bennet on August, 25 2000 using texi2html