public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: use test_compiler_info in gcc_major_version
@ 2022-06-09 13:41 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-06-09 13:41 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=61ee7510b3fa24ca48b6c053c4fad5916a6b01ff

commit 61ee7510b3fa24ca48b6c053c4fad5916a6b01ff
Author: Nils-Christian Kempke <nils-christian.kempke@intel.com>
Date:   Tue Jun 7 12:16:36 2022 +0200

    gdb/testsuite: use test_compiler_info in gcc_major_version
    
    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.

Diff:
---
 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 6a3fed110a8..7b11dab870e 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-09 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 13:41 [binutils-gdb] gdb/testsuite: use test_compiler_info in gcc_major_version Andrew Burgess

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).