aboutsummaryrefslogtreecommitdiffstats
path: root/src/files_map.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-04 19:01:38 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-04 19:01:38 +0100
commitca25384d0c55563d5758cd6d548662947bd699df (patch)
tree4387b7bce07ef810c9ad4d36665128f2b617118d /src/files_map.adb
parent10dbbfb98cee33b06ca19e936732309725d0fdf9 (diff)
downloadghdl-ca25384d0c55563d5758cd6d548662947bd699df.tar.gz
ghdl-ca25384d0c55563d5758cd6d548662947bd699df.tar.bz2
ghdl-ca25384d0c55563d5758cd6d548662947bd699df.zip
files_map: extract debug_source_file.
Diffstat (limited to 'src/files_map.adb')
-rw-r--r--src/files_map.adb83
1 files changed, 43 insertions, 40 deletions
diff --git a/src/files_map.adb b/src/files_map.adb
index bbf8c8087..9e3fd1ac9 100644
--- a/src/files_map.adb
+++ b/src/files_map.adb
@@ -1161,49 +1161,52 @@ package body Files_Map is
end loop;
end Debug_Source_Lines;
- procedure Debug_Source_Files is
+ procedure Debug_Source_File (File : Source_File_Entry)
+ is
+ F : Source_File_Record renames Source_Files.Table(File);
begin
- for I in Source_Files.First .. Source_Files.Last loop
- declare
- F : Source_File_Record renames Source_Files.Table(I);
- begin
- Log ("*");
- Log (Source_File_Entry'Image (I));
- Log (" name: " & Image (F.File_Name));
- Log (" dir:" & Image (F.Directory));
- Log (" file length:" & Source_Ptr'Image (F.File_Length));
+ Log ("*");
+ Log (Source_File_Entry'Image (File));
+ Log (" name: " & Image (F.File_Name));
+ Log (" dir:" & Image (F.Directory));
+ Log (" file length:" & Source_Ptr'Image (F.File_Length));
+ Log_Line;
+ Log (" location:" & Location_Type'Image (F.First_Location)
+ & " -" & Location_Type'Image (F.Last_Location));
+ Log_Line;
+ if F.Checksum /= No_File_Checksum_Id then
+ Log (" checksum: " & Get_File_Checksum_String (F.Checksum));
+ Log_Line;
+ end if;
+ case F.Kind is
+ when Source_File_File =>
+ if F.Source = null then
+ Log (" no buf");
+ else
+ Log (" buf:" & Source_Ptr'Image (F.Source'First)
+ & " -" & Source_Ptr'Image (F.Source'Last));
+ end if;
Log_Line;
- Log (" location:" & Location_Type'Image (F.First_Location)
- & " -" & Location_Type'Image (F.Last_Location));
+ Log (" nbr lines:"
+ & Natural'Image (Lines_Tables.Last (F.Lines)));
Log_Line;
- if F.Checksum /= No_File_Checksum_Id then
- Log (" checksum: " & Get_File_Checksum_String (F.Checksum));
- Log_Line;
- end if;
- case F.Kind is
- when Source_File_File =>
- if F.Source = null then
- Log (" no buf");
- else
- Log (" buf:" & Source_Ptr'Image (F.Source'First)
- & " -" & Source_Ptr'Image (F.Source'Last));
- end if;
- Log_Line;
- Log (" nbr lines:"
- & Natural'Image (Lines_Tables.Last (F.Lines)));
- Log_Line;
- Log (" Gap:" & Source_Ptr'Image (F.Gap_Start)
- & " -" & Source_Ptr'Image (F.Gap_Last));
- Log_Line;
- when Source_File_String =>
- null;
- when Source_File_Instance =>
- Log (" instance from:" & Source_File_Entry'Image (F.Ref));
- Log (", base:" & Source_File_Entry'Image (F.Base));
- Log (", loc:" & Image (F.Instance_Loc));
- Log_Line;
- end case;
- end;
+ Log (" Gap:" & Source_Ptr'Image (F.Gap_Start)
+ & " -" & Source_Ptr'Image (F.Gap_Last));
+ Log_Line;
+ when Source_File_String =>
+ null;
+ when Source_File_Instance =>
+ Log (" instance from:" & Source_File_Entry'Image (F.Ref));
+ Log (", base:" & Source_File_Entry'Image (F.Base));
+ Log (", loc:" & Image (F.Instance_Loc));
+ Log_Line;
+ end case;
+ end Debug_Source_File;
+
+ procedure Debug_Source_Files is
+ begin
+ for I in Source_Files.First .. Source_Files.Last loop
+ Debug_Source_File (I);
end loop;
end Debug_Source_Files;