2011-01-01 15:34:07 +00:00
|
|
|
# Copyright 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
2004-02-18 03:35:08 +00:00
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2004-02-18 03:35:08 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2004-02-18 03:35:08 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2004-02-18 03:35:08 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2004-02-18 03:35:08 +00:00
|
|
|
|
|
|
|
# Test stepping into and continuing on from a function in
|
|
|
|
# a shared library (PR gdb/1555, was PR shlib/1280, shlib/1237).
|
|
|
|
# Tested on ppc-yellowdog-linux (Yellow Dog Linux 3.0 3.2.2-2a)
|
|
|
|
|
|
|
|
if $tracelevel then {
|
|
|
|
strace $tracelevel
|
|
|
|
}
|
|
|
|
|
2007-05-16 14:21:47 +00:00
|
|
|
if {[skip_shlib_tests]} {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2004-02-18 03:35:08 +00:00
|
|
|
set testfile gdb1555-main
|
|
|
|
set libfile gdb1555
|
|
|
|
set srcfile ${testfile}.c
|
|
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
|
|
|
|
2006-06-22 19:53:46 +00:00
|
|
|
set libsrc "${srcdir}/${subdir}/${libfile}.c"
|
|
|
|
set libobj "${objdir}/${subdir}/${libfile}.so"
|
|
|
|
set execsrc "${srcdir}/${subdir}/${srcfile}"
|
2004-02-18 03:35:08 +00:00
|
|
|
|
2006-06-22 19:53:46 +00:00
|
|
|
remote_exec build "rm -f ${binfile}"
|
2004-02-18 03:35:08 +00:00
|
|
|
|
2006-06-22 19:53:46 +00:00
|
|
|
# get the value of gcc_compiled
|
|
|
|
if [get_compiler_info ${binfile}] {
|
2004-02-18 03:35:08 +00:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
2006-06-22 19:53:46 +00:00
|
|
|
if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
|
|
|
|
|| [gdb_compile $execsrc ${binfile} executable \
|
|
|
|
[list debug shlib=${libobj}]] != "" } {
|
2004-02-18 03:35:08 +00:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
gdb_load ${binfile}
|
2007-05-16 14:21:47 +00:00
|
|
|
gdb_load_shlibs $libobj
|
2004-02-18 03:35:08 +00:00
|
|
|
|
|
|
|
if ![runto_main] then {
|
|
|
|
fail "Can't run to main"
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
# PR/1555 (was shlib 1280)
|
|
|
|
set name "Step into shared lib function"
|
|
|
|
gdb_test_multiple "s" $name \
|
|
|
|
{
|
2007-08-18 01:21:42 +00:00
|
|
|
-re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $" {
|
2004-02-18 03:35:08 +00:00
|
|
|
pass $name
|
|
|
|
}
|
|
|
|
-re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" {
|
|
|
|
kfail "gdb/1555" $name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# PR/1555 (was shlib 1237)
|
|
|
|
set name "Next while in a shared lib function"
|
|
|
|
gdb_test_multiple "n" $name \
|
|
|
|
{
|
2007-08-18 01:21:42 +00:00
|
|
|
-re "\[0-9\]+.*return a;.*$gdb_prompt $" {
|
2004-02-18 03:35:08 +00:00
|
|
|
pass $name
|
|
|
|
}
|
2011-03-07 16:03:04 +00:00
|
|
|
-re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" {
|
2004-02-18 03:35:08 +00:00
|
|
|
kfail "gdb/1555" $name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|