1 /* ***DEPRECATED*** The gdblib files must not be calling/using things in any
2 of the possible command languages. If necessary, a hook (that may be
3 present or not) must be used and set to the appropriate routine by any
4 command language that cares about it. If you are having to include this
5 file you are possibly doing things the old way. This file will dissapear.
8 /* Header file for GDB-specific command-line stuff.
9 Copyright (C) 1986-2022 Free Software Foundation, Inc.
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>. */
24 #if !defined (GDBCMD_H)
29 #include "cli/cli-script.h"
30 #include "cli/cli-cmds.h"
32 extern void execute_command (const char *, int);
34 /* Run FN. Sends its output to FILE, do not display it to the screen.
35 The global BATCH_FLAG will be temporarily set to true. */
37 extern void execute_fn_to_ui_file (struct ui_file
*file
, std::function
<void(void)> fn
);
39 /* Run FN. Capture its output into the returned string, do not display it
40 to the screen. The global BATCH_FLAG will temporarily be set to true.
41 When TERM_OUT is true the output is collected with terminal behaviour
42 (e.g. with styling). When TERM_OUT is false raw output will be collected
45 extern void execute_fn_to_string (std::string
&res
,
46 std::function
<void(void)> fn
, bool term_out
);
48 /* As execute_fn_to_ui_file, but run execute_command for P and FROM_TTY. */
50 extern void execute_command_to_ui_file (struct ui_file
*file
,
51 const char *p
, int from_tty
);
53 /* As execute_fn_to_string, but run execute_command for P and FROM_TTY. */
55 extern void execute_command_to_string (std::string
&res
, const char *p
,
56 int from_tty
, bool term_out
);
58 /* As execute_command_to_string, but ignore resulting string. */
60 extern void execute_command_to_string (const char *p
,
61 int from_tty
, bool term_out
);
63 extern void print_command_line (struct command_line
*, unsigned int,
65 extern void print_command_lines (struct ui_out
*,
66 struct command_line
*, unsigned int);
68 /* Chains containing all defined "set/show style" subcommands. */
69 extern struct cmd_list_element
*style_set_list
;
70 extern struct cmd_list_element
*style_show_list
;
72 #endif /* !defined (GDBCMD_H) */