]>
Commit | Line | Data |
---|---|---|
d318976c | 1 | /* Header file for GDB CLI command implementation library. |
1d506c26 | 2 | Copyright (C) 2000-2024 Free Software Foundation, Inc. |
d318976c FN |
3 | |
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 6 | the Free Software Foundation; either version 3 of the License, or |
d318976c FN |
7 | (at your option) any later version. |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
d318976c | 16 | |
1a5c2598 TT |
17 | #ifndef CLI_CLI_CMDS_H |
18 | #define CLI_CLI_CMDS_H | |
d318976c | 19 | |
268a13a5 | 20 | #include "gdbsupport/filestuff.h" |
6b09f134 | 21 | #include <optional> |
0d12e84c | 22 | #include "completer.h" |
ed166945 | 23 | |
d318976c FN |
24 | /* Chain containing all defined commands. */ |
25 | ||
26 | extern struct cmd_list_element *cmdlist; | |
27 | ||
28 | /* Chain containing all defined info subcommands. */ | |
29 | ||
30 | extern struct cmd_list_element *infolist; | |
31 | ||
ebcd3b23 | 32 | /* Chain containing all defined enable subcommands. */ |
d318976c FN |
33 | |
34 | extern struct cmd_list_element *enablelist; | |
35 | ||
ebcd3b23 | 36 | /* Chain containing all defined disable subcommands. */ |
d318976c FN |
37 | |
38 | extern struct cmd_list_element *disablelist; | |
39 | ||
ebcd3b23 | 40 | /* Chain containing all defined delete subcommands. */ |
d318976c FN |
41 | |
42 | extern struct cmd_list_element *deletelist; | |
43 | ||
ebcd3b23 | 44 | /* Chain containing all defined detach subcommands. */ |
f73adfeb AS |
45 | |
46 | extern struct cmd_list_element *detachlist; | |
47 | ||
2277426b PA |
48 | /* Chain containing all defined kill subcommands. */ |
49 | ||
50 | extern struct cmd_list_element *killlist; | |
51 | ||
ebcd3b23 | 52 | /* Chain containing all defined stop subcommands. */ |
d318976c FN |
53 | |
54 | extern struct cmd_list_element *stoplist; | |
55 | ||
d318976c FN |
56 | /* Chain containing all defined set subcommands */ |
57 | ||
58 | extern struct cmd_list_element *setlist; | |
59 | ||
60 | /* Chain containing all defined unset subcommands */ | |
61 | ||
62 | extern struct cmd_list_element *unsetlist; | |
63 | ||
64 | /* Chain containing all defined show subcommands. */ | |
65 | ||
66 | extern struct cmd_list_element *showlist; | |
67 | ||
68 | /* Chain containing all defined \"set history\". */ | |
69 | ||
70 | extern struct cmd_list_element *sethistlist; | |
71 | ||
72 | /* Chain containing all defined \"show history\". */ | |
73 | ||
74 | extern struct cmd_list_element *showhistlist; | |
75 | ||
76 | /* Chain containing all defined \"unset history\". */ | |
77 | ||
78 | extern struct cmd_list_element *unsethistlist; | |
79 | ||
ebcd3b23 | 80 | /* Chain containing all defined maintenance subcommands. */ |
d318976c FN |
81 | |
82 | extern struct cmd_list_element *maintenancelist; | |
83 | ||
ebcd3b23 | 84 | /* Chain containing all defined "maintenance info" subcommands. */ |
d318976c FN |
85 | |
86 | extern struct cmd_list_element *maintenanceinfolist; | |
87 | ||
ebcd3b23 | 88 | /* Chain containing all defined "maintenance print" subcommands. */ |
d318976c FN |
89 | |
90 | extern struct cmd_list_element *maintenanceprintlist; | |
91 | ||
50a5f187 AB |
92 | /* Chain containing all defined "maintenance flush" subcommands. */ |
93 | ||
94 | extern struct cmd_list_element *maintenanceflushlist; | |
95 | ||
5cf3b309 AB |
96 | /* Chain containing all defined "maintenance check" subcommands. */ |
97 | ||
98 | extern struct cmd_list_element *maintenancechecklist; | |
99 | ||
100 | /* Chain containing all defined "maintenance set" subcommands. */ | |
101 | ||
102 | extern struct cmd_list_element *maintenance_set_cmdlist; | |
103 | ||
104 | /* Chain containing all defined "maintenance show" subcommands. */ | |
105 | ||
106 | extern struct cmd_list_element *maintenance_show_cmdlist; | |
107 | ||
d318976c FN |
108 | extern struct cmd_list_element *setprintlist; |
109 | ||
110 | extern struct cmd_list_element *showprintlist; | |
111 | ||
5cf3b309 AB |
112 | /* Chain containing all defined "set print raw" subcommands. */ |
113 | ||
114 | extern struct cmd_list_element *setprintrawlist; | |
115 | ||
116 | /* Chain containing all defined "show print raw" subcommands. */ | |
117 | ||
118 | extern struct cmd_list_element *showprintrawlist; | |
119 | ||
120 | /* Chain containing all defined "set print type" subcommands. */ | |
121 | ||
122 | extern struct cmd_list_element *setprinttypelist; | |
123 | ||
124 | /* Chain containing all defined "show print type" subcommands. */ | |
125 | ||
126 | extern struct cmd_list_element *showprinttypelist; | |
127 | ||
d318976c FN |
128 | extern struct cmd_list_element *setdebuglist; |
129 | ||
130 | extern struct cmd_list_element *showdebuglist; | |
131 | ||
132 | extern struct cmd_list_element *setchecklist; | |
133 | ||
134 | extern struct cmd_list_element *showchecklist; | |
135 | ||
5cf3b309 AB |
136 | /* Chain containing all defined "save" subcommands. */ |
137 | ||
138 | extern struct cmd_list_element *save_cmdlist; | |
139 | ||
fde1a9a3 AB |
140 | /* Chain containing all defined "set source" subcommands. */ |
141 | ||
142 | extern struct cmd_list_element *setsourcelist; | |
143 | ||
144 | /* Chain containing all defined "show source" subcommands. */ | |
145 | ||
146 | extern struct cmd_list_element *showsourcelist; | |
147 | ||
cc8dee1f CB |
148 | /* Limit the call depth of user-defined commands */ |
149 | ||
150 | extern unsigned int max_user_call_depth; | |
151 | ||
d318976c FN |
152 | /* Exported to gdb/top.c */ |
153 | ||
bbaca940 | 154 | int is_complete_command (struct cmd_list_element *cmd); |
d318976c FN |
155 | |
156 | /* Exported to gdb/main.c */ | |
157 | ||
5e93d4c6 | 158 | extern void cd_command (const char *, int); |
d318976c FN |
159 | |
160 | /* Exported to gdb/top.c and gdb/main.c */ | |
161 | ||
0b39b52e | 162 | extern void quit_command (const char *, int); |
d318976c | 163 | |
50dd9793 | 164 | extern void source_script (const char *, int); |
d318976c | 165 | |
8a1ea21f DE |
166 | /* Exported to objfiles.c. */ |
167 | ||
ed166945 TT |
168 | /* The script that was opened. */ |
169 | struct open_script | |
170 | { | |
171 | gdb_file_up stream; | |
172 | gdb::unique_xmalloc_ptr<char> full_path; | |
173 | ||
174 | open_script (gdb_file_up &&stream_, | |
175 | gdb::unique_xmalloc_ptr<char> &&full_path_) | |
176 | : stream (std::move (stream_)), | |
177 | full_path (std::move (full_path_)) | |
178 | { | |
179 | } | |
180 | }; | |
181 | ||
6b09f134 | 182 | extern std::optional<open_script> |
ed166945 | 183 | find_and_open_script (const char *file, int search_path); |
8a1ea21f | 184 | |
16026cd7 AS |
185 | /* Command tracing state. */ |
186 | ||
187 | extern int source_verbose; | |
491144b5 | 188 | extern bool trace_commands; |
16026cd7 | 189 | |
fdbc9870 PA |
190 | /* Common code for the "with" and "maintenance with" commands. |
191 | SET_CMD_PREFIX is the spelling of the corresponding "set" command | |
192 | prefix: i.e., "set " or "maintenance set ". SETLIST is the command | |
193 | element for the same "set" command prefix. */ | |
194 | extern void with_command_1 (const char *set_cmd_prefix, | |
195 | cmd_list_element *setlist, | |
196 | const char *args, int from_tty); | |
197 | ||
198 | /* Common code for the completers of the "with" and "maintenance with" | |
199 | commands. SET_CMD_PREFIX is the spelling of the corresponding | |
200 | "set" command prefix: i.e., "set " or "maintenance set ". */ | |
201 | extern void with_command_completer_1 (const char *set_cmd_prefix, | |
202 | completion_tracker &tracker, | |
203 | const char *text); | |
204 | ||
1a5c2598 | 205 | #endif /* CLI_CLI_CMDS_H */ |