1 # Copyright 2015-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/>.
18 require allow_shlib_tests
21 set libname "${testfile}-lib"
22 set srcfile_lib ${srcdir}/${subdir}/${libname}.c
23 set binfile_lib [standard_output_file ${libname}.so]
24 set lib_flags [list debug optimize=-O2]
26 set testfile "${testfile}-main"
27 set srcfile ${srcdir}/${subdir}/${testfile}.c
28 set binfile [standard_output_file ${testfile}]
29 set bin_flags [list debug shlib=${binfile_lib}]
31 if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
32 || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
33 untested "failed to compile"
37 clean_restart ${binfile}
38 gdb_load_shlib $binfile_lib
45 gdb_test_multiple "step" $test {
46 -re -wrap " first-hit .*" {
49 -re -wrap " first-retry .*" {
53 -re -wrap "get_pc_thunk.*" {
61 gdb_test_multiple "step" $test {
62 -re -wrap " first-retry .*" {
70 -re -wrap " first-hit .*" {
78 -re -wrap " second-hit .*" {
81 -re -wrap " second-retry .*" {
86 -re -wrap "get_pc_thunk.*" {
97 gdb_breakpoint "shlib_second"
98 gdb_continue_to_breakpoint "second-hit" ".* (second-hit|second-retry) .*"