]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp
Update years in copyright notice for the GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-cmd-param-changed.exp
1 # Copyright 2012-2013 Free Software Foundation, Inc.
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
16 load_lib mi-support.exp
17 set MIFLAGS "-i=mi"
18
19 standard_testfile basics.c
20
21 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
22 untested mi-cmd-param-changed.exp
23 return -1
24 }
25
26 proc test_command_param_changed { } { with_test_prefix "cmd param" {
27 if [mi_gdb_start] {
28 return
29 }
30 mi_run_to_main
31
32 foreach opt { "on" "off" "step" } {
33 mi_gdb_test "set scheduler-locking ${opt}" \
34 ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
35 "\"set scheduler-locking ${opt}\""
36 }
37 foreach opt { "on" "off" "step" } {
38 mi_gdb_test "interpreter-exec console \"set scheduler-locking ${opt}\"" \
39 ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
40 "interpreter-exec \"set scheduler-locking ${opt}\""
41 }
42 # Don't emit MI notification for request from MI.
43 mi_gdb_test "-gdb-set scheduler-locking on" \
44 {\^done} \
45 "\"set scheduler-locking on\" no event (requested by MI)"
46
47 mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \
48 "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\r\n\\^done\r\n\\^done" \
49 "\"set scheduler-locking step\" no event (requested by MI interp)"
50 mi_gdb_test "set scheduler-locking step" \
51 "\\&\"set scheduler-locking step\\\\n\"\r\n\\^done" \
52 "\"set scheduler-locking stepr\" no event"
53
54
55 foreach command { "remotecache" "check type" } {
56
57 # The default value of each command option may be different, so we first
58 # set it to 'off', and this may or may not trigger MI notification.
59 mi_gdb_test "set ${command} off" ".*\\^done" "\"set ${command}\" warmup"
60
61 foreach boolean_opt { "on" "off" } {
62 mi_gdb_test "set ${command} ${boolean_opt}" \
63 ".*=cmd-param-changed,param=\"${command}\",value=\"${boolean_opt}\".*\\^done" \
64 "\"set ${command} ${boolean_opt}\""
65 }
66 mi_gdb_test "set ${command} off" \
67 "\\&\"set ${command} off\\\\n\"\r\n\\^done" \
68 "\"set ${command}\" no event"
69 }
70
71
72 foreach command { "trace-notes" "remote exec-file" } {
73 foreach str_opt { "foo" "bar" } {
74 mi_gdb_test "set ${command} ${str_opt}" \
75 ".*=cmd-param-changed,param=\"${command}\",value=\"${str_opt}\".*\\^done" \
76 "\"set ${command} ${str_opt}\""
77 }
78 mi_gdb_test "set ${command} bar" \
79 "\\&\"set ${command} bar\\\\n\"\r\n(\\&\"warning.*|)\\^done" \
80 "\"set ${command} bar\" no event"
81 }
82
83 # No notification is emitted for 'maint set' commands.
84 foreach boolean_opt { "on" "off" } {
85 mi_gdb_test "maint set profile ${boolean_opt}" \
86 "\\&\"maint set profile ${boolean_opt}\\\\n\"\r\n\\^done" \
87 "\"maint set profile ${boolean_opt}\""
88 }
89
90 # Full command parameters are included in the notification when a
91 # abbreviated one is typed.
92 mi_gdb_test "set ch type on" \
93 ".*=cmd-param-changed,param=\"check type\",value=\"on\".*\\^done" \
94 "\"set ch type on\""
95
96 mi_gdb_exit
97 }}
98
99 test_command_param_changed
100
101 return 0