From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 23B1B3858D1E; Sat, 31 Dec 2022 06:36:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23B1B3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672468560; bh=Q2nJX55p1eGASOPsM6+pzYgbczPTY5bMmDxR3yeppWU=; h=From:To:Subject:Date:From; b=NvESJs55v/VQbJLK9DxhlvwsQQEH/mgtMfZCJlfOOJDwYeK+KkNoljxtRSwib15oZ K03yhsAEv8PA+QhC24VQa152PmlhvWxyAZazIzk3/e4jmC52Em1U7f5bQIjpqZRUvf 9UdZiJQPEkAKjs6Ju6re20xsCzLuwAiEkuiaK1FI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/print-symbol-loading.exp on ubuntu 22.04.1 X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 32c960fac8d4d52d3afca088b3419e3e658d322e X-Git-Newrev: 38ef8cc8e80fe7dc33152af1f85e7530e66f51b8 Message-Id: <20221231063600.23B1B3858D1E@sourceware.org> Date: Sat, 31 Dec 2022 06:36:00 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D38ef8cc8e80f= e7dc33152af1f85e7530e66f51b8 commit 38ef8cc8e80fe7dc33152af1f85e7530e66f51b8 Author: Tom de Vries Date: Sat Dec 31 07:35:56 2022 +0100 [gdb/testsuite] Fix gdb.base/print-symbol-loading.exp on ubuntu 22.04.1 =20 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-l= ib ... =20 The test-case expects the libc.so line, but not the libpthread.so line. =20 However, we have: ... $ ldd /lib/x86_64-linux-gnu/libc.so.6 linux-vdso.so.1 (0x00007ffd7f7e7000) libgtk3-nocsd.so.0 =3D> /lib/x86_64-linux-gnu/libgtk3-nocsd.so.= 0 (0x00007f4468c00000) /lib64/ld-linux-x86-64.so.2 (0x00007f4469193000) libdl.so.2 =3D> /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4468f= 3e000) libpthread.so.0 =3D> /lib/x86_64-linux-gnu/libpthread.so.0 (0x0= 0007f4468f39000) ... so it's not unexpected that libpthread.so is loaded if libc.so is loade= d. =20 Fix this by accepting the libpthread.so line. =20 Tested on x86_64-linux. =20 PR testsuite/29919 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29919 Diff: --- 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/testsuit= e/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 } }