test: cover subranges with present DW_AT_count attribute
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.threads / dlopen-libpthread.exp
CommitLineData
ecd75fc8 1# Copyright 2011-2014 Free Software Foundation, Inc.
a29a3fb7
GB
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16if {![istarget *-linux*] || [skip_shlib_tests]} {
17 return 0
18}
19
20load_lib prelink-support.exp
21
22set testfile "dlopen-libpthread"
23set srcmainfile ${testfile}.c
24set srclibfile ${testfile}-lib.c
25set executable ${testfile}
26set binfile_lib ${objdir}/${subdir}/${executable}.so
27set binfile ${objdir}/${subdir}/${executable}
28set lib_dlopen [shlib_target_file ${executable}.so]
29
30# Use build_executable_own_libs as prelinked libpthread.so can produce false
31# PASS - it is OK if GDB processes it still before relocation.
32
33set relink_args [build_executable_own_libs ${testfile}.exp ${executable}.so $srclibfile {debug shlib_pthreads} no]
34if {$relink_args == "" || ![prelink_no $relink_args]
35 || [prepare_for_testing ${testfile}.exp ${executable} ${srcmainfile} {debug shlib_load}] } {
36 return -1
37}
38gdb_load_shlibs $binfile_lib
39
40if { ![runto_main] } {
41 return -1
42}
43
44set test "info probes all rtld rtld_map_complete"
45gdb_test_multiple $test $test {
46 -re "\[ \t\]rtld_map_complete\[ \t\]+0x\[0-9a-f\]+.*\r\n$gdb_prompt $" {
47 pass $test
48 }
49 -re "No probes matched\\.\r\n$gdb_prompt $" {
50 xfail $test
51 untested ${testfile}.exp
52 return
53 }
54}
55
56set test "libpthread.so not found"
57gdb_test_multiple "info sharedlibrary" $test {
58 -re "/libpthread\\.so.*\r\n$gdb_prompt $" {
59 fail $test
60 }
61 -re "/libc\\.so.*\r\n$gdb_prompt $" {
62 pass $test
63 }
64}
65
66gdb_test "set variable filename=\"$lib_dlopen\""
67
68gdb_breakpoint "notify"
69
70# The error was:
71# Cannot find new threads: generic error
72gdb_continue_to_breakpoint "notify" ".* notify-here .*"
73
74gdb_test "info sharedlibrary" {/libpthread\.so.*} "libpthread.so found"
This page took 0.125998 seconds and 4 git commands to generate.