symbols-vms.adb (Initialize): Read symbol files with continuation lines

2007-08-31  Vincent Celier  <celier@adacore.com>

	* symbols-vms.adb (Initialize): Read symbol files with continuation
	lines
	(Finalize): If symbol is long, split the line

From-SVN: r127983
This commit is contained in:
Vincent Celier 2007-08-31 12:24:38 +02:00 committed by Arnaud Charlet
parent 98d68cf1e2
commit f2a211a30a

View File

@ -42,6 +42,9 @@ package body Symbols is
Symbol_File_Name : String_Access := null;
-- Name of the symbol file
Long_Symbol_Length : constant := 100;
-- Magic length of symbols, over which the lines are split
Sym_Policy : Policy := Autonomous;
-- The symbol policy. Set by Initialize
@ -120,9 +123,11 @@ package body Symbols is
Success : out Boolean)
is
File : Ada.Text_IO.File_Type;
Line : String (1 .. 1_000);
Line : String (1 .. 2_000);
Last : Natural;
Offset : Natural;
begin
-- Record the symbol file name
@ -221,7 +226,26 @@ package body Symbols is
-- Read line by line
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
Offset := 0;
loop
Get_Line (File, Line (Offset + 1 .. Line'Last), Last);
exit when Line (Last) /= '-';
if End_Of_File (File) then
if not Quiet then
Put_Line ("symbol file """ & Reference &
""" is incorrectly formatted:");
Put_Line ("""" & Line (1 .. Last) & """");
end if;
Close (File);
Success := False;
return;
else
Offset := Last - 1;
end if;
end loop;
-- Ignore empty lines
@ -549,8 +573,23 @@ package body Symbols is
for Index in 1 .. Symbol_Table.Last (Original_Symbols) loop
if Original_Symbols.Table (Index).Present then
Put (File, Symbol_Vector);
-- Split the line if symbol name length is too large
if Original_Symbols.Table (Index).Name'Length >
Long_Symbol_Length
then
Put_Line (File, "-");
end if;
Put (File, Original_Symbols.Table (Index).Name.all);
if Original_Symbols.Table (Index).Name'Length >
Long_Symbol_Length
then
Put_Line (File, "-");
end if;
if Original_Symbols.Table (Index).Kind = Data then
Put_Line (File, Equal_Data);