]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Change error message on invalid RTS path
authorMarc Poulhiès <poulhies@adacore.com>
Tue, 4 Jun 2024 12:37:17 +0000 (14:37 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 21 Jun 2024 08:34:21 +0000 (10:34 +0200)
Include the invalid path in the error message.

gcc/ada/

* make.adb (Scan_Make_Arg): Adjust error message.
* gnatls.adb (Search_RTS): Likewise.
* switch-b.adb (Scan_Debug_Switches): Likewise.

gcc/ada/gnatls.adb
gcc/ada/make.adb
gcc/ada/switch-b.adb

index 2c26001743ad6c99582db730f2581fa596bbd8c1..c52c1aea9c3f5bdc5a62811dd2120cbe4a468121 100644 (file)
@@ -1673,9 +1673,13 @@ procedure Gnatls is
       end if;
 
       if Lib_Path /= null then
-         Osint.Fail ("RTS path not valid: missing adainclude directory");
+         Osint.Fail
+           ("RTS path """ & Name
+            & """ not valid: missing adainclude directory");
       elsif Src_Path /= null then
-         Osint.Fail ("RTS path not valid: missing adalib directory");
+         Osint.Fail
+           ("RTS path """ & Name
+            & """ not valid: missing adalib directory");
       end if;
 
       --  Try to find the RTS on the project path. First setup the project path
@@ -1710,7 +1714,8 @@ procedure Gnatls is
       end if;
 
       Osint.Fail
-        ("RTS path not valid: missing adainclude and adalib directories");
+        ("RTS path """ & Name
+          & """ not valid: missing adainclude and adalib directories");
    end Search_RTS;
 
    -------------------
index 24b2d099bfebae1758f2888966864c919e1a6c89..cef243411358e1366743e0f9be269e737b590f06 100644 (file)
@@ -4478,13 +4478,14 @@ package body Make is
                RTS_Switch := True;
 
                declare
+                  RTS_Arg_Path : constant String := Argv (7 .. Argv'Last);
                   Src_Path_Name : constant String_Ptr :=
                                     Get_RTS_Search_Dir
-                                      (Argv (7 .. Argv'Last), Include);
+                                      (RTS_Arg_Path, Include);
 
                   Lib_Path_Name : constant String_Ptr :=
                                     Get_RTS_Search_Dir
-                                      (Argv (7 .. Argv'Last), Objects);
+                                      (RTS_Arg_Path, Objects);
 
                begin
                   if Src_Path_Name /= null
@@ -4501,16 +4502,19 @@ package body Make is
                     and then Lib_Path_Name = null
                   then
                      Make_Failed
-                       ("RTS path not valid: missing adainclude and adalib "
+                       ("RTS path """ & RTS_Arg_Path
+                        & """ not valid: missing adainclude and adalib "
                         & "directories");
 
                   elsif Src_Path_Name = null then
                      Make_Failed
-                       ("RTS path not valid: missing adainclude directory");
+                       ("RTS path """ & RTS_Arg_Path
+                        & """ not valid: missing adainclude directory");
 
                   else pragma Assert (Lib_Path_Name = null);
                      Make_Failed
-                       ("RTS path not valid: missing adalib directory");
+                       ("RTS path """ & RTS_Arg_Path
+                        & """ not valid: missing adalib directory");
                   end if;
                end;
             end if;
index 8d8dc58937c1f85684485e62d74afd2da6e15c09..2de516dba56b6f79e8a8ed3733b25742d7aeba90 100644 (file)
@@ -672,13 +672,15 @@ package body Switch.B is
                   Opt.RTS_Switch := True;
 
                   declare
+                     RTS_Arg_Path : constant String :=
+                                       Switch_Chars (Ptr + 1 .. Max);
                      Src_Path_Name : constant String_Ptr :=
                                        Get_RTS_Search_Dir
-                                         (Switch_Chars (Ptr + 1 .. Max),
+                                         (RTS_Arg_Path,
                                           Include);
                      Lib_Path_Name : constant String_Ptr :=
                                        Get_RTS_Search_Dir
-                                         (Switch_Chars (Ptr + 1 .. Max),
+                                         (RTS_Arg_Path,
                                           Objects);
 
                   begin
@@ -698,14 +700,17 @@ package body Switch.B is
                        and then Lib_Path_Name = null
                      then
                         Osint.Fail
-                          ("RTS path not valid: missing adainclude and "
+                          ("RTS path """ & RTS_Arg_Path
+                           & """ not valid: missing adainclude and "
                            & "adalib directories");
                      elsif Src_Path_Name = null then
                         Osint.Fail
-                          ("RTS path not valid: missing adainclude directory");
+                          ("RTS path """ & RTS_Arg_Path
+                           & """ not valid: missing adainclude directory");
                      else pragma Assert (Lib_Path_Name = null);
                         Osint.Fail
-                          ("RTS path not valid: missing adalib directory");
+                          ("RTS path """ & RTS_Arg_Path
+                           & """ not valid: missing adalib directory");
                      end if;
                   end;
                end if;