diff options
author | Nils-Christian Kempke <nils-christian.kempke@intel.com> | 2022-06-07 12:16:36 +0200 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-06-09 14:40:48 +0100 |
commit | 61ee7510b3fa24ca48b6c053c4fad5916a6b01ff (patch) | |
tree | 0d9730a2f04d7698534804019a09222c1524fdcc | |
parent | 8f4141b0aef3ca513969ff2605f93d07301810e3 (diff) | |
download | gdb-61ee7510b3fa24ca48b6c053c4fad5916a6b01ff.zip gdb-61ee7510b3fa24ca48b6c053c4fad5916a6b01ff.tar.gz gdb-61ee7510b3fa24ca48b6c053c4fad5916a6b01ff.tar.bz2 |
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.
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 6a3fed1..7b11dab 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 |