]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.mi/mi-until.exp
Update Copyright year range in all files maintained by GDB.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-until.exp
CommitLineData
ecd75fc8 1# Copyright 1999-2014 Free Software Foundation, Inc.
fb40c209
AC
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
e22f8b7c 5# the Free Software Foundation; either version 3 of the License, or
fb40c209 6# (at your option) any later version.
e22f8b7c 7#
fb40c209
AC
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.
e22f8b7c 12#
fb40c209 13# You should have received a copy of the GNU General Public License
e22f8b7c 14# along with this program. If not, see <http://www.gnu.org/licenses/>.
fb40c209 15
17282693
PA
16# Test Machine interface (MI) operations
17#
fb40c209 18# Verify that, using the MI, we can run a simple program and perform
17282693 19# exec-until.
fb40c209 20#
17282693
PA
21# The goal is not to test gdb functionality, which is done by other
22# tests, but to verify the correct output response to MI operations.
fb40c209
AC
23
24load_lib mi-support.exp
b30bf9ee 25set MIFLAGS "-i=mi"
fb40c209
AC
26
27gdb_exit
28if [mi_gdb_start] {
29 continue
30}
31
298a9cf0
TT
32standard_testfile until.c
33
9357e021 34if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
b60f0898
JB
35 untested mi-until.exp
36 return -1
fb40c209
AC
37}
38
39mi_delete_breakpoints
40mi_gdb_reinitialize_dir $srcdir/$subdir
41mi_gdb_reinitialize_dir $srcdir/$subdir
42mi_gdb_load ${binfile}
43
44proc test_running_to_foo {} {
45 global mi_gdb_prompt
46 global hex
47
d24317b4 48 mi_create_breakpoint "10" 1 "keep" foo ".*until.c" 10 ".*" \
fb40c209
AC
49 "break-insert operation"
50
51 mi_run_cmd
18ac113b
AR
52 mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 \
53 { "" "disp=\"keep\"" } "run to main"
fb40c209
AC
54
55 mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1"
56
57}
58
59proc test_until {} {
60 global mi_gdb_prompt
76ff342d 61 global hex fullname_syntax srcfile
fb40c209 62
bb378428
VP
63 setup_kfail gdb/2104 "*-*-*"
64 mi_execute_to "exec-until" "end-stepping-range" "foo" "" ".*until.c" "12" "" \
65 "until after while loop"
fb40c209 66
bb378428
VP
67 mi_execute_to "exec-until 15" "location-reached" "foo" "" ".*until.c" "15" ""\
68 "until line number"
fb40c209 69
bb378428
VP
70 mi_execute_to "exec-until until.c:17" "location-reached" "foo" "" ".*until.c" "17" ""\
71 "until line number:file"
fb40c209 72
bb378428
VP
73 # This is supposed to NOT stop at line 25. It stops right after foo is over.
74 mi_execute_to "exec-until until.c:25" "location-reached" "main" "" ".*until.c" "(23|24)" ""\
75 "until after current function"
fb40c209
AC
76}
77
78test_running_to_foo
79test_until
80
81mi_gdb_exit
82return 0