Commit | Line | Data |
---|---|---|
618f726f | 1 | # Copyright 1997-2016 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 |
17 | if {[skip_shlib_tests]} { |
18 | return 0 | |
c906108c SS |
19 | } |
20 | ||
0ab77f5f | 21 | standard_testfile .c |
bf7234cf | 22 | set libfile "solib1" |
bf7234cf | 23 | set libsrc $srcdir/$subdir/$libfile.c |
0ab77f5f | 24 | set lib_sl [standard_output_file $libfile.sl] |
bf7234cf PG |
25 | |
26 | set lib_opts debug | |
27 | set exec_opts [list debug shlib=$lib_sl] | |
c906108c | 28 | |
4c93b1db | 29 | if [get_compiler_info] { |
c906108c SS |
30 | return -1 |
31 | } | |
32 | ||
bf7234cf | 33 | if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" |
0ab77f5f TT |
34 | || [gdb_compile $srcdir/$subdir/$srcfile $binfile \ |
35 | executable $exec_opts] != ""} { | |
84c93cd5 | 36 | untested "failed to compile" |
c906108c SS |
37 | return -1 |
38 | } | |
c906108c SS |
39 | |
40 | # Start with a fresh gdb | |
41 | ||
0ab77f5f | 42 | clean_restart ${binfile} |
d9019901 | 43 | gdb_load_shlib $lib_sl |
c906108c SS |
44 | |
45 | # This program implicitly loads SOM shared libraries. | |
46 | # | |
47 | if ![runto_main] then { fail "implicit solibs tests suppressed" } | |
48 | ||
49 | # Verify that we can step over the first shlib call. | |
50 | # | |
02746bbc MS |
51 | gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \ |
52 | "step over solib call" | |
c906108c SS |
53 | |
54 | # Verify that we can step into the second shlib call. | |
55 | # | |
9ecfcd1d | 56 | gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:${decimal}.* HERE .*" \ |
02746bbc | 57 | "step into solib call" |
c906108c SS |
58 | |
59 | # Verify that we can step within the shlib call. | |
60 | # | |
9ecfcd1d | 61 | gdb_test "next" "${decimal}\[ \t\]*\}.* STEP .*" "step in solib call" |
c906108c SS |
62 | |
63 | # Verify that we can step out of the shlib call, and back out into | |
64 | # the caller. | |
65 | # | |
02746bbc | 66 | gdb_test_multiple "next" "step out of solib call" { |
c906108c | 67 | -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" { |
02746bbc MS |
68 | gdb_test "next" \ |
69 | "main .. at.*so-impl-ld.c:22.*" \ | |
70 | "step out of solib call" | |
71 | } | |
72 | -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $" { | |
73 | pass "step out of solib call" | |
c906108c | 74 | } |
c906108c SS |
75 | } |
76 | ||
77 | gdb_exit | |
78 | return 0 | |
0d06e24b JM |
79 | |
80 | ||
81 | ||
82 | ||
83 | ||
84 |