public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/5] gdb/testsuite: use test_compiler_info in gcc_major_version
Date: Wed,  8 Jun 2022 15:22:13 +0100	[thread overview]
Message-ID: <cef9f1044f2c6387ffee5e0614cd40e9f832fe3f.1654697966.git.aburgess@redhat.com> (raw)
In-Reply-To: <cover.1654697966.git.aburgess@redhat.com>

From: Nils-Christian Kempke <nils-christian.kempke@intel.com>

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/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 402450152ac..4ee7c1fb0ae 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.4


  reply	other threads:[~2022-06-08 14:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 10:16 [PATCH v2 0/2] Fix regressions introduced by Fortran compiler identification series Nils-Christian Kempke
2022-06-07 10:16 ` [PATCH v2 1/2] gdb/testsuite: use test_compiler_info in gcc_major_version Nils-Christian Kempke
2022-06-08  9:50   ` Andrew Burgess
2022-06-07 10:16 ` [PATCH v2 2/2] gdb/testsuite: cache compiler_info on a per language basis Nils-Christian Kempke
2022-06-08 14:18   ` Andrew Burgess
2022-06-08 14:22     ` [PATCH 0/5] Solve caching problems with compiler_info Andrew Burgess
2022-06-08 14:22       ` Andrew Burgess [this message]
2022-06-08 14:22       ` [PATCH 2/5] gdb/testsuite: remove unneeded get_compiler_info calls from gdb.exp Andrew Burgess
2022-06-09 13:39         ` Andrew Burgess
2022-06-08 14:22       ` [PATCH 3/5] gdb/testsuite: make 'c' default language for get/test compiler info Andrew Burgess
2022-06-08 16:06         ` Kempke, Nils-Christian
2022-06-09 13:40           ` Andrew Burgess
2022-06-08 14:22       ` [PATCH 4/5] gdb/testsuite: handle errors better in test_compiler_info Andrew Burgess
2022-06-08 14:22       ` [PATCH 5/5] gdb/testsuite: solve problems with compiler_info caching Andrew Burgess
2022-06-08 16:21       ` [PATCH 0/5] Solve caching problems with compiler_info Kempke, Nils-Christian
2022-06-09 13:42         ` Andrew Burgess
2022-06-09 16:25           ` Tom de Vries
2022-06-10 11:03             ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cef9f1044f2c6387ffee5e0614cd40e9f832fe3f.1654697966.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).