Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / so-impl-ld.exp
CommitLineData
28e7fd62 1# Copyright 1997-2013 Free Software Foundation, Inc.
c906108c
SS
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
c906108c 6# (at your option) any later version.
e22f8b7c 7#
c906108c
SS
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.
e22f8b7c 12#
c906108c 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 15
c906108c 16
93f02886
DJ
17if {[skip_shlib_tests]} {
18 return 0
c906108c
SS
19}
20
c906108c 21set testfile "so-impl-ld"
bf7234cf
PG
22set libfile "solib1"
23set srcfile $srcdir/$subdir/$testfile.c
24set libsrc $srcdir/$subdir/$libfile.c
25set binfile $objdir/$subdir/$testfile
26set lib_sl $objdir/$subdir/$libfile.sl
27
28set lib_opts debug
29set exec_opts [list debug shlib=$lib_sl]
c906108c 30
4c93b1db 31if [get_compiler_info] {
c906108c
SS
32 return -1
33}
34
4c93b1db 35if [get_compiler_info] {
c906108c
SS
36 return -1
37}
38
bf7234cf
PG
39if [test_compiler_info "hpcc-*"] {
40 lappend exec_opts "additional_flags=-Ae"
c906108c
SS
41}
42
bf7234cf
PG
43if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
44 || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} {
45 untested "Couldn't compile $libsrc or $srcfile."
c906108c
SS
46 return -1
47}
c906108c
SS
48
49# Start with a fresh gdb
50
51gdb_exit
52gdb_start
53gdb_reinitialize_dir $srcdir/$subdir
54gdb_load ${binfile}
93f02886 55gdb_load_shlibs $lib_sl
c906108c
SS
56
57# This program implicitly loads SOM shared libraries.
58#
59if ![runto_main] then { fail "implicit solibs tests suppressed" }
60
61# Verify that we can step over the first shlib call.
62#
02746bbc
MS
63gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
64 "step over solib call"
c906108c
SS
65
66# Verify that we can step into the second shlib call.
67#
02746bbc
MS
68gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
69 "step into solib call"
c906108c
SS
70
71# Verify that we can step within the shlib call.
72#
02746bbc 73gdb_test "next" "18\[ \t\]*\}" "step in solib call"
c906108c
SS
74
75# Verify that we can step out of the shlib call, and back out into
76# the caller.
77#
02746bbc 78gdb_test_multiple "next" "step out of solib call" {
c906108c 79 -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" {
02746bbc
MS
80 gdb_test "next" \
81 "main .. at.*so-impl-ld.c:22.*" \
82 "step out of solib call"
83 }
84 -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $" {
85 pass "step out of solib call"
c906108c 86 }
c906108c
SS
87}
88
89gdb_exit
90return 0
0d06e24b
JM
91
92
93
94
95
96
This page took 1.735727 seconds and 4 git commands to generate.