1 # Copyright 2007-2023 Free Software Foundation, Inc.
2 # This program is free software; you can redistribute it and/or modify
3 # it under the terms of the GNU General Public License as published by
4 # the Free Software Foundation; either version 3 of the License, or
5 # (at your option) any later version.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # Contributed by Markus Deuling <deuling@de.ibm.com>.
18 if {[skip_shlib_tests]} {
23 set libname "solib-symbol-lib"
24 set srcfile_lib ${srcdir}/${subdir}/${libname}.c
25 set binfile_lib [standard_output_file ${libname}.so]
26 set lib_flags [list debug ldflags=-Wl,-Bsymbolic]
28 set testfile "solib-symbol-main"
29 set srcfile ${srcdir}/${subdir}/${testfile}.c
30 set binfile [standard_output_file ${testfile}]
31 set bin_flags [list debug shlib=${binfile_lib}]
33 if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
34 || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
35 untested "failed to compile"
41 gdb_reinitialize_dir $srcdir/$subdir
43 gdb_load_shlib $binfile_lib
45 # Set a breakpoint in the binary.
47 "Breakpoint.*file.*${testfile}\\.c.*" \
56 # Break in the library.
58 "Breakpoint.*file.*${libname}\\.c.*" \
64 # This symbol is now looked up in the ELF library and the binary.
66 "Breakpoint.*: foo2. .2 locations..*" \