GDB: trad-frame: Store length of value_bytes in trad_frame_saved_reg
[binutils-gdb.git] / gdb / testsuite / gdb.base / symtab-search-order.exp
blobd34b0af21f87119d2a3393373c8dcc24c53a011b
1 # Copyright 2014-2024 Free Software Foundation, Inc.
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.
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.
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/>.
16 require allow_shlib_tests
18 standard_testfile .c symtab-search-order-1.c symtab-search-order-shlib-1.c
19 set srcfile $srcdir/$subdir/$srcfile
20 set srcfile2 $srcdir/$subdir/$srcfile2
21 set lib1src $srcdir/$subdir/$srcfile3
22 set lib1 [standard_output_file symtab-search-order-1.sl]
24 set lib_opts "debug"
25 set exec_opts [list debug shlib=$lib1]
27 if { [gdb_compile_shlib $lib1src $lib1 $lib_opts] != ""
28 || [gdb_compile [list $srcfile $srcfile2] $binfile executable \
29 $exec_opts] != ""} {
30 untested "failed to compile"
31 return -1
34 # Start with a fresh gdb.
36 clean_restart $binfile
37 gdb_load_shlib $lib1
39 if ![runto_main] {
40 return -1
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.
51 gdb_test "p shlib_1_func" "= .*<shlib_1_func>"
52 gdb_test "p static_global" " = 23"