1 # Copyright 2004, 2007-2012 Free Software Foundation, Inc.
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.
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.
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/>. */
16 # Test stepping into and continuing on from a function in
17 # a shared library (PR gdb/1555, was PR shlib/1280, shlib/1237).
18 # Tested on ppc-yellowdog-linux (Yellow Dog Linux 3.0 3.2.2-2a)
20 if {[skip_shlib_tests]} {
24 set testfile gdb1555-main
26 set srcfile ${testfile}.c
27 set binfile ${objdir}/${subdir}/${testfile}
29 set libsrc "${srcdir}/${subdir}/${libfile}.c"
30 set libobj "${objdir}/${subdir}/${libfile}.so"
31 set execsrc "${srcdir}/${subdir}/${srcfile}"
33 remote_exec build "rm -f ${binfile}"
35 # get the value of gcc_compiled
36 if [get_compiler_info ${binfile}] {
40 if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
41 || [gdb_compile $execsrc ${binfile} executable \
42 [list debug shlib=${libobj}]] != "" } {
48 gdb_reinitialize_dir $srcdir/$subdir
50 gdb_load_shlibs $libobj
52 if ![runto_main] then {
53 fail "Can't run to main"
57 # PR/1555 (was shlib 1280)
58 set name "Step into shared lib function"
59 gdb_test_multiple "s" $name \
61 -re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $" {
64 -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" {
65 kfail "gdb/1555" $name
69 # PR/1555 (was shlib 1237)
70 set name "Next while in a shared lib function"
71 gdb_test_multiple "n" $name \
73 -re "\[0-9\]+.*return a;.*$gdb_prompt $" {
76 -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" {
77 kfail "gdb/1555" $name