diff mbox series

[Ada] Add source file name to gnat bug box

Message ID 20210709123824.GA3875841@adacore.com
State New
Headers show
Series [Ada] Add source file name to gnat bug box | expand

Commit Message

Pierre-Marie de Rodat July 9, 2021, 12:38 p.m. UTC
...in case Current_Error_Node is Empty, which will cause it to print "No
source file position information available".  At least now we have the
file name being compiled.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* comperr.adb (Compiler_Abort): Print source file name.
diff mbox series

Patch

diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb
--- a/gcc/ada/comperr.adb
+++ b/gcc/ada/comperr.adb
@@ -244,12 +244,17 @@  package body Comperr is
             end if;
 
             End_Line;
+
          else
             Write_Str ("| Error detected at ");
             Write_Location (Sloc (Current_Error_Node));
             End_Line;
          end if;
 
+         Write_Str ("| Compiling ");
+         Write_Str (Get_First_Main_File_Name);
+         End_Line;
+
          --  There are two cases now. If the file gnat_bug.box exists,
          --  we use the contents of this file at this point.