]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.server/server-mon.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.server / server-mon.exp
CommitLineData
c74d0ad8
DJ
1# This testcase is part of GDB, the GNU debugger.
2
1d506c26 3# Copyright 2007-2024 Free Software Foundation, Inc.
c74d0ad8
DJ
4
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
e22f8b7c 7# the Free Software Foundation; either version 3 of the License, or
c74d0ad8 8# (at your option) any later version.
e22f8b7c 9#
c74d0ad8
DJ
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
e22f8b7c 14#
c74d0ad8 15# You should have received a copy of the GNU General Public License
e22f8b7c 16# along with this program. If not, see <http://www.gnu.org/licenses/>.
c74d0ad8
DJ
17
18# Test gdbserver monitor commands.
19
20load_lib gdbserver-support.exp
21
b0963d73 22standard_testfile server.c
c74d0ad8 23
cadfc59b 24require allow_gdbserver_tests
c74d0ad8 25
5b362f04 26if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
c74d0ad8
DJ
27 return -1
28}
29
a1999d40
PA
30# Make sure we're disconnected, in case we're testing with an
31# extended-remote board, therefore already connected.
32gdb_test "disconnect" ".*"
33
b741e217
DJ
34gdbserver_run ""
35
f6978de9 36gdb_test_multiple "monitor help" "monitor help" {
c74d0ad8
DJ
37 -re "Unknown monitor command.*$gdb_prompt $" {
38 fail "monitor help"
39 }
40 -re "The following monitor commands.*$gdb_prompt $" {
41 pass "monitor help"
42 }
43}
44
45gdb_test "monitor" "Unknown monitor command.*Protocol error.*"
46
8fd5a605
AB
47gdb_test "monitor set debug 1" "General debug output enabled\\."
48gdb_test "monitor set debug 0" "All debug output disabled\\."
49gdb_test "monitor set debug yeah" \
50 [multi_line \
51 "Missing value for 'set debug yeah' command\\." \
52 "The following monitor commands are supported:" \
53 ".*"]
54gdb_test "monitor set debug on sometimes" \
55 [multi_line \
56 "Junk 'sometimes' found at end of 'set debug on' command\\." \
57 "The following monitor commands are supported:" \
58 ".*"]
59gdb_test "monitor set debug on" "General debug output enabled\\."
60gdb_test "monitor set debug off" "All debug output disabled\\."
61gdb_test "monitor set debug remote 1" "Debug output for 'remote' enabled\\."
62gdb_test "monitor set debug remote 0" "Debug output for 'remote' disabled\\."
63gdb_test "monitor set debug remote on" "Debug output for 'remote' enabled\\."
64gdb_test "monitor set debug remote off" "Debug output for 'remote' disabled\\."
65gdb_test "monitor set debug event-loop 1" "Debug output for 'event-loop' enabled\\."
66gdb_test "monitor set debug event-loop 0" "Debug output for 'event-loop' disabled\\."
67gdb_test "monitor set debug event-loop on" "Debug output for 'event-loop' enabled\\."
68gdb_test "monitor set debug event-loop off" "Debug output for 'event-loop' disabled\\."
69gdb_test "monitor set debug threads 1" "Debug output for 'threads' enabled\\."
70gdb_test "monitor set debug threads 0" "Debug output for 'threads' disabled\\."
71gdb_test "monitor set debug threads on" "Debug output for 'threads' enabled\\."
72gdb_test "monitor set debug threads off" "Debug output for 'threads' disabled\\."
73gdb_test "monitor set debug all 1" "Debug output for 'all' enabled\\."
74gdb_test "monitor set debug all 0" "Debug output for 'all' disabled\\."
75gdb_test "monitor set debug all on" "Debug output for 'all' enabled\\."
76gdb_test "monitor set debug all off" "Debug output for 'all' disabled\\."
77gdb_test "monitor set debug all yeah" \
78 [multi_line \
79 "Invalid value 'yeah' for 'set debug all'\\." \
80 "The following monitor commands are supported:" \
81 ".*"]
82gdb_test "monitor set debug all on sometimes" \
83 [multi_line \
84 "Junk 'sometimes' found at end of 'set debug all on' command\\." \
85 "The following monitor commands are supported:" \
86 ".*"]
87
88
87ce2a04
DE
89gdb_test "monitor set debug-format all" \
90 "All extra debug format options enabled\\."
91gdb_test "monitor set debug-format none" \
92 "All extra debug format options disabled\\."