1 # Copyright
2004 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
2 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
, write to the Free Software
15 # Foundation
, Inc.
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
*/
17 # Please email
any bugs
, comments
, and
/or additions to this file to
:
18 # bug
-gdb@prep.ai.mit.edu
20 # Test stepping into and continuing
on from a function in
21 # a shared library
(PR gdb
/1555, was PR shlib
/1280, shlib
/1237).
22 # Tested
on ppc
-yellowdog
-linux
(Yellow Dog Linux
3.0 3.2.2-2a
)
28 set testfile gdb1555
-main
30 set srcfile $
{testfile
}.c
31 set binfile $
{objdir
}/$
{subdir
}/$
{testfile
}
33 remote_exec build
"rm -f ${binfile}"
35 #
get the value of gcc_compiled
36 if [get_compiler_info $
{binfile
}] {
40 if { [gdb_compile
"${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug}] != "" } {
44 # Build the shared libraries this test case needs.
47 if {$gcc_compiled
== 0} {
48 if [istarget
"hppa*-hp-hpux*"] then {
49 set additional_flags
"additional_flags=+z"
50 } elseif
{ [istarget
"mips-sgi-irix*"] } {
51 # Disable SGI compiler
's implicit -Dsgi
52 set additional_flags "additional_flags=-Usgi"
54 # don't know what the compiler is...
55 set additional_flags
""
58 if { ([istarget
"powerpc*-*-aix*"]
59 ||
[istarget
"rs6000*-*-aix*"]) } {
60 set additional_flags
""
62 set additional_flags
"additional_flags=-fpic"
66 set additional_flags
"$additional_flags -shared"
67 if {[gdb_compile
"${srcdir}/${subdir}/${libfile}.c" "${objdir}/${subdir}/${libfile}.so" executable [list debug $additional_flags "incdir=${objdir}"]] != ""} {
72 && ([istarget
"powerpc*-*-aix*"]
73 ||
[istarget
"rs6000*-*-aix*"] )) } {
74 set additional_flags
"additional_flags=-L${objdir}/${subdir}"
75 } elseif
{ [istarget
"mips-sgi-irix*"] } {
76 set additional_flags
"additional_flags=-rpath ${objdir}/${subdir}"
78 set additional_flags
""
81 if {[gdb_compile
"${objdir}/${subdir}/${testfile}.o ${objdir}/${subdir}/${libfile}.so" "${binfile}" executable [list debug $additional_flags]] != ""} {
88 gdb_reinitialize_dir $srcdir
/$subdir
91 if ![runto_main
] then {
92 fail
"Can't run to main"
96 # PR
/1555 (was shlib
1280)
97 set name "Step into shared lib function"
98 gdb_test_multiple
"s" $name \
100 -re
"hithere2 \\(\\) at.*${libfile}.c:25\r\n25.*a = 21;.*$gdb_prompt $" {
103 -re
"0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" {
104 kfail
"gdb/1555" $name
108 # PR
/1555 (was shlib
1237)
109 set name "Next while in a shared lib function"
110 gdb_test_multiple
"n" $name \
112 -re
"26.*return a;.*$gdb_prompt $" {
115 -re
"Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\nProgram exited normally.*$gdb_prompt $" {
116 kfail
"gdb/1555" $name