diff options
author | Vincent Celier <celier@adacore.com> | 2007-08-31 12:24:38 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-31 12:24:38 +0200 |
commit | f2a211a30a9d15d7ad11f648006ed683ae6d620e (patch) | |
tree | 3ffabc9f717ea09572757c7fd88ff74648be1c27 /gcc/ada/symbols-vms.adb | |
parent | 98d68cf1e21e23331a95c636f43fe769d02e9677 (diff) | |
download | gcc-f2a211a30a9d15d7ad11f648006ed683ae6d620e.zip gcc-f2a211a30a9d15d7ad11f648006ed683ae6d620e.tar.gz gcc-f2a211a30a9d15d7ad11f648006ed683ae6d620e.tar.bz2 |
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
Diffstat (limited to 'gcc/ada/symbols-vms.adb')
-rw-r--r-- | gcc/ada/symbols-vms.adb | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/gcc/ada/symbols-vms.adb b/gcc/ada/symbols-vms.adb index 2b955ca..0a43f6f 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); |