1 # Copyright 1997, 1998, 1999, 2000, 2001, 2003, 2005
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 # are we on a target board
30 set testfile "so-impl-ld"
32 set srcfile $srcdir/$subdir/$testfile.c
33 set libsrc $srcdir/$subdir/$libfile.c
34 set binfile $objdir/$subdir/$testfile
35 set lib_sl $objdir/$subdir/$libfile.sl
38 set exec_opts [list debug shlib=$lib_sl]
40 if [get_compiler_info ${binfile}] {
44 if [get_compiler_info ${binfile}] {
48 if [test_compiler_info "hpcc-*"] {
49 lappend exec_opts "additional_flags=-Ae"
52 if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
53 || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} {
54 untested "Couldn't compile $libsrc or $srcfile."
58 # Start with a fresh gdb
62 gdb_reinitialize_dir $srcdir/$subdir
65 # This program implicitly loads SOM shared libraries.
67 if ![runto_main] then { fail "implicit solibs tests suppressed" }
69 # Verify that we can step over the first shlib call.
73 -re "21\[ \t\]*result = solib_main .result.*$gdb_prompt $"\
74 {pass "step over solib call"}
76 {fail "step over solib call"}
77 timeout {fail "(timeout) step over solib call"}
80 # Verify that we can step into the second shlib call.
84 -re "solib_main .arg=10000. at.*${libfile}.c:17.*$gdb_prompt $"\
85 {pass "step into solib call"}
87 {fail "step into solib call"}
88 timeout {fail "(timeout) step into solib call"}
91 # Verify that we can step within the shlib call.
95 -re "18\[ \t\]*\}.*$gdb_prompt $"\
96 {pass "step in solib call"}
98 {fail "step in solib call"}
99 timeout {fail "(timeout) step in solib call"}
102 # Verify that we can step out of the shlib call, and back out into
107 -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" {
108 # we haven't left the callee yet, so do another next
111 -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $"\
112 {pass "step out of solib call"}
114 {fail "step out of solib call"}
115 timeout {fail "(timeout) step out of solib call"}
119 -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $"\
120 {pass "step out of solib call"}
122 {fail "step out of solib call"}
123 timeout {fail "(timeout) step out of solib call"}