[gdb/testsuite] Fix gdb.threads/dlopen-libpthread.exp for upstream glibc
authorTom de Vries <tdevries@suse.de>
Fri, 30 Dec 2022 15:53:51 +0000 (16:53 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 30 Dec 2022 15:53:51 +0000 (16:53 +0100)
commitcb2a1d0aca416235aed885e4796eeb70fbcd3b95
tree0555e0c0e226d0db899a6a73c0d58b7b1cd4f737
parentd6246a8730fad9edcb972c1f689a13bb16640483
[gdb/testsuite] Fix gdb.threads/dlopen-libpthread.exp for upstream glibc

On ubuntu 22.04.1 x86_64, I run into:
...
(gdb) info probes all rtld rtld_map_complete^M
No probes matched.^M
(gdb) XFAIL: gdb.threads/dlopen-libpthread.exp: info probes all rtld rtld_map_complete
UNTESTED: gdb.threads/dlopen-libpthread.exp: no matching probes
...
This has been filed as PR testsuite/17016.

The problem is that the name rtld_map_complete is used, which was only
available in Fedora 17, and upstream the name map_complete was used.

In the email thread discussing a proposed patch (
https://sourceware.org/legacy-ml/gdb-patches/2014-09/msg00712.html ) it was
suggested to make the test-case handle both names.

So, handle both names: map_complete and rtld_map_complete.

This exposes the following FAIL:
...
(gdb) info sharedlibrary^M
From To    Syms Read Shared Object Library^M
$hex $hex  Yes       /lib64/ld-linux-x86-64.so.2^M
$hex $hex  Yes (*)   /lib/x86_64-linux-gnu/libgtk3-nocsd.so.0^M
$hex $hex  Yes       /lib/x86_64-linux-gnu/libc.so.6^M
$hex $hex  Yes       /lib/x86_64-linux-gnu/libdl.so.2^M
$hex $hex  Yes       /lib/x86_64-linux-gnu/libpthread.so.0^M
(*): Shared library is missing debugging information.^M
(gdb) FAIL: gdb.threads/dlopen-libpthread.exp: libpthread.so not found
...
due to using a glibc (v2.35) that has libpthread integrated into libc.

Fix this by changing the FAIL into UNSUPPORTED.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17016
gdb/testsuite/gdb.threads/dlopen-libpthread.exp