aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-08-17 08:57:09 +0200
committerTom de Vries <tdevries@suse.de>2025-08-17 08:57:09 +0200
commitf28a89fd767ff58693b9d5af8e42e211168fae50 (patch)
tree7eb3f9067e1961b72d81f6c97c31d55c94a2e542
parentf586f9b61d1e5d91f010e68922b8c8b86f787a27 (diff)
downloadbinutils-f28a89fd767ff58693b9d5af8e42e211168fae50.zip
binutils-f28a89fd767ff58693b9d5af8e42e211168fae50.tar.gz
binutils-f28a89fd767ff58693b9d5af8e42e211168fae50.tar.bz2
[gdb/testsuite] Use regexp to match $_gdb_{major,minor}
Every time we update the gdb version number, test-case gdb.base/default.exp needs updating because it matches the values of convenience variables $_gdb_{major,minor} using hardcoded expected values: ... {$_gdb_major = 17} \ {$_gdb_minor = 1} \ ... I'm assuming the values were hardcoded because gdb_test_list_exact was used. Since the previous patch, that's not longer the case, so use regexps instead, getting rid of this annoyance [1]. Tested on x86_64-linux. [1] https://sourceware.org/pipermail/gdb-patches/2019-October/160935.html
-rw-r--r--gdb/testsuite/gdb.base/default.exp14
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 50fae7c..d857165 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -766,8 +766,6 @@ set show_conv_list \
{$_gdb_maint_setting = <internal function _gdb_maint_setting>} \
{$_gdb_setting_str = <internal function _gdb_setting_str>} \
{$_gdb_setting = <internal function _gdb_setting>} \
- {$_gdb_major = 17} \
- {$_gdb_minor = 1} \
{$_shell_exitsignal = void} \
{$_shell_exitcode = 0} \
{$_active_linker_namespaces = 1} \
@@ -812,6 +810,18 @@ if { [regexp "$re_var = $re_val" $lines] } {
set all_found 0
}
+set re_vars \
+ [list \
+ [string_to_regexp {$_gdb_major}] \
+ [string_to_regexp {$_gdb_minor}]]
+foreach re_var $re_vars {
+ if { [regexp "$re_var = $decimal" $lines] } {
+ incr matches
+ } else {
+ set all_found 0
+ }
+}
+
if { [regexp [string_to_regexp {$_tlb = void}] $lines] } {
incr matches
} else {