Commit | Line | Data |
---|---|---|
0fb0cc75 | 1 | # Copyright (C) 2008, 2009 Free Software Foundation, Inc. |
907fc202 UW |
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 | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
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. | |
12 | # | |
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/>. | |
15 | ||
16 | if $tracelevel then { | |
17 | strace $tracelevel | |
18 | } | |
19 | ||
20 | set prms_id 0 | |
21 | set bug_id 0 | |
22 | ||
23 | if {[skip_shlib_tests]} { | |
24 | return 0 | |
25 | } | |
26 | ||
27 | set testfile "fixsection" | |
28 | set srcfile ${srcdir}/${subdir}/${testfile}.c | |
29 | set binfile ${objdir}/${subdir}/${testfile} | |
30 | ||
31 | set libfile "fixsectshr" | |
32 | set libsrc ${srcdir}/${subdir}/${libfile}.c | |
33 | set lib_sl ${objdir}/${subdir}/${libfile}.sl | |
34 | ||
35 | set lib_opts [list debug nowarnings] | |
36 | set exec_opts [list debug nowarnings shlib=$lib_sl] | |
37 | ||
38 | if [get_compiler_info ${binfile}] { | |
39 | return -1 | |
40 | } | |
41 | ||
42 | if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" | |
43 | || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} { | |
44 | untested "Could not compile either $libsrc or $srcfile." | |
45 | return -1 | |
46 | } | |
47 | ||
48 | # Start with a fresh gdb. | |
49 | ||
50 | gdb_exit | |
51 | gdb_start | |
52 | gdb_reinitialize_dir $srcdir/$subdir | |
53 | gdb_load ${binfile} | |
54 | gdb_load_shlibs ${lib_sl} | |
55 | ||
56 | if ![runto_main] then { | |
57 | fail "Can't run to main" | |
58 | return 1; | |
59 | } | |
60 | ||
61 | # | |
62 | # set breakpoint at static function static_fun | |
63 | # | |
64 | gdb_test "break static_fun" \ | |
65 | "Breakpoint.*at.* file .*${srcfile}, line.*" \ | |
66 | "breakpoint at static_fun" | |
67 | ||
68 | # | |
69 | # exit gdb | |
70 | # | |
71 | gdb_exit |