This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] New switch -gnatl=xxx


Tested on i686-linux, committed on trunk.

This patch implements a new feature allowing full listing output to
be directed to a file. This is achieved with the switch -gnatl=xxx
where xxx is either a file name, or an extension starting with period.
In the latter case the output is to filename.extension (or in the
case of VMS, filename_extension).

If the following program is compiled with -gnatl=.lst -gnatd7

procedure h is
begin
   null
end;

Then the output in file h.adb.lst is to:

GNAT 4.3.0 20061030 (experimental)
Copyright 1992-2006, Free Software Foundation, Inc.

Compiling: h.adb

     1. procedure h is
     2. begin
     3.    null
               |
        >>> missing ";"

     4. end;

 4 lines: 1 error

This patch also changes the behavior of -gnatl.
The listing now includes not only the main source
but all source files in the extended main source unit (including
the package spec and all subunits).

An example of the patch in action is the following listing from
compiling p.adb with the switch -gnatld7

Compiling: p.adb

     1. package body p is
     2.    procedure a;
     3.    procedure a is separate;
     4. begin
     5.    null
               |
        >>> missing ";"

     6. end;

Compiling: p.ads

     1. package p is
     2.    pragma Elaborate_Body
                                |
        >>> missing ";"

     3. end p;

Compiling: p-a.adb

     1. separate p
                |
        >>> missing "("

     2. procedure a is
     3. begin
     4.    null
               |
        >>> missing ";"

     5. end;

 6 lines: 4 errors

2006-10-31  Robert Dewar  <dewar@adacore.com>

	* errout.ads, errout.adb (Finalize): Implement switch -gnatd.m
	Avoid abbreviation Creat
	(Finalize): List all sources in extended mail source if -gnatl
	switch is active.
	Suppress copyright notice to file in -gnatl=f mode if -gnatd7 set
	(Finalize): Implement new -gnatl=xxx switch to output listing to file
	(Set_Specific_Warning_On): New procedure
	(Set_Specific_Warning_Off): New procedure
	Add implementation of new insertion \\
	(Error_Msg_Internal): Add handling for Error_Msg_Line_Length
	(Unwind_Internal_Type): Improve report on anonymous access_to_subprogram
	types.
	(Error_Msg_Internal): Make sure that we set Last_Killed to
	True when a message from another package is suppressed.
	Implement insertion character ~ (insert string)
	(First_Node): Minor adjustments to get better placement.

	* frontend.adb: 
	Implement new -gnatl=xxx switch to output listing to file

	* gnat1drv.adb: 
	Implement new -gnatl=xxx switch to output listing to file

        * opt.ads: (Warn_On_Questionable_Missing_Paren): New switch
	(Commands_To_Stdout): New flag
	Implement new -gnatl=xxx switch to output listing to file
	New switch Dump_Source_Text
	(Warn_On_Deleted_Code): New warning flag for -gnatwt
	Define Error_Msg_Line_Length
	(Warn_On_Assumed_Low_Bound): New switch

	* osint.ads, osint.adb
	(Normalize_Directory_Name): Fix bug.
	Implement new -gnatl=xxx switch to output listing to file
	(Concat): Removed, replaced by real concatenation
	Make use of concatenation now allowed in compiler
	(Executable_Prefix.Get_Install_Dir): First get the full path, so that
	we find the 'lib' or 'bin' directory even when the tool has been
	invoked with a relative path.
	(Executable_Name): New function taking string parameters.

	* osint-c.ads, osint-c.adb: 
	Implement new -gnatl=xxx switch to output listing to file

	* sinput-d.adb: Change name Creat_Debug_File to Create_Debug_File

	* switch-c.adb: 
	Implement new -gnatl=xxx switch to output listing to file
	Recognize new -gnatL switch
	(no longer keep in old warning about old style usage)
	Use concatenation to simplify code
	Recognize -gnatjnn switch
	(Scan_Front_End_Switches): Clean up handling of -gnatW
	(Scan_Front_End_Switches): Include Warn_On_Assumed_Low_Bound for -gnatg

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]