[gcc r15-1521] ada: Change error message on invalid RTS path

Marc Poulhi?s dkm@gcc.gnu.org
Fri Jun 21 08:38:21 GMT 2024


https://gcc.gnu.org/g:498c6260ce0508a4c865071fed11e964d6f22b35

commit r15-1521-g498c6260ce0508a4c865071fed11e964d6f22b35
Author: Marc Poulhiès <poulhies@adacore.com>
Date:   Tue Jun 4 14:37:17 2024 +0200

    ada: Change error message on invalid RTS path
    
    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.

Diff:
---
 gcc/ada/gnatls.adb   | 11 ++++++++---
 gcc/ada/make.adb     | 14 +++++++++-----
 gcc/ada/switch-b.adb | 15 ++++++++++-----
 3 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/gcc/ada/gnatls.adb b/gcc/ada/gnatls.adb
index 2c26001743ad..c52c1aea9c3f 100644
--- a/gcc/ada/gnatls.adb
+++ b/gcc/ada/gnatls.adb
@@ -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;
 
    -------------------
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 24b2d099bfeb..cef243411358 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -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;
diff --git a/gcc/ada/switch-b.adb b/gcc/ada/switch-b.adb
index 8d8dc58937c1..2de516dba56b 100644
--- a/gcc/ada/switch-b.adb
+++ b/gcc/ada/switch-b.adb
@@ -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;


More information about the Gcc-cvs mailing list