Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <= 12
@ 2024-03-25 14:05 Tom de Vries
  2024-03-25 14:19 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2024-03-25 14:05 UTC (permalink / raw)
  To: gdb-patches

With gcc 13, test-case gdb.ada/tagged-lookup.exp passes for me, but with gcc
12, I get:
...
(gdb) set debug symtab-create 1^M
(gdb) print *the_local_var^M
  ...
$1 = (n => 2)^M
(gdb) FAIL: gdb.ada/tagged-lookup.exp: only one CU expanded
...

The problem is that this fails:
...
    -re -wrap ".* = \\\(n => $decimal\\\)" {
	if {$found_pck + $found_pck2 == 1} {
	    pass $gdb_test_name
	} else {
	    fail $gdb_test_name
	}
...
because $found_pck == 0 and $found_pck2 == 0.

Indeed, with gcc 13 we have:
...
$ grep "start_subfile: name = .*/tagged-lookup/" gdb.log | sed 's%.*/%%'
b~foo.adb
b~foo.adb
b~foo.adb
b~foo.ads
pck2.adb
pck2.adb
pck2.ads
pck2.adb
pck2.ads
...
and with gcc 12:
...
$ grep "start_subfile: name = .*/tagged-lookup/" gdb.log | sed 's%.*/%%'
b~foo.adb
b~foo.adb
b~foo.adb
b~foo.ads
...

Fix this by checking for "$found_pck + $found_pck2 <= 1" instead.

Tested on x86_64-linux.

PR testsuite/31514
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31514
---
 gdb/testsuite/gdb.ada/tagged-lookup.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.ada/tagged-lookup.exp b/gdb/testsuite/gdb.ada/tagged-lookup.exp
index 4bc088ba8d5..3803319c505 100644
--- a/gdb/testsuite/gdb.ada/tagged-lookup.exp
+++ b/gdb/testsuite/gdb.ada/tagged-lookup.exp
@@ -52,7 +52,7 @@ gdb_test_multiple "print *the_local_var" "only one CU expanded" -lbl {
 	exp_continue
     }
     -re -wrap ".* = \\\(n => $decimal\\\)" {
-	if {$found_pck + $found_pck2 == 1} {
+	if {$found_pck + $found_pck2 <= 1} {
 	    pass $gdb_test_name
 	} else {
 	    fail $gdb_test_name

base-commit: 61ced226a4fc2e6df7836cd9c0f7e1ad47af2440
-- 
2.35.3


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

* Re: [PATCH] [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <= 12
  2024-03-25 14:05 [PATCH] [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <= 12 Tom de Vries
@ 2024-03-25 14:19 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2024-03-25 14:19 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

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

Tom> Fix this by checking for "$found_pck + $found_pck2 <= 1" instead.

Tom> Tested on x86_64-linux.

Tom> PR testsuite/31514
Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31514

Thank you.  This is ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom

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

end of thread, other threads:[~2024-03-25 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 14:05 [PATCH] [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with gcc <= 12 Tom de Vries
2024-03-25 14:19 ` Tom Tromey

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