public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Fix gdb.base/print-symbol-loading.exp on ubuntu 22.04.1
@ 2022-12-31  6:36 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-12-31  6:36 UTC (permalink / raw)
  To: gdb-patches

On ubuntu 22.04.1 x86_64, I run into:
...
(gdb) PASS: gdb.base/print-symbol-loading.exp: shlib off: \
  set print symbol-loading off
sharedlibrary .*^M
Symbols already loaded for /lib/x86_64-linux-gnu/libc.so.6^M
Symbols already loaded for /lib/x86_64-linux-gnu/libpthread.so.0^M
(gdb) FAIL: gdb.base/print-symbol-loading.exp: shlib off: load shared-lib
...

The test-case expects the libc.so line, but not the libpthread.so line.

However, we have:
...
$ ldd /lib/x86_64-linux-gnu/libc.so.6
	linux-vdso.so.1 (0x00007ffd7f7e7000)
	libgtk3-nocsd.so.0 => /lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f4468c00000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4469193000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4468f3e000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4468f39000)
...
so it's not unexpected that libpthread.so is loaded if libc.so is loaded.

Fix this by accepting the libpthread.so line.

Tested on x86_64-linux.

PR testsuite/29919
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29919
---
 gdb/testsuite/gdb.base/print-symbol-loading.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/print-symbol-loading.exp b/gdb/testsuite/gdb.base/print-symbol-loading.exp
index 6de1a748d28..82dc2a1ccf6 100644
--- a/gdb/testsuite/gdb.base/print-symbol-loading.exp
+++ b/gdb/testsuite/gdb.base/print-symbol-loading.exp
@@ -105,6 +105,10 @@ proc test_load_shlib { print_symbol_loading } {
 	}
 	gdb_test_no_output "set print symbol-loading $print_symbol_loading"
 	set test_name "load shared-lib"
+	set libc_re \
+	    [multi_line \
+		 "Symbols already loaded for\[^\r\n\]*\\/libc\\.\[^\r\n\]*(" \
+		 "Symbols already loaded for\[^\r\n\]*\\/libpthread\\.\[^\r\n\]*)?"]
 	switch ${print_symbol_loading} {
 	    "off" {
 		set cmd "sharedlibrary .*"
@@ -113,7 +117,7 @@ proc test_load_shlib { print_symbol_loading } {
 		    -re "^$cmd_regex\r\n$gdb_prompt $" {
 			pass $test_name
 		    }
-		    -re "^$cmd_regex\r\nSymbols already loaded for\[^\r\n\]*\\/libc\\.\[^\r\n\]*\r\n$gdb_prompt $" {
+		    -re "^$cmd_regex\r\n$libc_re\r\n$gdb_prompt $" {
 			pass $test_name
 		    }
 		}

base-commit: 32c960fac8d4d52d3afca088b3419e3e658d322e
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-31  6:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-31  6:36 [pushed] [gdb/testsuite] Fix gdb.base/print-symbol-loading.exp on ubuntu 22.04.1 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).