Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / gdb1555.exp
CommitLineData
9b254dd1 1# Copyright 2004, 2007, 2008 Free Software Foundation, Inc.
f3205b34
AF
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
f3205b34 6# (at your option) any later version.
e22f8b7c 7#
f3205b34
AF
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#
f3205b34 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/>. */
f3205b34
AF
15
16# Please email any bugs, comments, and/or additions to this file to:
17# bug-gdb@prep.ai.mit.edu
18
19# Test stepping into and continuing on from a function in
20# a shared library (PR gdb/1555, was PR shlib/1280, shlib/1237).
21# Tested on ppc-yellowdog-linux (Yellow Dog Linux 3.0 3.2.2-2a)
22
23if $tracelevel then {
24 strace $tracelevel
25}
26
93f02886
DJ
27if {[skip_shlib_tests]} {
28 return 0
29}
30
f3205b34
AF
31set testfile gdb1555-main
32set libfile gdb1555
33set srcfile ${testfile}.c
34set binfile ${objdir}/${subdir}/${testfile}
35
9af2e58d
DJ
36set libsrc "${srcdir}/${subdir}/${libfile}.c"
37set libobj "${objdir}/${subdir}/${libfile}.so"
38set execsrc "${srcdir}/${subdir}/${srcfile}"
f3205b34 39
9af2e58d 40remote_exec build "rm -f ${binfile}"
f3205b34 41
9af2e58d
DJ
42# get the value of gcc_compiled
43if [get_compiler_info ${binfile}] {
f3205b34
AF
44 return -1
45}
46
9af2e58d
DJ
47if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
48 || [gdb_compile $execsrc ${binfile} executable \
49 [list debug shlib=${libobj}]] != "" } {
f3205b34
AF
50 return -1
51}
52
f3205b34
AF
53gdb_exit
54gdb_start
55gdb_reinitialize_dir $srcdir/$subdir
56gdb_load ${binfile}
93f02886 57gdb_load_shlibs $libobj
f3205b34
AF
58
59if ![runto_main] then {
60 fail "Can't run to main"
61 return 0
62}
63
64# PR/1555 (was shlib 1280)
65set name "Step into shared lib function"
66gdb_test_multiple "s" $name \
67{
b9c34f67 68 -re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $" {
f3205b34
AF
69 pass $name
70 }
71 -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" {
72 kfail "gdb/1555" $name
73 }
74}
75
76# PR/1555 (was shlib 1237)
77set name "Next while in a shared lib function"
78gdb_test_multiple "n" $name \
79{
b9c34f67 80 -re "\[0-9\]+.*return a;.*$gdb_prompt $" {
f3205b34
AF
81 pass $name
82 }
83 -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\nProgram exited normally.*$gdb_prompt $" {
84 kfail "gdb/1555" $name
85 }
86}
87
This page took 0.355005 seconds and 4 git commands to generate.