]>
Commit | Line | Data |
---|---|---|
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 | ||
20 | load_lib gdbserver-support.exp | |
21 | ||
b0963d73 | 22 | standard_testfile server.c |
c74d0ad8 | 23 | |
cadfc59b | 24 | require allow_gdbserver_tests |
c74d0ad8 | 25 | |
5b362f04 | 26 | if {[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. | |
32 | gdb_test "disconnect" ".*" | |
33 | ||
b741e217 DJ |
34 | gdbserver_run "" |
35 | ||
f6978de9 | 36 | gdb_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 | ||
45 | gdb_test "monitor" "Unknown monitor command.*Protocol error.*" | |
46 | ||
8fd5a605 AB |
47 | gdb_test "monitor set debug 1" "General debug output enabled\\." |
48 | gdb_test "monitor set debug 0" "All debug output disabled\\." | |
49 | gdb_test "monitor set debug yeah" \ | |
50 | [multi_line \ | |
51 | "Missing value for 'set debug yeah' command\\." \ | |
52 | "The following monitor commands are supported:" \ | |
53 | ".*"] | |
54 | gdb_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 | ".*"] | |
59 | gdb_test "monitor set debug on" "General debug output enabled\\." | |
60 | gdb_test "monitor set debug off" "All debug output disabled\\." | |
61 | gdb_test "monitor set debug remote 1" "Debug output for 'remote' enabled\\." | |
62 | gdb_test "monitor set debug remote 0" "Debug output for 'remote' disabled\\." | |
63 | gdb_test "monitor set debug remote on" "Debug output for 'remote' enabled\\." | |
64 | gdb_test "monitor set debug remote off" "Debug output for 'remote' disabled\\." | |
65 | gdb_test "monitor set debug event-loop 1" "Debug output for 'event-loop' enabled\\." | |
66 | gdb_test "monitor set debug event-loop 0" "Debug output for 'event-loop' disabled\\." | |
67 | gdb_test "monitor set debug event-loop on" "Debug output for 'event-loop' enabled\\." | |
68 | gdb_test "monitor set debug event-loop off" "Debug output for 'event-loop' disabled\\." | |
69 | gdb_test "monitor set debug threads 1" "Debug output for 'threads' enabled\\." | |
70 | gdb_test "monitor set debug threads 0" "Debug output for 'threads' disabled\\." | |
71 | gdb_test "monitor set debug threads on" "Debug output for 'threads' enabled\\." | |
72 | gdb_test "monitor set debug threads off" "Debug output for 'threads' disabled\\." | |
73 | gdb_test "monitor set debug all 1" "Debug output for 'all' enabled\\." | |
74 | gdb_test "monitor set debug all 0" "Debug output for 'all' disabled\\." | |
75 | gdb_test "monitor set debug all on" "Debug output for 'all' enabled\\." | |
76 | gdb_test "monitor set debug all off" "Debug output for 'all' disabled\\." | |
77 | gdb_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 | ".*"] | |
82 | gdb_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 |
89 | gdb_test "monitor set debug-format all" \ |
90 | "All extra debug format options enabled\\." | |
91 | gdb_test "monitor set debug-format none" \ | |
92 | "All extra debug format options disabled\\." |