1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
28 with ALI
.Util
; use ALI
.Util
;
29 with Binderr
; use Binderr
;
30 with Butil
; use Butil
;
31 with Csets
; use Csets
;
32 with Fname
; use Fname
;
33 with Gnatvsn
; use Gnatvsn
;
34 with GNAT
.OS_Lib
; use GNAT
.OS_Lib
;
35 with Namet
; use Namet
;
37 with Osint
; use Osint
;
38 with Osint
.L
; use Osint
.L
;
39 with Output
; use Output
;
40 with Rident
; use Rident
;
42 with Targparm
; use Targparm
;
43 with Types
; use Types
;
45 with GNAT
.Case_Util
; use GNAT
.Case_Util
;
48 pragma Ident
(Gnat_Static_Version_String
);
50 Max_Column
: constant := 80;
52 No_Obj
: aliased String := "<no_obj>";
55 OK
, -- matching timestamp
56 Checksum_OK
, -- only matching checksum
57 Not_Found
, -- file not found on source PATH
58 Not_Same
, -- neither checksum nor timestamp matching
59 Not_First_On_PATH
); -- matching file hidden by Not_Same file on path
62 type Dir_Ref
is access Dir_Data
;
64 type Dir_Data
is record
65 Value
: String_Access
;
70 First_Source_Dir
: Dir_Ref
;
71 Last_Source_Dir
: Dir_Ref
;
72 -- The list of source directories from the command line.
73 -- These directories are added using Osint.Add_Src_Search_Dir
74 -- after those of the GNAT Project File, if any.
76 First_Lib_Dir
: Dir_Ref
;
77 Last_Lib_Dir
: Dir_Ref
;
78 -- The list of object directories from the command line.
79 -- These directories are added using Osint.Add_Lib_Search_Dir
80 -- after those of the GNAT Project File, if any.
82 Main_File
: File_Name_Type
;
83 Ali_File
: File_Name_Type
;
84 Text
: Text_Buffer_Ptr
;
87 Too_Long
: Boolean := False;
88 -- When True, lines are too long for multi-column output and each
89 -- item of information is on a different line.
91 Selective_Output
: Boolean := False;
92 Print_Usage
: Boolean := False;
93 Print_Unit
: Boolean := True;
94 Print_Source
: Boolean := True;
95 Print_Object
: Boolean := True;
96 -- Flags controlling the form of the output
98 Dependable
: Boolean := False; -- flag -d
99 Also_Predef
: Boolean := False;
101 Unit_Start
: Integer;
103 Source_Start
: Integer;
104 Source_End
: Integer;
105 Object_Start
: Integer;
106 Object_End
: Integer;
107 -- Various column starts and ends
109 Spaces
: constant String (1 .. Max_Column
) := (others => ' ');
111 RTS_Specified
: String_Access
:= null;
112 -- Used to detect multiple use of --RTS= switch
114 -----------------------
115 -- Local Subprograms --
116 -----------------------
118 procedure Add_Lib_Dir
(Dir
: String);
119 -- Add an object directory in the list First_Lib_Dir-Last_Lib_Dir
121 procedure Add_Source_Dir
(Dir
: String);
122 -- Add a source directory in the list First_Source_Dir-Last_Source_Dir
124 procedure Find_General_Layout
;
125 -- Determine the structure of the output (multi columns or not, etc)
127 procedure Find_Status
128 (FS
: in out File_Name_Type
;
129 Stamp
: Time_Stamp_Type
;
131 Status
: out File_Status
);
132 -- Determine the file status (Status) of the file represented by FS
133 -- with the expected Stamp and checksum given as argument. FS will be
134 -- updated to the full file name if available.
136 function Corresponding_Sdep_Entry
(A
: ALI_Id
; U
: Unit_Id
) return Sdep_Id
;
137 -- Give the Sdep entry corresponding to the unit U in ali record A
139 procedure Output_Object
(O
: File_Name_Type
);
140 -- Print out the name of the object when requested
142 procedure Output_Source
(Sdep_I
: Sdep_Id
);
143 -- Print out the name and status of the source corresponding to this
146 procedure Output_Status
(FS
: File_Status
; Verbose
: Boolean);
147 -- Print out FS either in a coded form if verbose is false or in an
148 -- expanded form otherwise.
150 procedure Output_Unit
(ALI
: ALI_Id
; U_Id
: Unit_Id
);
151 -- Print out information on the unit when requested
153 procedure Reset_Print
;
154 -- Reset Print flags properly when selective output is chosen
156 procedure Scan_Ls_Arg
(Argv
: String);
157 -- Scan and process lser specific arguments. Argv is a single argument
160 -- Print usage message
162 function Image
(Restriction
: Restriction_Id
) return String;
163 -- Returns the capitalized image of Restriction
169 procedure Add_Lib_Dir
(Dir
: String) is
171 if First_Lib_Dir
= null then
174 (Value => new String'(Dir
),
176 Last_Lib_Dir
:= First_Lib_Dir
;
181 (Value => new String'(Dir
),
183 Last_Lib_Dir
:= Last_Lib_Dir
.Next
;
191 procedure Add_Source_Dir
(Dir
: String) is
193 if First_Source_Dir
= null then
196 (Value => new String'(Dir
),
198 Last_Source_Dir
:= First_Source_Dir
;
201 Last_Source_Dir
.Next
:=
203 (Value => new String'(Dir
),
205 Last_Source_Dir
:= Last_Source_Dir
.Next
;
209 ------------------------------
210 -- Corresponding_Sdep_Entry --
211 ------------------------------
213 function Corresponding_Sdep_Entry
215 U
: Unit_Id
) return Sdep_Id
218 for D
in ALIs
.Table
(A
).First_Sdep
.. ALIs
.Table
(A
).Last_Sdep
loop
219 if Sdep
.Table
(D
).Sfile
= Units
.Table
(U
).Sfile
then
224 Error_Msg_Name_1
:= Units
.Table
(U
).Uname
;
225 Error_Msg_Name_2
:= ALIs
.Table
(A
).Afile
;
227 Error_Msg
("wrong ALI format, can't find dependency line for & in %");
228 Exit_Program
(E_Fatal
);
229 end Corresponding_Sdep_Entry
;
231 -------------------------
232 -- Find_General_Layout --
233 -------------------------
235 procedure Find_General_Layout
is
236 Max_Unit_Length
: Integer := 11;
237 Max_Src_Length
: Integer := 11;
238 Max_Obj_Length
: Integer := 11;
244 -- Compute maximum of each column
246 for Id
in ALIs
.First
.. ALIs
.Last
loop
247 Get_Name_String
(Units
.Table
(ALIs
.Table
(Id
).First_Unit
).Uname
);
248 if Also_Predef
or else not Is_Internal_Unit
then
252 Max_Unit_Length
:= Integer'Max (Max_Unit_Length
, Len
);
256 FS
:= Full_Source_Name
(ALIs
.Table
(Id
).Sfile
);
259 Get_Name_String
(ALIs
.Table
(Id
).Sfile
);
260 Name_Len
:= Name_Len
+ 13;
262 Get_Name_String
(FS
);
265 Max_Src_Length
:= Integer'Max (Max_Src_Length
, Name_Len
+ 1);
269 if ALIs
.Table
(Id
).No_Object
then
271 Integer'Max (Max_Obj_Length
, No_Obj
'Length);
273 Get_Name_String
(ALIs
.Table
(Id
).Ofile_Full_Name
);
274 Max_Obj_Length
:= Integer'Max (Max_Obj_Length
, Name_Len
+ 1);
280 -- Verify is output is not wider than maximum number of columns
285 (Max_Unit_Length
+ Max_Src_Length
+ Max_Obj_Length
) > Max_Column
;
287 -- Set start and end of columns
290 Object_End
:= Object_Start
- 1;
293 Object_End
:= Object_Start
+ Max_Obj_Length
;
296 Unit_Start
:= Object_End
+ 1;
297 Unit_End
:= Unit_Start
- 1;
300 Unit_End
:= Unit_Start
+ Max_Unit_Length
;
303 Source_Start
:= Unit_End
+ 1;
305 if Source_Start
> Spaces
'Last then
306 Source_Start
:= Spaces
'Last;
309 Source_End
:= Source_Start
- 1;
312 Source_End
:= Source_Start
+ Max_Src_Length
;
314 end Find_General_Layout
;
320 procedure Find_Status
321 (FS
: in out File_Name_Type
;
322 Stamp
: Time_Stamp_Type
;
324 Status
: out File_Status
)
326 Tmp1
: File_Name_Type
;
327 Tmp2
: File_Name_Type
;
330 Tmp1
:= Full_Source_Name
(FS
);
332 if Tmp1
= No_File
then
335 elsif File_Stamp
(Tmp1
) = Stamp
then
339 elsif Checksums_Match
(Get_File_Checksum
(FS
), Checksum
) then
341 Status
:= Checksum_OK
;
344 Tmp2
:= Matching_Full_Source_Name
(FS
, Stamp
);
346 if Tmp2
= No_File
then
351 Status
:= Not_First_On_PATH
;
361 function Image
(Restriction
: Restriction_Id
) return String is
362 Result
: String := Restriction
'Img;
363 Skip
: Boolean := True;
366 for J
in Result
'Range loop
369 Result
(J
) := To_Upper
(Result
(J
));
371 elsif Result
(J
) = '_' then
375 Result
(J
) := To_Lower
(Result
(J
));
386 procedure Output_Object
(O
: File_Name_Type
) is
387 Object_Name
: String_Access
;
393 Object_Name
:= To_Host_File_Spec
(Name_Buffer
(1 .. Name_Len
));
395 Object_Name
:= No_Obj
'Unchecked_Access;
398 Write_Str
(Object_Name
.all);
400 if Print_Source
or else Print_Unit
then
406 (Object_Start
+ Object_Name
'Length .. Object_End
));
416 procedure Output_Source
(Sdep_I
: Sdep_Id
) is
417 Stamp
: constant Time_Stamp_Type
:= Sdep
.Table
(Sdep_I
).Stamp
;
418 Checksum
: constant Word
:= Sdep
.Table
(Sdep_I
).Checksum
;
419 FS
: File_Name_Type
:= Sdep
.Table
(Sdep_I
).Sfile
;
420 Status
: File_Status
;
421 Object_Name
: String_Access
;
425 Find_Status
(FS
, Stamp
, Checksum
, Status
);
426 Get_Name_String
(FS
);
428 Object_Name
:= To_Host_File_Spec
(Name_Buffer
(1 .. Name_Len
));
431 Write_Str
(" Source => ");
432 Write_Str
(Object_Name
.all);
436 (Spaces
(Source_Start
+ Object_Name
'Length .. Source_End
));
439 Output_Status
(Status
, Verbose
=> True);
444 if not Selective_Output
then
445 Output_Status
(Status
, Verbose
=> False);
448 Write_Str
(Object_Name
.all);
457 procedure Output_Status
(FS
: File_Status
; Verbose
: Boolean) is
462 Write_Str
(" unchanged");
465 Write_Str
(" slightly modified");
468 Write_Str
(" file not found");
471 Write_Str
(" modified");
473 when Not_First_On_PATH
=>
474 Write_Str
(" unchanged version not first on PATH");
491 when Not_First_On_PATH
=>
501 procedure Output_Unit
(ALI
: ALI_Id
; U_Id
: Unit_Id
) is
503 U
: Unit_Record
renames Units
.Table
(U_Id
);
507 Get_Name_String
(U
.Uname
);
508 Kind
:= Name_Buffer
(Name_Len
);
509 Name_Len
:= Name_Len
- 2;
511 if not Verbose_Mode
then
512 Write_Str
(Name_Buffer
(1 .. Name_Len
));
515 Write_Str
("Unit => ");
516 Write_Eol
; Write_Str
(" Name => ");
517 Write_Str
(Name_Buffer
(1 .. Name_Len
));
518 Write_Eol
; Write_Str
(" Kind => ");
520 if Units
.Table
(U_Id
).Unit_Kind
= 'p' then
521 Write_Str
("package ");
523 Write_Str
("subprogram ");
547 U
.Body_Needed_For_SAL
or
550 Write_Eol
; Write_Str
(" Flags =>");
553 Write_Str
(" Preelaborable");
557 Write_Str
(" No_Elab_Code");
564 if U
.Dynamic_Elab
then
565 Write_Str
(" Dynamic_Elab");
569 Write_Str
(" Has_RACW");
572 if U
.Remote_Types
then
573 Write_Str
(" Remote_Types");
576 if U
.Shared_Passive
then
577 Write_Str
(" Shared_Passive");
585 Write_Str
(" Predefined");
589 Write_Str
(" Internal");
593 Write_Str
(" Is_Generic");
596 if U
.Init_Scalars
then
597 Write_Str
(" Init_Scalars");
601 Write_Str
(" Interface");
604 if U
.Body_Needed_For_SAL
then
605 Write_Str
(" Body_Needed_For_SAL");
608 if U
.Elaborate_Body
then
609 Write_Str
(" Elaborate Body");
612 if U
.Remote_Types
then
613 Write_Str
(" Remote_Types");
616 if U
.Shared_Passive
then
617 Write_Str
(" Shared_Passive");
621 Write_Str
(" Predefined");
627 Restrictions
: constant Restrictions_Info
:=
628 ALIs
.Table
(ALI
).Restrictions
;
630 -- If the source was compiled with pragmas Restrictions,
631 -- Display these restrictions.
633 if Restrictions
.Set
/= (All_Restrictions
=> False) then
634 Write_Eol
; Write_Str
(" Restrictions =>");
636 -- For boolean restrictions, just display the name of the
637 -- restriction; for valued restrictions, also display the
638 -- restriction value.
640 for Restriction
in All_Restrictions
loop
641 if Restrictions
.Set
(Restriction
) then
644 Write_Str
(Image
(Restriction
));
646 if Restriction
in All_Parameter_Restrictions
then
648 Write_Str
(Restrictions
.Value
(Restriction
)'Img);
658 Write_Eol
; Write_Str
(" ");
660 Write_Str
(Spaces
(Unit_Start
+ Name_Len
+ 1 .. Unit_End
));
670 procedure Reset_Print
is
672 if not Selective_Output
then
673 Selective_Output
:= True;
674 Print_Source
:= False;
675 Print_Object
:= False;
684 procedure Scan_Ls_Arg
(Argv
: String) is
685 FD
: File_Descriptor
;
688 pragma Assert
(Argv
'First = 1);
690 if Argv
'Length = 0 then
694 if Argv
(1) = '-' then
696 if Argv
'Length = 1 then
697 Fail
("switch character cannot be followed by a blank");
699 -- Processing for -I-
701 elsif Argv
(2 .. Argv
'Last) = "I-" then
702 Opt
.Look_In_Primary_Dir
:= False;
704 -- Forbid -?- or -??- where ? is any character
706 elsif (Argv
'Length = 3 and then Argv
(3) = '-')
707 or else (Argv
'Length = 4 and then Argv
(4) = '-')
709 Fail
("Trailing ""-"" at the end of ", Argv
, " forbidden.");
711 -- Processing for -Idir
713 elsif Argv
(2) = 'I' then
714 Add_Source_Dir
(Argv
(3 .. Argv
'Last));
715 Add_Lib_Dir
(Argv
(3 .. Argv
'Last));
717 -- Processing for -aIdir (to gcc this is like a -I switch)
719 elsif Argv
'Length >= 3 and then Argv
(2 .. 3) = "aI" then
720 Add_Source_Dir
(Argv
(4 .. Argv
'Last));
722 -- Processing for -aOdir
724 elsif Argv
'Length >= 3 and then Argv
(2 .. 3) = "aO" then
725 Add_Lib_Dir
(Argv
(4 .. Argv
'Last));
727 -- Processing for -aLdir (to gnatbind this is like a -aO switch)
729 elsif Argv
'Length >= 3 and then Argv
(2 .. 3) = "aL" then
730 Add_Lib_Dir
(Argv
(4 .. Argv
'Last));
732 -- Processing for -nostdinc
734 elsif Argv
(2 .. Argv
'Last) = "nostdinc" then
735 Opt
.No_Stdinc
:= True;
737 -- Processing for one character switches
739 elsif Argv
'Length = 2 then
741 when 'a' => Also_Predef
:= True;
742 when 'h' => Print_Usage
:= True;
743 when 'u' => Reset_Print
; Print_Unit
:= True;
744 when 's' => Reset_Print
; Print_Source
:= True;
745 when 'o' => Reset_Print
; Print_Object
:= True;
746 when 'v' => Verbose_Mode
:= True;
747 when 'd' => Dependable
:= True;
752 -- Processing for -files=file
754 elsif Argv
'Length > 7 and then Argv
(1 .. 7) = "-files=" then
755 FD
:= Open_Read
(Argv
(8 .. Argv
'Last), GNAT
.OS_Lib
.Text
);
757 if FD
= Invalid_FD
then
758 Osint
.Fail
("could not find text file """ &
759 Argv
(8 .. Argv
'Last) & '"');
762 Len
:= Integer (File_Length
(FD
));
765 Buffer
: String (1 .. Len
+ 1);
766 Index
: Positive := 1;
772 Len
:= Read
(FD
, Buffer
(1)'Address, Len
);
773 Buffer
(Buffer
'Last) := ASCII
.NUL
;
776 -- Scan the file line by line
778 while Index
< Buffer
'Last loop
779 -- Find the end of line
783 while Last
<= Buffer
'Last
784 and then Buffer
(Last
) /= ASCII
.LF
785 and then Buffer
(Last
) /= ASCII
.CR
790 -- Ignore empty lines
793 Add_File
(Buffer
(Index
.. Last
- 1));
798 -- Find the beginning of the next line
800 while Buffer
(Index
) = ASCII
.CR
or else
801 Buffer
(Index
) = ASCII
.LF
808 -- Processing for --RTS=path
810 elsif Argv
'Length >= 5 and then Argv
(1 .. 5) = "--RTS" then
811 if Argv
'Length <= 6 or else Argv
(6) /= '='then
812 Osint
.Fail
("missing path for --RTS");
815 -- Check that it is the first time we see this switch or, if
816 -- it is not the first time, the same path is specified.
818 if RTS_Specified
= null then
819 RTS_Specified
:= new String'(Argv (7 .. Argv'Last));
821 elsif RTS_Specified.all /= Argv (7 .. Argv'Last) then
822 Osint.Fail ("--RTS cannot be specified multiple times");
825 -- Valid --RTS switch
827 Opt.No_Stdinc := True;
828 Opt.RTS_Switch := True;
831 Src_Path_Name : constant String_Ptr :=
834 (Argv (7 .. Argv'Last), Include));
835 Lib_Path_Name : constant String_Ptr :=
838 (Argv (7 .. Argv'Last), Objects));
841 if Src_Path_Name /= null
842 and then Lib_Path_Name /= null
844 Add_Search_Dirs (Src_Path_Name, Include);
845 Add_Search_Dirs (Lib_Path_Name, Objects);
847 elsif Src_Path_Name = null
848 and then Lib_Path_Name = null
850 Osint.Fail ("RTS path not valid: missing " &
851 "adainclude and adalib directories");
853 elsif Src_Path_Name = null then
854 Osint.Fail ("RTS path not valid: missing " &
855 "adainclude directory");
857 elsif Lib_Path_Name = null then
858 Osint.Fail ("RTS path not valid: missing " &
865 -- If not a switch, it must be a file name
878 -- Start of processing for Usage
883 Write_Str ("Usage: ");
884 Osint.Write_Program_Name;
885 Write_Str (" switches [list of object files]");
891 Write_Str ("switches:");
896 Write_Str (" -a also output relevant predefined units");
901 Write_Str (" -u output only relevant unit names");
906 Write_Str (" -h output this help message");
911 Write_Str (" -s output only relevant source names");
916 Write_Str (" -o output only relevant object names");
921 Write_Str (" -d output sources on which specified units " &
927 Write_Str (" -v verbose output, full path and unit " &
934 Write_Str (" -files=fil files are listed in text file 'fil
'");
937 -- Line for -aI switch
939 Write_Str (" -aIdir specify source files search path");
942 -- Line for -aO switch
944 Write_Str (" -aOdir specify object files search path");
947 -- Line for -I switch
949 Write_Str (" -Idir like -aIdir -aOdir");
952 -- Line for -I- switch
954 Write_Str (" -I- do not look for sources & object files");
955 Write_Str (" in the default directory");
958 -- Line for -nostdinc
960 Write_Str (" -nostdinc do not look for source files");
961 Write_Str (" in the system default directory");
966 Write_Str (" --RTS=dir specify the default source and object search"
970 -- File Status explanation
973 Write_Str (" file status can be:");
976 for ST in File_Status loop
978 Output_Status (ST, Verbose => False);
980 Output_Status (ST, Verbose => True);
986 -- Start of processing for Gnatls
989 -- Initialize standard packages
995 -- Loop to scan out arguments
998 Scan_Args : while Next_Arg < Arg_Count loop
1000 Next_Argv : String (1 .. Len_Arg (Next_Arg));
1002 Fill_Arg (Next_Argv'Address, Next_Arg);
1003 Scan_Ls_Arg (Next_Argv);
1006 Next_Arg := Next_Arg + 1;
1009 -- Add the source and object directories specified on the
1010 -- command line, if any, to the searched directories.
1012 while First_Source_Dir /= null loop
1013 Add_Src_Search_Dir (First_Source_Dir.Value.all);
1014 First_Source_Dir := First_Source_Dir.Next;
1017 while First_Lib_Dir /= null loop
1018 Add_Lib_Search_Dir (First_Lib_Dir.Value.all);
1019 First_Lib_Dir := First_Lib_Dir.Next;
1022 -- Finally, add the default directories and obtain target parameters
1024 Osint.Add_Default_Search_Dirs;
1026 if Verbose_Mode then
1027 Targparm.Get_Target_Parameters;
1029 -- WARNING: the output of gnatls -v is used during the compilation
1030 -- and installation of GLADE to recreate sdefault.adb and locate
1031 -- the libgnat.a to use. Any change in the output of gnatls -v must
1032 -- be synchronized with the GLADE Dist/config.sdefault shell script.
1035 Write_Str ("GNATLS ");
1036 Write_Str (Gnat_Version_String);
1037 Write_Str (" Copyright 1997-2004 Free Software Foundation, Inc.");
1040 Write_Str ("Source Search Path:");
1043 for J in 1 .. Nb_Dir_In_Src_Search_Path loop
1046 if Dir_In_Src_Search_Path (J)'Length = 0 then
1047 Write_Str ("<Current_Directory>");
1049 Write_Str (To_Host_Dir_Spec
1050 (Dir_In_Src_Search_Path (J).all, True).all);
1058 Write_Str ("Object Search Path:");
1061 for J in 1 .. Nb_Dir_In_Obj_Search_Path loop
1064 if Dir_In_Obj_Search_Path (J)'Length = 0 then
1065 Write_Str ("<Current_Directory>");
1067 Write_Str (To_Host_Dir_Spec
1068 (Dir_In_Obj_Search_Path (J).all, True).all);
1077 -- Output usage information when requested
1083 if not More_Lib_Files then
1084 if not Print_Usage and then not Verbose_Mode then
1088 Exit_Program (E_Fatal);
1092 Initialize_ALI_Source;
1094 -- Print out all library for which no ALI files can be located
1096 while More_Lib_Files loop
1097 Main_File := Next_Main_Lib_File;
1098 Ali_File := Full_Lib_File_Name (Lib_File_Name (Main_File));
1100 if Ali_File = No_File then
1101 Write_Str ("Can't find library info for ");
1102 Get_Name_String (Main_File);
1104 Write_Str (Name_Buffer (1 .. Name_Len));
1109 Ali_File := Strip_Directory (Ali_File);
1111 if Get_Name_Table_Info (Ali_File) = 0 then
1112 Text := Read_Library_Info (Ali_File, True);
1116 pragma Unreferenced (Discard);
1124 Ignore_Errors => True);
1132 Find_General_Layout;
1134 for Id in ALIs.First .. ALIs.Last loop
1139 Get_Name_String (Units.Table (ALIs.Table (Id).First_Unit).Uname);
1141 if Also_Predef or else not Is_Internal_Unit then
1142 if ALIs.Table (Id).No_Object then
1143 Output_Object (No_File);
1145 Output_Object (ALIs.Table (Id).Ofile_Full_Name);
1148 -- In verbose mode print all main units in the ALI file, otherwise
1149 -- just print the first one to ease columnwise printout
1151 if Verbose_Mode then
1152 Last_U := ALIs.Table (Id).Last_Unit;
1154 Last_U := ALIs.Table (Id).First_Unit;
1157 for U in ALIs.Table (Id).First_Unit .. Last_U loop
1158 if U /= ALIs.Table (Id).First_Unit
1159 and then Selective_Output
1165 Output_Unit (Id, U);
1167 -- Output source now, unless if it will be done as part of
1168 -- outputing dependencies.
1170 if not (Dependable and then Print_Source) then
1171 Output_Source (Corresponding_Sdep_Entry (Id, U));
1175 -- Print out list of units on which this unit depends (D lines)
1177 if Dependable and then Print_Source then
1178 if Verbose_Mode then
1179 Write_Str ("depends upon");
1188 ALIs.Table (Id).First_Sdep .. ALIs.Table (Id).Last_Sdep
1191 or else not Is_Internal_File_Name (Sdep.Table (D).Sfile)
1193 if Verbose_Mode then
1203 Write_Str (Spaces (1 .. Source_Start - 2));
1216 -- All done. Set proper exit status
1219 Exit_Program (E_Success);