OLD | NEW |
1 # Copyright 2007, 2009-2012 Free Software Foundation, Inc. | 1 # Copyright 2007-2013 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # | 16 # |
17 # test running programs | 17 # test running programs |
18 # | 18 # |
19 | 19 |
20 if {[skip_shlib_tests]} { | 20 if {[skip_shlib_tests]} { |
21 return 0 | 21 return 0 |
22 } | 22 } |
23 | 23 |
24 set testfile "watchpoint-solib" | 24 set testfile "watchpoint-solib" |
25 set libfile "watchpoint-solib-shr" | 25 set libfile "watchpoint-solib-shr" |
26 set libname "${libfile}.sl" | 26 set libname "${libfile}.sl" |
27 set libsrcfile ${libfile}.c | 27 set libsrcfile ${libfile}.c |
28 set srcfile $srcdir/$subdir/$testfile.c | 28 set srcfile $srcdir/$subdir/$testfile.c |
29 set binfile $objdir/$subdir/$testfile | 29 set binfile [standard_output_file $testfile] |
30 set shlibdir ${objdir}/${subdir} | 30 set shlibdir [standard_output_file {}] |
31 set libsrc $srcdir/$subdir/$libfile.c | 31 set libsrc $srcdir/$subdir/$libfile.c |
32 set lib_sl $objdir/$subdir/$libname | 32 set lib_sl [standard_output_file $libname] |
33 set lib_dlopen [shlib_target_file ${libname}] | 33 set lib_dlopen [shlib_target_file ${libname}] |
34 set lib_syms [shlib_symbol_file ${libname}] | 34 set lib_syms [shlib_symbol_file ${libname}] |
35 | 35 |
36 if [get_compiler_info] { | 36 if [get_compiler_info] { |
37 return -1 | 37 return -1 |
38 } | 38 } |
39 | 39 |
40 set lib_opts debug | 40 set lib_opts debug |
41 set exec_opts [list debug shlib_load additional_flags=-DSHLIB_NAME\=\"${lib_dlop
en}\"] | 41 set exec_opts [list debug shlib_load additional_flags=-DSHLIB_NAME=\"${lib_dlope
n}\"] |
42 | 42 |
43 if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" | 43 if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" |
44 || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} { | 44 || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} { |
45 untested "Couldn't compile $libsrc or $srcfile." | 45 untested "Couldn't compile $libsrc or $srcfile." |
46 return -1 | 46 return -1 |
47 } | 47 } |
48 | 48 |
49 # Start with a fresh gdb. | 49 # Start with a fresh gdb. |
50 | 50 |
51 gdb_exit | 51 gdb_exit |
(...skipping 22 matching lines...) Expand all Loading... |
74 set timeout 120 | 74 set timeout 120 |
75 | 75 |
76 gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo" | 76 gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo" |
77 gdb_test "watch g" "atchpoint 3: g" "set watchpoint on g" | 77 gdb_test "watch g" "atchpoint 3: g" "set watchpoint on g" |
78 gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit" | 78 gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit" |
79 rerun_to_main | 79 rerun_to_main |
80 gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again" | 80 gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again" |
81 gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again" | 81 gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again" |
82 | 82 |
83 set timeout $prev_timeout | 83 set timeout $prev_timeout |
OLD | NEW |