]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.mi/mi-pending.exp
Updated copyright notices for most files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-pending.exp
CommitLineData
9b254dd1 1# Copyright 2007, 2008 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
19if $tracelevel then {
20 strace $tracelevel
21}
22
23#
24# test running programs
25#
26set prms_id 0
27set bug_id 0
28
29if {[skip_shlib_tests]} {
30 return 0
31}
32
33set testfile "mi-pending"
34set libfile "mi-pendshr"
35set srcfile $testfile.c
36set libsrc $srcdir/$subdir/$libfile.c
37set binfile $objdir/$subdir/$testfile
38set lib_sl $objdir/$subdir/$libfile.sl
39
40set lib_opts debug
41set exec_opts [list debug shlib=$lib_sl]
42
43if [get_compiler_info ${binfile}] {
44 return -1
45}
46
47if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
48 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] != ""} {
49 untested "Could not compile either $libsrc or $srcdir/$subdir/$srcfile."
50 return -1
51}
52
53# Start with a fresh gdb.
54
55gdb_exit
56mi_gdb_start
57mi_gdb_reinitialize_dir $srcdir/$subdir
58mi_gdb_load ${binfile}
59gdb_load_shlibs $lib_sl
60
61if [target_info exists gdb_stub] {
62 gdb_step_for_stub;
63}
64
65# Set pending breakpoint via MI
66mi_gdb_test "-break-insert -f pendfunc1" \
67 ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\\(p\\)\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\"\}"\
68 "MI pending breakpoint on pendfunc1"
69
70mi_run_cmd
71
72# Make sure we hit breakpoint.
73mi_gdb_test "" \
74 ".*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\".*func=\"pendfunc1\".*" \
75 "Run till MI pending breakpoint on pendfunc1"