Rename dwarf2 to dwarf in "set debug" and maintenance commands.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-cmd-param-changed.exp
CommitLineData
32d0add0 1# Copyright 2012-2015 Free Software Foundation, Inc.
5b9afe8a
YQ
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
19standard_testfile basics.c
20
21if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
22 untested mi-cmd-param-changed.exp
23 return -1
24}
25
0a251e08
YQ
26proc test_command_param_changed { } {
27 with_test_prefix "cmd param" {
28 if [mi_gdb_start] {
29 return
30 }
31 mi_run_to_main
5b9afe8a 32
0a251e08
YQ
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}\""
37 }
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}\""
42 }
43 # Don't emit MI notification for request from MI.
44 mi_gdb_test "-gdb-set scheduler-locking on" \
45 {\^done} \
46 "\"set scheduler-locking on\" no event (requested by MI)"
62a813cc
YQ
47 mi_gdb_test "-exec-arguments foo" {\^done} \
48 "\"-exec-arguments foo\" no event"
0a251e08
YQ
49
50 mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \
51 "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\r\n\\^done\r\n\\^done" \
52 "\"set scheduler-locking step\" no event (requested by MI interp)"
53 mi_gdb_test "set scheduler-locking step" \
54 "\\&\"set scheduler-locking step\\\\n\"\r\n\\^done" \
55 "\"set scheduler-locking stepr\" no event"
56
57
58 foreach command { "remotecache" "check type" } {
59
60 # The default value of each command option may be different, so we first
61 # set it to 'off', and this may or may not trigger MI notification.
62 mi_gdb_test "set ${command} off" ".*\\^done" "\"set ${command}\" warmup"
63
64 foreach boolean_opt { "on" "off" } {
65 mi_gdb_test "set ${command} ${boolean_opt}" \
66 ".*=cmd-param-changed,param=\"${command}\",value=\"${boolean_opt}\".*\\^done" \
67 "\"set ${command} ${boolean_opt}\""
68 }
69 mi_gdb_test "set ${command} off" \
70 "\\&\"set ${command} off\\\\n\"\r\n\\^done" \
71 "\"set ${command}\" no event"
72 }
5b9afe8a 73
5b9afe8a 74
0a251e08
YQ
75 foreach command { "trace-notes" "remote exec-file" } {
76 foreach str_opt { "foo" "bar" } {
77 mi_gdb_test "set ${command} ${str_opt}" \
78 ".*=cmd-param-changed,param=\"${command}\",value=\"${str_opt}\".*\\^done" \
79 "\"set ${command} ${str_opt}\""
80 }
81 mi_gdb_test "set ${command} bar" \
82 "\\&\"set ${command} bar\\\\n\"\r\n(\\&\"warning.*|)\\^done" \
83 "\"set ${command} bar\" no event"
84 }
5b9afe8a 85
0a251e08 86 # No notification is emitted for 'maint set' commands.
5b9afe8a 87 foreach boolean_opt { "on" "off" } {
b4f54984
DE
88 mi_gdb_test "maint set dwarf always-disassemble ${boolean_opt}" \
89 "\\&\"maint set dwarf always-disassemble ${boolean_opt}\\\\n\"\r\n\\^done" \
90 "\"maint dwarf always-disassemble ${boolean_opt}\""
5b9afe8a 91 }
5b9afe8a 92
0a251e08
YQ
93 # Full command parameters are included in the notification when a
94 # abbreviated one is typed.
95 mi_gdb_test "set ch type on" \
96 ".*=cmd-param-changed,param=\"check type\",value=\"on\".*\\^done" \
97 "\"set ch type on\""
5b9afe8a 98
0a251e08 99 mi_gdb_exit
5b9afe8a 100 }
0a251e08 101}
5b9afe8a
YQ
102
103test_command_param_changed
104
105return 0
This page took 0.438247 seconds and 4 git commands to generate.