From f2a211a30a9d15d7ad11f648006ed683ae6d620e Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Fri, 31 Aug 2007 12:24:38 +0200 Subject: [PATCH] symbols-vms.adb (Initialize): Read symbol files with continuation lines 2007-08-31 Vincent Celier * symbols-vms.adb (Initialize): Read symbol files with continuation lines (Finalize): If symbol is long, split the line From-SVN: r127983 --- gcc/ada/symbols-vms.adb | 43 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/gcc/ada/symbols-vms.adb b/gcc/ada/symbols-vms.adb index 2b955ca22fb..0a43f6fa209 100644 --- a/gcc/ada/symbols-vms.adb +++ b/gcc/ada/symbols-vms.adb @@ -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);