]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/symtab-search-order.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / symtab-search-order.exp
CommitLineData
1d506c26 1# Copyright 2014-2024 Free Software Foundation, Inc.
af3768e9
DE
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
d6195dc9 16require allow_shlib_tests
af3768e9
DE
17
18standard_testfile .c symtab-search-order-1.c symtab-search-order-shlib-1.c
19set srcfile $srcdir/$subdir/$srcfile
20set srcfile2 $srcdir/$subdir/$srcfile2
21set lib1src $srcdir/$subdir/$srcfile3
22set lib1 [standard_output_file symtab-search-order-1.sl]
23
24set lib_opts "debug"
25set exec_opts [list debug shlib=$lib1]
26
af3768e9
DE
27if { [gdb_compile_shlib $lib1src $lib1 $lib_opts] != ""
28 || [gdb_compile [list $srcfile $srcfile2] $binfile executable \
29 $exec_opts] != ""} {
84c93cd5 30 untested "failed to compile"
af3768e9
DE
31 return -1
32}
33
34# Start with a fresh gdb.
35
36clean_restart $binfile
d9019901 37gdb_load_shlib $lib1
af3768e9
DE
38
39if ![runto_main] {
af3768e9
DE
40 return -1
41}
42
43# PR 17564
44# Expand something in the shared library,
45# and then try to print static_global in the binary.
46# We should get the static_global in the binary.
47# Note: static_global in the binary needs to be in a file
48# other than the one with "main" because gdb will expand
49# the symtab with main when starting.
50
51gdb_test "p shlib_1_func" "= .*<shlib_1_func>"
52gdb_test "p static_global" " = 23"