diff options
author | Thomas Quinot <quinot@adacore.com> | 2006-02-15 10:45:56 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-15 10:45:56 +0100 |
commit | b8e51f72bd934e95a47811f99347a7bcf2dfbde6 (patch) | |
tree | 5f3e2352a8e93f22601b9b5d22e424ae989c6705 /gcc/ada/sinput-d.adb | |
parent | 045683693078d55e32bcd836e1e953c7c634a48f (diff) | |
download | gcc-b8e51f72bd934e95a47811f99347a7bcf2dfbde6.tar.gz |
sinput-d.adb (Write_Line): Update the Source_Index_Table after each line.
2006-02-13 Thomas Quinot <quinot@adacore.com>
* sinput-d.adb (Write_Line): Update the Source_Index_Table after each
line. This is necessary to allow In_Extended_Main_Unit to provide
correct results for itypes while writing out expanded source.
(Close_File): No need to update the source_index_table here since it's
now done for each line.
From-SVN: r111098
Diffstat (limited to 'gcc/ada/sinput-d.adb')
-rw-r--r-- | gcc/ada/sinput-d.adb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/ada/sinput-d.adb b/gcc/ada/sinput-d.adb index baa1ee99002..d9e290a1563 100644 --- a/gcc/ada/sinput-d.adb +++ b/gcc/ada/sinput-d.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2003, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2006, 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- -- @@ -44,13 +44,12 @@ package body Sinput.D is Trim_Lines_Table (Dfile); Close_Debug_File; - -- Now we need to read the file that we wrote and store it - -- in memory for subsequent access. + -- Now we need to read the file that we wrote and store it in memory for + -- subsequent access. Read_Source_File (S.Full_Debug_Name, S.Source_First, S.Source_Last, Src); S.Source_Text := Src; - Set_Source_File_Index_Table (Dfile); end Close_Debug_Source; ------------------------- @@ -78,8 +77,8 @@ package body Sinput.D is S.Lines_Table := null; S.Last_Source_Line := 1; - -- Allocate lines table, guess that it needs to be three times - -- bigger than the original source (in number of lines). + -- Allocate lines table, guess that it needs to be three times bigger + -- than the original source (in number of lines). Alloc_Line_Tables (S, Int (Source_File.Table (Source).Last_Source_Line * 3)); @@ -100,15 +99,15 @@ package body Sinput.D is if Str'Length = 0 and then Loc = S.Source_First then return; - -- Here we write the line, compute the source location for the - -- following line, allocate its table entry, and update the source - -- record entry. + -- Here we write the line, compute the source location for the following + -- line, allocate its table entry, and update the source record entry. else Write_Debug_Info (Str (Str'First .. Str'Last - 1)); Loc := Loc - 1 + Source_Ptr (Str'Length + Debug_File_Eol_Length); Add_Line_Tables_Entry (S, Loc); S.Source_Last := Loc; + Set_Source_File_Index_Table (Dfile); end if; end Write_Debug_Line; |