]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/gdbcmd.h
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / gdbcmd.h
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.
6 fnasser@redhat.com */
7
8 /* Header file for GDB-specific command-line stuff.
9 Copyright (C) 1986-2023 Free Software Foundation, Inc.
10
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.
15
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.
20
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/>. */
23
24 #if !defined (GDBCMD_H)
25 #define GDBCMD_H 1
26
27 #include "command.h"
28 #include "ui-out.h"
29 #include "cli/cli-script.h"
30 #include "cli/cli-cmds.h"
31
32 extern void execute_command (const char *, int);
33
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. */
36
37 extern void execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn);
38
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
43 (e.g. no styling). */
44
45 extern void execute_fn_to_string (std::string &res,
46 std::function<void(void)> fn, bool term_out);
47
48 /* As execute_fn_to_ui_file, but run execute_command for P and FROM_TTY. */
49
50 extern void execute_command_to_ui_file (struct ui_file *file,
51 const char *p, int from_tty);
52
53 /* As execute_fn_to_string, but run execute_command for P and FROM_TTY. */
54
55 extern void execute_command_to_string (std::string &res, const char *p,
56 int from_tty, bool term_out);
57
58 /* As execute_command_to_string, but ignore resulting string. */
59
60 extern void execute_command_to_string (const char *p,
61 int from_tty, bool term_out);
62
63 extern void print_command_line (struct command_line *, unsigned int,
64 struct ui_file *);
65 extern void print_command_lines (struct ui_out *,
66 struct command_line *, unsigned int);
67
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;
71
72 #endif /* !defined (GDBCMD_H) */