1 # Copyright 2013-2015 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 3 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, see <http://www.gnu.org/licenses/>.
17 if {[skip_shlib_tests]} {
22 set libfile "dprintf-pendshr"
23 set libsrc $srcdir/$subdir/$libfile.c
24 set lib_sl [standard_output_file $libfile.sl]
27 set exec_opts [list debug shlib=$lib_sl]
29 if { [get_compiler_info] } {
33 if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
34 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != ""} {
35 untested "Could not compile either $libsrc or $srcdir/$subdir/$srcfile."
39 with_test_prefix "without format" {
42 gdb_reinitialize_dir $srcdir/$subdir
46 "Dprintf.*pendfunc.*pending." \
47 "set pending dprintf" \
48 ".*Make dprintf pending.*y or \\\[n\\\]. $" \
51 gdb_test "file ${binfile}" ".*Error in re-setting breakpoint.*" "resolved dprintf fails to be re-set"
54 with_test_prefix "without symbols" {
57 gdb_reinitialize_dir $srcdir/$subdir
60 "dprintf pendfunc1, \"x=%d\\n\", x" \
61 "Dprintf.*pendfunc1.*pending." \
62 "set pending dprintf" \
63 ".*Make dprintf pending.*y or \\\[n\\\]. $" \
66 gdb_test "info break" \
67 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
68 \[0-9\]+\[\t \]+dprintf.*keep y.*PENDING.*pendfunc1.*" \
69 "single pending dprintf info"
72 gdb_load_shlibs $lib_sl
76 gdb_test "" ".*x=3.*x=4.*x=3.*" "run to resolved dprintf"
79 clean_restart ${binfile}
80 gdb_load_shlibs $lib_sl
83 # Test setting, querying, and modifying pending breakpoints
87 "dprintf pendfunc1, \"x=%d\\n\", x" \
88 "Dprintf.*pendfunc1.*pending." \
89 "set pending dprintf" \
90 ".*Make dprintf pending.*y or \\\[n\\\]. $" \
93 gdb_test "info break" \
94 "Num Type\[ \]+Disp Enb Address\[ \]+What.*
95 \[0-9\]+\[\t \]+dprintf.*keep y.*PENDING.*pendfunc1.*" \
96 "single pending dprintf info"
100 gdb_test "" ".*x=3.*x=4.*x=3.*" "run to resolved dprintf"