www.delorie.com/gnu/docs/gcc/gnat_ug.html   search  
 
Buy the book!


Untitled Document

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

Untitled Document

GNAT, The GNU Ada 95 Compiler

GNAT Version 3.16w

Date: $Date: 2002/05/04 03:28:06 $

Ada Core Technologies, Inc.

Copyright (C) 1995-2002, Free Software Foundation

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being "GNU Free Documentation License", with the Front-Cover Texts being and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

About This Guide  
1. Getting Started with GNAT  
2. The GNAT Compilation Model  
3. Compiling Using gcc  
4. Binding Using gnatbind  
5. Linking Using gnatlink  
6. The GNAT Make Program gnatmake  
7. Renaming Files Using gnatchop  
8. Configuration Pragmas  
9. Handling Arbitrary File Naming Conventions Using gnatname  
10. GNAT Project Manager  
11. Elaboration Order Handling in GNAT  
12. The Cross-Referencing Tools gnatxref and gnatfind  
13. File Name Krunching Using gnatkr  
14. Preprocessing Using gnatprep  
15. The GNAT Library Browser gnatls  
16. GNAT and Libraries  
17. Using the GNU make Utility  
18. Finding Memory Problems with gnatmem  
19. Finding Memory Problems with GNAT Debug Pool  
20. Creating Sample Bodies Using gnatstub  
21. Reducing the Size of Ada Executables with gnatelim  
22. Other Utility Programs  
23. Running and Debugging Ada Programs  
24. Inline Assembler  
25. Performance Considerations  
GNU Free Documentation License  
Index  

 -- The Detailed Node Listing ---

About This Guide

What This Guide Contains  
What You Should Know before Reading This Guide  
Related Information  
Conventions  

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 Alternative File Naming Schemes  
2.6 Generating Object Files  
2.7 Source Dependencies  
2.8 The Ada Library Information Files  
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 gcc

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

Switches for gcc

3.2.1 Output and Error Message Control  
3.2.2 Debugging and Assertion Control  
3.2.5 Run-Time Checks  
3.2.6 Stack Overflow Checking  
3.2.7 Run-Time Control  
3.2.3 Validity Checking  
3.2.4 Style Checking  
3.2.8 Using gcc for Syntax Checking  
3.2.9 Using gcc for Semantic Checking  
3.2.10 Compiling Ada 83 Programs  
3.2.11 Character Set Control  
3.2.12 File Naming Control  
3.2.13 Subprogram Inlining Control  
3.2.14 Auxiliary Output Control  
3.2.15 Debugging Control  
3.2.16 Units to Sources Mapping Files  

Binding Ada Programs With gnatbind

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

Linking Using gnatlink

5.1 Running gnatlink  
5.2 Switches for gnatlink  
5.3 Setting Stack Size from gnatlink  
5.4 Setting Heap Size from 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  

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 Files  

Handling Arbitrary File Naming Conventions Using gnatname

9.1 Arbitrary File Naming Conventions  
9.2 Running gnatname  
9.3 Switches for gnatname  
9.4 Examples of gnatname Usage  

GNAT Project Manager

10.1 Introduction  
10.2 Examples of Project Files  
10.3 Project File Syntax  
10.4 Objects and Sources in Project Files  
10.5 Importing Projects  
10.6 Project Extension  
10.7 External References in Project Files  
10.8 Packages in Project Files  
10.9 Variables from Imported Projects  
10.10 Naming Schemes  
10.11 Library Projects  
10.12 Switches Related to Project Files  
10.13 Tools Supporting Project Files  
10.14 An Extended Example  
10.15 Project File Complete Syntax  

Elaboration Order Handling in GNAT

11.1 Elaboration Code in Ada 95  
11.2 Checking the Elaboration Order in Ada 95  
11.3 Controlling the Elaboration Order in Ada 95  
11.4 Controlling Elaboration in GNAT - Internal Calls  
11.5 Controlling Elaboration in GNAT - External Calls  
11.6 Default Behavior in GNAT - Ensuring Safety  
11.7 Elaboration Issues for Library Tasks  
11.8 Mixing Elaboration Models  
11.9 What to Do If the Default Elaboration Behavior Fails  
11.10 Elaboration for Access-to-Subprogram Values  
11.11 Summary of Procedures for Elaboration Control  
11.12 Other Elaboration Order Considerations  

The Cross-Referencing Tools gnatxref and gnatfind

12.1 gnatxref Switches  
12.2 gnatfind Switches  
12.3 Project Files for gnatxref and gnatfind  
12.4 Regular Expressions in gnatfind and gnatxref  
12.5 Examples of gnatxref Usage  
12.6 Examples of gnatfind Usage  

File Name Krunching Using gnatkr

13.1 About gnatkr  
13.2 Using gnatkr  
13.3 Krunching Method  
13.4 Examples of gnatkr Usage  

Preprocessing Using gnatprep

14.1 Using gnatprep  
14.2 Switches for gnatprep  
14.3 Form of Definitions File  
14.4 Form of Input Text for gnatprep  

The GNAT Library Browser gnatls

15.1 Running gnatls  
15.2 Switches for gnatls  
15.3 Example of gnatls Usage  

GNAT and Libraries

16.1 Creating an Ada Library  
16.2 Installing an Ada Library  
16.3 Using an Ada Library  
16.4 Creating an Ada Library to be Used in a Non-Ada Context  
16.5 Rebuilding the GNAT Run-Time Library  

Using the GNU make Utility

17.1 Using gnatmake in a Makefile  
17.2 Automatically Creating a List of Directories  
17.3 Generating the Command Line Switches  
17.4 Overcoming Command Line Length Limits  

Finding Memory Problems with gnatmem

18.1 Running gnatmem (GDB Mode)  
18.2 Running gnatmem (GMEM Mode)  
18.3 Switches for gnatmem  
18.4 Example of gnatmem Usage  
18.5 GDB and GMEM Modes  
18.6 Implementation Note  

Finding Memory Problems with GNAT Debug Pool

Creating Sample Bodies Using gnatstub

20.1 Running gnatstub  
20.2 Switches for gnatstub  

Reducing the Size of Ada Executables with gnatelim

21.1 About gnatelim  
21.2 Eliminate Pragma  
21.3 Tree Files  
21.4 Preparing Tree and Bind Files for gnatelim  
21.5 Running gnatelim  
21.6 Correcting the List of Eliminate Pragmas  
21.7 Making Your Executables Smaller  
21.8 Summary of the gnatelim Usage Cycle  

Other Utility Programs

22.1 Using Other Utility Programs with GNAT  
22.2 The gnatpsta Utility Program  
22.3 The External Symbol Naming Scheme of GNAT  
22.4 Ada Mode for Glide  
22.5 Converting Ada Files to html with gnathtml  

Running and Debugging Ada Programs

23.1 The GNAT Debugger GDB  
23.2 Running GDB  
23.3 Introduction to GDB Commands  
23.4 Using Ada Expressions  
23.5 Calling User-Defined Subprograms  
23.6 Using the Next Command in a Function  
23.7 Breaking on Ada Exceptions  
23.8 Ada Tasks  
23.9 Debugging Generic Units  
23.10 GNAT Abnormal Termination or Failure to Terminate  
23.11 Naming Conventions for GNAT Source Files  
23.12 Getting Internal Debugging Information  
23.13 Stack Traceback  

Inline Assembler

24.1 Basic Assembler Syntax  
24.2 A Simple Example of Inline Assembler  
24.3 Output Variables in Inline Assembler  
24.4 Input Variables in Inline Assembler  
24.5 Inlining Inline Assembler Code  
24.6 Other Asm Functionality  
24.7 A Complete Example  

Performance Considerations

25.1 Controlling Run-Time Checks  
25.2 Optimization Levels  
25.3 Debugging Optimized Code  
25.4 Inlining of Subprograms  

Index  


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003