1 # Copyright 2012-2013 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/>.
16 load_lib mi-support.exp
19 standard_testfile basics.c
21 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
22 untested mi-cmd-param-changed.exp
26 proc test_command_param_changed { } {
27 with_test_prefix "cmd param" {
33 foreach opt { "on" "off" "step" } {
34 mi_gdb_test "set scheduler-locking ${opt}" \
35 ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
36 "\"set scheduler-locking ${opt}\""
38 foreach opt { "on" "off" "step" } {
39 mi_gdb_test "interpreter-exec console \"set scheduler-locking ${opt}\"" \
40 ".*=cmd-param-changed,param=\"scheduler-locking\",value=\"${opt}\".*\\^done" \
41 "interpreter-exec \"set scheduler-locking ${opt}\""
43 # Don't emit MI notification for request from MI.
44 mi_gdb_test "-gdb-set scheduler-locking on" \
46 "\"set scheduler-locking on\" no event (requested by MI)"
48 mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \
49 "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\r\n\\^done\r\n\\^done" \
50 "\"set scheduler-locking step\" no event (requested by MI interp)"
51 mi_gdb_test "set scheduler-locking step" \
52 "\\&\"set scheduler-locking step\\\\n\"\r\n\\^done" \
53 "\"set scheduler-locking stepr\" no event"
56 foreach command { "remotecache" "check type" } {
58 # The default value of each command option may be different, so we first
59 # set it to 'off', and this may or may not trigger MI notification.
60 mi_gdb_test "set ${command} off" ".*\\^done" "\"set ${command}\" warmup"
62 foreach boolean_opt { "on" "off" } {
63 mi_gdb_test "set ${command} ${boolean_opt}" \
64 ".*=cmd-param-changed,param=\"${command}\",value=\"${boolean_opt}\".*\\^done" \
65 "\"set ${command} ${boolean_opt}\""
67 mi_gdb_test "set ${command} off" \
68 "\\&\"set ${command} off\\\\n\"\r\n\\^done" \
69 "\"set ${command}\" no event"
73 foreach command { "trace-notes" "remote exec-file" } {
74 foreach str_opt { "foo" "bar" } {
75 mi_gdb_test "set ${command} ${str_opt}" \
76 ".*=cmd-param-changed,param=\"${command}\",value=\"${str_opt}\".*\\^done" \
77 "\"set ${command} ${str_opt}\""
79 mi_gdb_test "set ${command} bar" \
80 "\\&\"set ${command} bar\\\\n\"\r\n(\\&\"warning.*|)\\^done" \
81 "\"set ${command} bar\" no event"
84 # No notification is emitted for 'maint set' commands.
85 foreach boolean_opt { "on" "off" } {
86 mi_gdb_test "maint set profile ${boolean_opt}" \
87 "\\&\"maint set profile ${boolean_opt}\\\\n\"\r\n\\^done" \
88 "\"maint set profile ${boolean_opt}\""
91 # Full command parameters are included in the notification when a
92 # abbreviated one is typed.
93 mi_gdb_test "set ch type on" \
94 ".*=cmd-param-changed,param=\"check type\",value=\"on\".*\\^done" \
101 test_command_param_changed