From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id 73C23385480D for ; Fri, 3 Jun 2022 08:54:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 73C23385480D X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="362576686" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="362576686" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 01:54:31 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="563701300" Received: from labpcdell3650-003.iul.intel.com (HELO localhost) ([172.28.49.87]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 01:54:29 -0700 From: Nils-Christian Kempke To: gdb-patches@sourceware.org Cc: aburgess@redhat.com, JiniSusan.George@amd.com, tdevries@suse.de, Nils-Christian Kempke Subject: [PATCH 1/2] gdb/testsuite: use test_compiler_info in gcc_major_version Date: Fri, 3 Jun 2022 10:54:13 +0200 Message-Id: <20220603085414.2391706-2-nils-christian.kempke@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220603085414.2391706-1-nils-christian.kempke@intel.com> References: <20220603085414.2391706-1-nils-christian.kempke@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 08:54:34 -0000 The procedure gcc_major_version was earlier using the global variable compiler_info to retrieve gcc's major version. This is discouraged and (as can be read in a comment in compiler.c) compiler_info should be local to get_compiler_info and test_compiler_info. The preferred way of getting the compiler string is via calling test_compiler_info without arguments. Gcc_major_version was changed to do that. gdb/testsuite/ChangeLog: 2022-06-01 Nils-Christian Kempke * gdb.exp (gcc_major_version): Use test_compiler_info over global variable compiler_info. Signed-off-by: Nils-Christian Kempke --- gdb/testsuite/lib/gdb.exp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 402450152a..4ee7c1fb0a 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4218,12 +4218,11 @@ proc test_compiler_info { {compiler ""} {language ""} } { # For gcc 7.5.0, the major version 7. proc gcc_major_version { } { - global compiler_info global decimal if { ![test_compiler_info "gcc-*"] } { return -1 } - set res [regexp gcc-($decimal)-($decimal)- $compiler_info \ + set res [regexp gcc-($decimal)-($decimal)- [test_compiler_info] \ dummy_var major minor] if { $res != 1 } { return -1 -- 2.25.1 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928