]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/so-impl-ld.exp
Update Copyright year range in all files maintained by GDB.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / so-impl-ld.exp
1 # Copyright 1997-2014 Free Software Foundation, Inc.
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
16
17 if {[skip_shlib_tests]} {
18 return 0
19 }
20
21 standard_testfile .c
22 set libfile "solib1"
23 set libsrc $srcdir/$subdir/$libfile.c
24 set lib_sl [standard_output_file $libfile.sl]
25
26 set lib_opts debug
27 set exec_opts [list debug shlib=$lib_sl]
28
29 if [get_compiler_info] {
30 return -1
31 }
32
33 if [get_compiler_info] {
34 return -1
35 }
36
37 if [test_compiler_info "hpcc-*"] {
38 lappend exec_opts "additional_flags=-Ae"
39 }
40
41 if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
42 || [gdb_compile $srcdir/$subdir/$srcfile $binfile \
43 executable $exec_opts] != ""} {
44 untested "Couldn't compile $libsrc or $srcfile."
45 return -1
46 }
47
48 # Start with a fresh gdb
49
50 clean_restart ${binfile}
51 gdb_load_shlibs $lib_sl
52
53 # This program implicitly loads SOM shared libraries.
54 #
55 if ![runto_main] then { fail "implicit solibs tests suppressed" }
56
57 # Verify that we can step over the first shlib call.
58 #
59 gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
60 "step over solib call"
61
62 # Verify that we can step into the second shlib call.
63 #
64 gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
65 "step into solib call"
66
67 # Verify that we can step within the shlib call.
68 #
69 gdb_test "next" "18\[ \t\]*\}" "step in solib call"
70
71 # Verify that we can step out of the shlib call, and back out into
72 # the caller.
73 #
74 gdb_test_multiple "next" "step out of solib call" {
75 -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" {
76 gdb_test "next" \
77 "main .. at.*so-impl-ld.c:22.*" \
78 "step out of solib call"
79 }
80 -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $" {
81 pass "step out of solib call"
82 }
83 }
84
85 gdb_exit
86 return 0
87
88
89
90
91
92