]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2004-2024 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 | 15 | |
f3205b34 AF |
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) | |
19 | ||
d6195dc9 | 20 | require allow_shlib_tests |
93f02886 | 21 | |
289f9037 | 22 | standard_testfile gdb1555-main.c gdb1555.c |
f3205b34 | 23 | |
289f9037 | 24 | set libfile gdb1555 |
9af2e58d | 25 | set libsrc "${srcdir}/${subdir}/${libfile}.c" |
289f9037 | 26 | set libobj [standard_output_file ${libfile}.so] |
9af2e58d | 27 | set execsrc "${srcdir}/${subdir}/${srcfile}" |
f3205b34 | 28 | |
9af2e58d | 29 | remote_exec build "rm -f ${binfile}" |
f3205b34 | 30 | |
9af2e58d DJ |
31 | if { [gdb_compile_shlib $libsrc $libobj {debug}] != "" |
32 | || [gdb_compile $execsrc ${binfile} executable \ | |
33 | [list debug shlib=${libobj}]] != "" } { | |
f3205b34 AF |
34 | return -1 |
35 | } | |
36 | ||
289f9037 | 37 | clean_restart ${binfile} |
d9019901 | 38 | gdb_load_shlib $libobj |
f3205b34 | 39 | |
65a33d75 | 40 | if {![runto_main]} { |
f3205b34 AF |
41 | return 0 |
42 | } | |
43 | ||
44 | # PR/1555 (was shlib 1280) | |
45 | set name "Step into shared lib function" | |
46 | gdb_test_multiple "s" $name \ | |
47 | { | |
b9c34f67 | 48 | -re "hithere2 \\(\\) at.*${libfile}.c:\[0-9\]+\r\n\[0-9\]+.*a = 21;.*$gdb_prompt $" { |
f3205b34 AF |
49 | pass $name |
50 | } | |
51 | -re "0x\[0-9a-f\]+ in .* \\(\\) from /lib/ld.so.1.*$gdb_prompt $" { | |
52 | kfail "gdb/1555" $name | |
53 | } | |
54 | } | |
55 | ||
56 | # PR/1555 (was shlib 1237) | |
57 | set name "Next while in a shared lib function" | |
58 | gdb_test_multiple "n" $name \ | |
59 | { | |
b9c34f67 | 60 | -re "\[0-9\]+.*return a;.*$gdb_prompt $" { |
f3205b34 AF |
61 | pass $name |
62 | } | |
fda326dd | 63 | -re "Single stepping until exit from function .*, \r\nwhich has no line number information.\r\n\r\n$inferior_exited_re normally.*$gdb_prompt $" { |
f3205b34 AF |
64 | kfail "gdb/1555" $name |
65 | } | |
66 | } | |
67 |