From patchwork Fri Jun 21 08:58:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1950665 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=e79gP6Yf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W5BMV6KdJz20X8 for ; Fri, 21 Jun 2024 19:07:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 07F163896C3F for ; Fri, 21 Jun 2024 09:07:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 6F5113896C0B for ; Fri, 21 Jun 2024 08:58:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F5113896C0B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F5113896C0B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718960333; cv=none; b=V5lgZRe6Nm9XagDBVtJE5sS+TNwvjVt7znMh72Turg6zvQ7XokzR81QIkUmSmZDVerI1kpJkkhUXqNAYxFMl0EFNp6oasb9K+0JIG3Xt3AZwQkUlhd+JWn2O40HgMGnxKeBFX8UMQLXLqgfWIO409ZaBWQoNjlKnjkEQMfszhnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718960333; c=relaxed/simple; bh=CO0tVJusZNhFZV0eLPRkj/2xYCDzblriqxyaHLKN2W0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=p+t/XASobhAfJGKOMxLSt5UpL2XaFWxFLMH64EUncRQInXWryGa26Rk8/Y6mKDcqUYX+xM+Az/enDiaAqIH04r9gAenVSKrmY+bB+9ohrw2uNLO9gFJ9o1UyLp3GUTF/yy4FU57pSj8bzPlyW19HG1Q6DbaKF6IYPg7lkP2pdKw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42249a4f9e4so13149635e9.2 for ; Fri, 21 Jun 2024 01:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718960320; x=1719565120; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i6JwoDIGKaodKnTJi3Zv70IzGWcXZpBaHy2MlqVp8wE=; b=e79gP6YfELCE5+usOKp9IcTnAW9M46rOgRAXzzjNonhAkp81M5PD8C9G+C6om6AvJM bwbkhF3LPmrAxfriJrRhw2pJuTFrHiH4OPZ68Q4MAjBHK1qA2ufpHPLvMiM5C1ffTNg3 Wvv47RJgcDtRppSgqVDYhm3yBE5jN032ZxzIJ8rSCMu+U+q0X/yMvHGyCLR6oZC8ByJA Lo1LVtScuv/aNSflZZdc2fucG9wfwSNafz1qChd96hox12o0CNvSMKwN1YJF0oNuzLsX rPCzTFmJLtq5HYVzXJu+OAhPKOEdLfKFG0TTIBUpI0ELA9dx1arBKx+RWaBs40JAOvtD ar3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718960320; x=1719565120; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i6JwoDIGKaodKnTJi3Zv70IzGWcXZpBaHy2MlqVp8wE=; b=WA2fgtGtQDMcJdH08k/7/GY+eXwp0+bEjf1o1x7HLY2wNVhRKseqOBluX7fYJmiRoV DpVr7xo79DXo7l/acFtUi4kfjmO7wdJ2owlPriJTLChPeiokWOIauZpDsOFt0vUHxQ1w KF6V0So1w0uN7jOLxQ8SZisxsmi2LXSOfd37HtkfV0LaItIDhbusMT7NM28CiqT6yzhF wwGs0GL8+tDQ563TK1sPdvUUT/4K6gaGxmW0ZZmVG4CZN4OubwadspJbY9yr+wWf+KOL PbrhWjHcK9uwIeXlhCMkq97BjRQqgKCoP+BLzhlGsAELorUAK2koM3mHuIQR6WQmINzW wZiw== X-Gm-Message-State: AOJu0YziSR89fsxN0iaELUapaCbd/KIKvJ0ds6EdYJPuz5+7eQH4h5j0 rfunDa3Q3QUQAbgqrU31/ys9TqF0bntaQtw6m4CvleMU7tatV58uZy1zOvDQ6hjz46uBFha0K1I = X-Google-Smtp-Source: AGHT+IF9wJfJ9iHdGv0bnlpUq8SqXO3qVVl4bNkkt1LOhczXz6WzkB2PdE0lkZBffFtO/LaNC7qUwQ== X-Received: by 2002:a05:600c:4652:b0:422:615f:649e with SMTP id 5b1f17b1804b1-42475298ba0mr61838605e9.27.1718960320201; Fri, 21 Jun 2024 01:58:40 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:a589:2704:bfe1:5d92]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d0c5485sm55322375e9.21.2024.06.21.01.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 01:58:39 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Marc_Poulhi=C3=A8s?= Subject: [COMMITTED 13/22] ada: Change error message on invalid RTS path Date: Fri, 21 Jun 2024 10:58:09 +0200 Message-ID: <20240621085819.2485987-13-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621085819.2485987-1-poulhies@adacore.com> References: <20240621085819.2485987-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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. Tested on x86_64-pc-linux-gnu, committed on master. --- 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 2c26001743a..c52c1aea9c3 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 24b2d099bfe..cef24341135 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 8d8dc58937c..2de516dba56 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;