Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
@ 2025-10-11 13:13 Tom de Vries
  2025-10-14 14:59 ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2025-10-11 13:13 UTC (permalink / raw)
  To: gdb-patches

On ppc64-linux (debian 14) I run into:
...
(gdb) print p_record^M
$1 = (kind => five, i => <error reading variable: \
  access outside bounds of object>^M
(gdb) gdb_do_cache: get_compiler_info_1 ( c )
get_compiler_info: gcc-15-2-0
gdb_do_cache: get_compiler_info_1 ( c )
FAIL: gdb.ada/variant_record_field.exp: print p_record
...

The test-case contains an xfail for "[gcc_major_version] <= 14", which doesn't
trigger because gcc has version 15.2.0, while gnatmake does have version
14.3.0:
...
$ gcc --version
gcc (Debian 15.2.0-4) 15.2.0
  ...
$ gnatmake --version
GNATMAKE 14.3.0
...

Fix this by using "[gnat_version_compare < 15]" instead.

Tested on ppc64-linux and x86_64-linux.
---
 gdb/testsuite/gdb.ada/variant_record_field.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.ada/variant_record_field.exp b/gdb/testsuite/gdb.ada/variant_record_field.exp
index fb5361d8b11..13088104edb 100644
--- a/gdb/testsuite/gdb.ada/variant_record_field.exp
+++ b/gdb/testsuite/gdb.ada/variant_record_field.exp
@@ -46,7 +46,7 @@ gdb_test_multiple "$test" "$test" {
 	pass $test
     }
     -re "\\(kind => five, i => <error reading variable: access outside bounds of object>" {
-	if { [gcc_major_version] <= 14 } {
+	if { [gnat_version_compare < 15] } {
 	    setup_xfail *-*-*
 	}
 	fail $test

base-commit: 6b0581fc925ab807647a0ff38f7f015bf94c0eb0
-- 
2.51.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
  2025-10-11 13:13 [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp Tom de Vries
@ 2025-10-14 14:59 ` Tom Tromey
  2025-10-14 16:04   ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2025-10-14 14:59 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> The test-case contains an xfail for "[gcc_major_version] <= 14", which doesn't
Tom> trigger because gcc has version 15.2.0, while gnatmake does have version
Tom> 14.3.0:

This is ok.  I wonder if the other uses of gcc_major_version in gdb.ada
should also be updated.

Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
  2025-10-14 14:59 ` Tom Tromey
@ 2025-10-14 16:04   ` Tom de Vries
  2025-10-14 16:17     ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2025-10-14 16:04 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 10/14/25 4:59 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> The test-case contains an xfail for "[gcc_major_version] <= 14", which doesn't
> Tom> trigger because gcc has version 15.2.0, while gnatmake does have version
> Tom> 14.3.0:
> 
> This is ok.  I wonder if the other uses of gcc_major_version in gdb.ada
> should also be updated.
> 

Hi Tom,

thanks for the review, pushed.

Agreed, but it'd be nice to do so while being able to test the change.

For instance, in this case I first tried "[gnat_version_compare <= 14]" 
which didn't work, which testing pointed out to me.

Thanks,
- Tom

> Approved-By: Tom Tromey <tom@tromey.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
  2025-10-14 16:04   ` Tom de Vries
@ 2025-10-14 16:17     ` Tom Tromey
  2025-10-19 19:50       ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2025-10-14 16:17 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Tom Tromey, gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> For instance, in this case I first tried "[gnat_version_compare <=
Tom> 14]" which didn't work, which testing pointed out to me.

That's quite strange since gnat_version_compare delegates to
version_compare, which seems to handle "<=" just fine.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
  2025-10-14 16:17     ` Tom Tromey
@ 2025-10-19 19:50       ` Tom de Vries
  2025-10-19 21:02         ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2025-10-19 19:50 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 10/14/25 6:17 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> For instance, in this case I first tried "[gnat_version_compare <=
> Tom> 14]" which didn't work, which testing pointed out to me.
> 
> That's quite strange since gnat_version_compare delegates to
> version_compare, which seems to handle "<=" just fine.

Well, it's just that for gcc 14.3.0, "[gcc_major_version] <= 14" is 1, 
but [gnat_version_compare <= 14] is 0.

Anyway, having figured this out I gave it a try with the remaining uses 
for gcc_major_version in gdb.ada ( 
https://sourceware.org/pipermail/gdb-patches/2025-October/221847.html ).

Thanks,
- Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
  2025-10-19 19:50       ` Tom de Vries
@ 2025-10-19 21:02         ` Tom Tromey
  2025-10-20  7:46           ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2025-10-19 21:02 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Tom Tromey, gdb-patches

Tom> Well, it's just that for gcc 14.3.0, "[gcc_major_version] <= 14" is 1,
Tom> but [gnat_version_compare <= 14] is 0.

That seems strange though.
Do they come from different builds?

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp
  2025-10-19 21:02         ` Tom Tromey
@ 2025-10-20  7:46           ` Tom de Vries
  0 siblings, 0 replies; 7+ messages in thread
From: Tom de Vries @ 2025-10-20  7:46 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 10/19/25 11:02 PM, Tom Tromey wrote:
> Tom> Well, it's just that for gcc 14.3.0, "[gcc_major_version] <= 14" is 1,
> Tom> but [gnat_version_compare <= 14] is 0.
> 
> That seems strange though.
> Do they come from different builds?

No, I meant gcc 14.3.0 / gnat 14.3.0.

If gcc is version 14.3.0, gcc_major_version is 14, and 14 <= 14 is 1.

If gnat is version 14.3.0, gnat_version_compare <= 14 is version_compare 
{14 3 0} <= {14}, which is 0.

There is some oddity in version_compare related to comparing lists of 
different length: version_compare {1} < {1 0} == 1.

But I don't think that's relevant here.  If I do
version_compare {14 3 0} <= {14 0 0}, I also get 0.

Thanks,
- Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-20  7:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-11 13:13 [PATCH] [gdb/testsuite] Fix xfail in gdb.ada/variant_record_field.exp Tom de Vries
2025-10-14 14:59 ` Tom Tromey
2025-10-14 16:04   ` Tom de Vries
2025-10-14 16:17     ` Tom Tromey
2025-10-19 19:50       ` Tom de Vries
2025-10-19 21:02         ` Tom Tromey
2025-10-20  7:46           ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox