aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/osint.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-05-06 10:11:41 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-05-06 10:11:41 +0200
commit3743d5bde63e99c32d5cdc930485b279d111bca2 (patch)
tree7b40ce34cdf446910efb8a5c3d278df8429b4f5a /gcc/ada/osint.adb
parent95914172e642de9a1b1d28a007b41042863d0902 (diff)
downloadgcc-3743d5bde63e99c32d5cdc930485b279d111bca2.zip
gcc-3743d5bde63e99c32d5cdc930485b279d111bca2.tar.gz
gcc-3743d5bde63e99c32d5cdc930485b279d111bca2.tar.bz2
[multiple changes]
2009-05-06 Gary Dismukes <dismukes@adacore.com> * sem_aggr.adb (Resolve_Record_Aggregate): In step 5, get the Underlying_Type before retrieving the type definition for gathering components, to account for the case where the type is private. 2009-05-06 Tristan Gingold <gingold@adacore.com> * g-comlin.ads: Fix minor typos (Getopt instead of Get_Opt). 2009-05-06 Thomas Quinot <quinot@adacore.com> * g-socthi-vms.adb, g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads, g-socthi-mingw.adb g-socthi-mingw.ads, g-socthi.adb, g-stsifd-sockets.adb, g-socthi.ads, g-socket.adb (GNAT.Sockets.Thin.C_Sendmsg, GNAT.Sockets.Thin.C_Recvmsg, Windows versions): Fix incorrect base address of Iovec (it's Msg_Iov, not Msg_Iov'Address). (GNAT.Sockets.Thin.C_Sendto, GNAT.Sockets.Thin.C_Recvfrom): Use a System.Address for the To parameter instead of a Sockaddr_In_Access, to achieve independance from AF_INET family, and also to allow this parameter to be retrieved from a Msghdr for the Windows case where these routines are used to implement C_Sendmsg and C_Recvmsg. 2009-05-06 Bob Duff <duff@adacore.com> * g-expect.adb, g-expect.ads: Minor reformatting * sdefault.ads: Minor comment fix * g-expect-vms.adb: Minor reformatting * table.ads, table.adb (Append_All): New convenience procedure for appending a whole array. * comperr.adb (Compiler_Abort): Mention the -gnatd.n switch in the bug box message. Call Osint.Dump_Source_File_Names to print out the file list, instead of rummaging around in various data structures. * debug.adb: New switch -gnatd.n, to print source file names as they are read. * alloc.ads: Add parameters for Osint.File_Name_Chars. * osint.ads, osint.adb (Dump_Source_File_Names): New procedure to print out source file names during a "bug box". (Include_Dir_Default_Prefix): Use memo-izing to avoid repeated new/free. (Read_Source_File): Print out the file name, if requested via -gnatd.n. If it's not part of the runtimes, store it for later printing by Dump_Source_File_Names. 2009-05-06 Javier Miranda <miranda@adacore.com> * gnat_rm.texi (CPP_Constructor): Avoid duplication of the documentation and add reference to the GNAT user guide for further details. 2009-05-06 Javier Miranda <miranda@adacore.com> * gnat_ugn.texi: Complete documentation for CPP_Constructor and remove also wrong examples that use extension aggregates. 2009-05-06 Albert Lee <lee@adacore.com> * s-oscons-tmplt.c (System.OS_Constants): Do not use special definition of Msg_Iovlen_T for VMS. From-SVN: r147148
Diffstat (limited to 'gcc/ada/osint.adb')
-rw-r--r--gcc/ada/osint.adb79
1 files changed, 64 insertions, 15 deletions
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index 04e2919..00d0eb8 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -29,6 +29,8 @@ with System.Case_Util; use System.Case_Util;
with GNAT.HTable;
+with Alloc;
+with Debug;
with Fmap; use Fmap;
with Gnatvsn; use Gnatvsn;
with Hostparm;
@@ -111,6 +113,9 @@ package body Osint is
-- Converts a C String to an Ada String. Are we doing this to avoid withing
-- Interfaces.C.Strings ???
+ function Include_Dir_Default_Prefix return String_Access;
+ -- Same as exported version, except returns a String_Access
+
------------------------------
-- Other Local Declarations --
------------------------------
@@ -137,6 +142,20 @@ package body Osint is
-- latest source, library and object files opened by Read_Source_File and
-- Read_Library_Info.
+ package File_Name_Chars is new Table.Table (
+ Table_Component_Type => Character,
+ Table_Index_Type => Int,
+ Table_Low_Bound => 1,
+ Table_Initial => Alloc.File_Name_Chars_Initial,
+ Table_Increment => Alloc.File_Name_Chars_Increment,
+ Table_Name => "File_Name_Chars");
+ -- Table to store text to be printed by Dump_Source_File_Names
+
+ The_Include_Dir_Default_Prefix : String_Access := null;
+ -- Value returned by Include_Dir_Default_Prefix. We don't initialize it
+ -- here, because that causes an elaboration cycle with Sdefault; we
+ -- initialize it lazily instead.
+
------------------
-- Search Paths --
------------------
@@ -717,6 +736,16 @@ package body Osint is
end if;
end Dir_In_Src_Search_Path;
+ ----------------------------
+ -- Dump_Source_File_Names --
+ ----------------------------
+
+ procedure Dump_Source_File_Names is
+ subtype Rng is Int range File_Name_Chars.First .. File_Name_Chars.Last;
+ begin
+ Write_Str (String (File_Name_Chars.Table (Rng)));
+ end Dump_Source_File_Names;
+
---------------------
-- Executable_Name --
---------------------
@@ -1392,22 +1421,19 @@ package body Osint is
-- Include_Dir_Default_Prefix --
--------------------------------
- function Include_Dir_Default_Prefix return String is
- Include_Dir : String_Access :=
- String_Access (Update_Path (Include_Dir_Default_Name));
-
+ function Include_Dir_Default_Prefix return String_Access is
begin
- if Include_Dir = null then
- return "";
-
- else
- declare
- Result : constant String := Include_Dir.all;
- begin
- Free (Include_Dir);
- return Result;
- end;
+ if The_Include_Dir_Default_Prefix = null then
+ The_Include_Dir_Default_Prefix :=
+ String_Access (Update_Path (Include_Dir_Default_Name));
end if;
+
+ return The_Include_Dir_Default_Prefix;
+ end Include_Dir_Default_Prefix;
+
+ function Include_Dir_Default_Prefix return String is
+ begin
+ return Include_Dir_Default_Prefix.all;
end Include_Dir_Default_Prefix;
----------------
@@ -2268,6 +2294,29 @@ package body Osint is
return;
end if;
+ -- Print out the file name, if requested, and if it's not part of the
+ -- runtimes, store it in File_Name_Chars.
+
+ declare
+ Name : String renames Name_Buffer (1 .. Name_Len);
+ Inc : String renames Include_Dir_Default_Prefix.all;
+ begin
+ if Debug.Debug_Flag_Dot_N then
+ Write_Line (Name);
+ end if;
+
+ if Inc /= ""
+ and then Inc'Length < Name_Len
+ and then Name_Buffer (1 .. Inc'Length) = Inc
+ then
+ null; -- Part of runtimes, so ignore it
+
+ else
+ File_Name_Chars.Append_All (File_Name_Chars.Table_Type (Name));
+ File_Name_Chars.Append (ASCII.LF);
+ end if;
+ end;
+
-- Prepare to read data from the file
Len := Integer (File_Length (Source_File_FD));