This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed][gdb/testsuite] Fix typo in tcl_version_at_least
- From: Tom de Vries <tdevries at suse dot de>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Mon, 5 Aug 2019 12:53:57 +0200
- Subject: [committed][gdb/testsuite] Fix typo in tcl_version_at_least
- References: <20190801085800.GA30177@delia>
[ was: [committed][gdb/testsuite] Fix gdb.base/structs.exp timeout with
check-read1 ]
On 01-08-19 10:58, Tom de Vries wrote:
> +# Return 1 if tcl version used is at least MAJOR.MINOR
> +proc tcl_version_at_least { major minor } {
> + global tcl_version
> + regexp {^([0-9]+)\.([0-9]+)$} $tcl_version \
> + dummy tcl_version_major tcl_version_minor
> + if { $tcl_version_major > $major } {
> + return 1
> + } elseif { $tcl_version_major == $major \
> + && $tcl_version_major >= $minor } {
> + return 1
> + } else {
> + return 0
> + }
> +}
This fixes a typo in the previous commit.
Thanks,
- Tom
[gdb/testsuite] Fix typo in tcl_version_at_least
In tcl_version_at_least we compare a minor against a major version number:
...
} elseif { $tcl_version_major == $major \
&& $tcl_version_major >= $minor } {
...
Fix this by using $tcl_version_minor in the comparison instead.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-08-05 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (tcl_version_at_least): Fix typo.
---
gdb/testsuite/lib/gdb.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9ca34d8b15..6d16217f3b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1111,7 +1111,7 @@ proc tcl_version_at_least { major minor } {
if { $tcl_version_major > $major } {
return 1
} elseif { $tcl_version_major == $major \
- && $tcl_version_major >= $minor } {
+ && $tcl_version_minor >= $minor } {
return 1
} else {
return 0