]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.mi/mi-pending.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-pending.exp
CommitLineData
8acc9f48 1# Copyright 2007-2013 Free Software Foundation, Inc.
afe8ab22
VP
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
16load_lib mi-support.exp
17set MIFLAGS "-i=mi"
18
afe8ab22
VP
19#
20# test running programs
21#
afe8ab22
VP
22
23if {[skip_shlib_tests]} {
24 return 0
25}
26
298a9cf0
TT
27standard_testfile mi-pending.c mi-pendshr.c
28set lib_sl [standard_output_file mi-pendshr.sl]
afe8ab22
VP
29
30set lib_opts debug
31set exec_opts [list debug shlib=$lib_sl]
32
4c93b1db 33if [get_compiler_info] {
afe8ab22
VP
34 return -1
35}
36
298a9cf0 37if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $lib_sl $lib_opts] != ""
afe8ab22
VP
38 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != ""} {
39 untested "Could not compile either $libsrc or $srcdir/$subdir/$srcfile."
40 return -1
41}
42
43# Start with a fresh gdb.
44
45gdb_exit
46mi_gdb_start
47mi_gdb_reinitialize_dir $srcdir/$subdir
48mi_gdb_load ${binfile}
5e06a3d1 49mi_load_shlibs $lib_sl
afe8ab22 50
ea5ca7b5 51# Set pending breakpoint via MI.
afe8ab22 52mi_gdb_test "-break-insert -f pendfunc1" \
d24317b4 53 ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"\}"\
afe8ab22
VP
54 "MI pending breakpoint on pendfunc1"
55
ea5ca7b5
MK
56# Set pending breakpoint with a condition via MI.
57mi_gdb_test "-break-insert -f -c x==4 ${srcfile2}:pendfunc2" \
58 ".*\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"${srcfile2}:pendfunc2\",cond=\"x==4\",times=\"0\",original-location=\"${srcfile2}:pendfunc2\"\}"\
59 "MI pending breakpoint on ${srcfile2}:pendfunc2 if x==4"
60
afe8ab22 61mi_run_cmd
18ac113b
AR
62mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \
63 { "" "disp=\"keep\"" } \
64 "Run till MI pending breakpoint on pendfunc1"
ea5ca7b5
MK
65
66mi_send_resuming_command "exec-continue" "continuing execution to skip conditional bp"
67# We should not stop on the conditional breakpoint yet, but we stop on the original bp.
68mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \
69 { "" "disp=\"keep\"" } \
70 "Run till MI pending breakpoint on pendfunc1 a second time"
71
72mi_send_resuming_command "exec-continue" "continuing execution to conditional bp"
73# Now we should stop on the conditional breakpoint.
74mi_expect_stop "breakpoint-hit" "pendfunc2" "\{name=\"x\",value=\"4\"\}" ".*" ".*" \
75 { "" "disp=\"keep\"" } \
76 "Run till MI pending breakpoint on pendfunc2 with x==4"