Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.opt / solib-intra-step.exp
CommitLineData
88b9d363 1# Copyright 2015-2022 Free Software Foundation, Inc.
141c5cc4
JK
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
16standard_testfile
17
18if {[skip_shlib_tests]} {
19 return 0
20}
21
22# Library file.
23set libname "${testfile}-lib"
24set srcfile_lib ${srcdir}/${subdir}/${libname}.c
25set binfile_lib [standard_output_file ${libname}.so]
26set lib_flags [list debug optimize=-O2]
27# Binary file.
28set testfile "${testfile}-main"
29set srcfile ${srcdir}/${subdir}/${testfile}.c
30set binfile [standard_output_file ${testfile}]
31set bin_flags [list debug shlib=${binfile_lib}]
32
33if [get_compiler_info] {
34 return -1
35}
36
37if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
38 || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } {
84c93cd5 39 untested "failed to compile"
141c5cc4
JK
40 return -1
41}
42
43clean_restart ${binfile}
d9019901 44gdb_load_shlib $binfile_lib
141c5cc4
JK
45
46if ![runto_main] then {
47 return 0
48}
49
50set test "first-hit"
51gdb_test_multiple "step" $test {
d0021af3 52 -re -wrap " first-hit .*" {
620ec3ca 53 pass $gdb_test_name
141c5cc4 54 }
d0021af3 55 -re -wrap " first-retry .*" {
d0021af3
TV
56 send_gdb "step\n"
57 exp_continue
58 }
59 -re -wrap "get_pc_thunk.*" {
d0021af3
TV
60 send_gdb "step\n"
61 exp_continue
141c5cc4
JK
62 }
63}
64
65set test "second-hit"
66gdb_test_multiple "step" $test {
d0021af3 67 -re -wrap " second-hit .*" {
620ec3ca 68 pass $gdb_test_name
141c5cc4 69 }
d0021af3 70 -re -wrap " second-retry .*" {
d0021af3
TV
71 send_gdb "step\n"
72 exp_continue
141c5cc4 73 }
d0021af3 74 -re -wrap "get_pc_thunk.*" {
d0021af3
TV
75 send_gdb "step\n"
76 exp_continue
141c5cc4
JK
77 }
78}
79
80if ![runto_main] then {
81 return 0
82}
83
84gdb_breakpoint "shlib_second"
85gdb_continue_to_breakpoint "second-hit" ".* (second-hit|second-retry) .*"
This page took 0.786944 seconds and 4 git commands to generate.