GDB (xrefs)

mi-common.h
Go to the documentation of this file.
1 /* Interface for common GDB/MI data
2 Copyright (C) 2005-2018 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19 #ifndef MI_COMMON_H
20 #define MI_COMMON_H
21
22 #include "interps.h"
23
24 struct mi_console_file;
25
26 /* Represents the reason why GDB is sending an asynchronous command to
27 the front end. NOTE: When modifing this, don't forget to update
28 gdb.texinfo! */
29 enum async_reply_reason
30 {
31 EXEC_ASYNC_BREAKPOINT_HIT = 0,
32 EXEC_ASYNC_WATCHPOINT_TRIGGER,
33 EXEC_ASYNC_READ_WATCHPOINT_TRIGGER,
34 EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER,
35 EXEC_ASYNC_FUNCTION_FINISHED,
36 EXEC_ASYNC_LOCATION_REACHED,
37 EXEC_ASYNC_WATCHPOINT_SCOPE,
38 EXEC_ASYNC_END_STEPPING_RANGE,
39 EXEC_ASYNC_EXITED_SIGNALLED,
40 EXEC_ASYNC_EXITED,
41 EXEC_ASYNC_EXITED_NORMALLY,
42 EXEC_ASYNC_SIGNAL_RECEIVED,
43 EXEC_ASYNC_SOLIB_EVENT,
44 EXEC_ASYNC_FORK,
45 EXEC_ASYNC_VFORK,
46 EXEC_ASYNC_SYSCALL_ENTRY,
47 EXEC_ASYNC_SYSCALL_RETURN,
48 EXEC_ASYNC_EXEC,
49 /* This is here only to represent the number of enums. */
50 EXEC_ASYNC_LAST
51 };
52
53 const char *async_reason_lookup (enum async_reply_reason reason);
54
55 /* An MI interpreter. */
56
57 class mi_interp final : public interp
58 {
59 public:
60 mi_interp (const char *name)
61 : interp (name)
62 {}
63
64 void init (bool top_level) override;
65 void resume () override;
66 void suspend () override;
67 gdb_exception exec (const char *command_str) override;
68 ui_out *interp_ui_out () override;
69 void set_logging (ui_file_up logfile, bool logging_redirect) override;
70 void pre_command_loop () override;
71
72 /* MI's output channels */
73 mi_console_file *out;
74 mi_console_file *err;
75 mi_console_file *log;
76 mi_console_file *targ;
77 mi_console_file *event_channel;
78
79 /* Raw console output. */
80 struct ui_file *raw_stdout;
81
82 /* Save the original value of raw_stdout here when logging, so we
83 can restore correctly when done. */
84 struct ui_file *saved_raw_stdout;
85
86 /* MI's builder. */
87 struct ui_out *mi_uiout;
88
89 /* MI's CLI builder (wraps OUT). */
90 struct ui_out *cli_uiout;
91 };
92
93 #endif
EXEC_ASYNC_VFORK
Definition: mi-common.h:45
EXEC_ASYNC_FORK
Definition: mi-common.h:44
EXEC_ASYNC_SYSCALL_RETURN
Definition: mi-common.h:47
ui_file_up
std::unique_ptr< ui_file > ui_file_up
Definition: ui-file.h:76
mi_interp::mi_interp
mi_interp(const char *name)
Definition: mi-common.h:60
mi_console_file
Definition: mi-console.h:26
EXEC_ASYNC_LOCATION_REACHED
Definition: mi-common.h:36
interp
Definition: interps.h:41
mi_interp::set_logging
void set_logging(ui_file_up logfile, bool logging_redirect) override
Definition: mi-interp.c:1313
EXEC_ASYNC_LAST
Definition: mi-common.h:50
ui_file
Definition: ui-file.h:26
mi_interp::err
mi_console_file * err
Definition: mi-common.h:74
mi_interp::interp_ui_out
ui_out * interp_ui_out() override
Definition: mi-interp.c:1304
mi_interp::raw_stdout
struct ui_file * raw_stdout
Definition: mi-common.h:80
EXEC_ASYNC_SYSCALL_ENTRY
Definition: mi-common.h:46
EXEC_ASYNC_SOLIB_EVENT
Definition: mi-common.h:43
EXEC_ASYNC_FUNCTION_FINISHED
Definition: mi-common.h:35
logging_redirect
static int logging_redirect
Definition: cli-logging.c:64
mi_interp::exec
gdb_exception exec(const char *command_str) override
Definition: mi-interp.c:197
EXEC_ASYNC_WATCHPOINT_SCOPE
Definition: mi-common.h:37
mi_interp::cli_uiout
struct ui_out * cli_uiout
Definition: mi-common.h:90
EXEC_ASYNC_WATCHPOINT_TRIGGER
Definition: mi-common.h:32
mi_interp
Definition: mi-common.h:57
EXEC_ASYNC_BREAKPOINT_HIT
Definition: mi-common.h:31
interp::name
const char * name
Definition: interps.h:78
interps.h
async_reply_reason
async_reply_reason
Definition: mi-common.h:29
mi_interp::init
void init(bool top_level) override
Definition: mi-interp.c:115
ui_out
Definition: ui-out.h:77
mi_interp::mi_uiout
struct ui_out * mi_uiout
Definition: mi-common.h:87
mi_interp::log
mi_console_file * log
Definition: mi-common.h:75
EXEC_ASYNC_SIGNAL_RECEIVED
Definition: mi-common.h:42
EXEC_ASYNC_END_STEPPING_RANGE
Definition: mi-common.h:38
EXEC_ASYNC_EXEC
Definition: mi-common.h:48
mi_interp::saved_raw_stdout
struct ui_file * saved_raw_stdout
Definition: mi-common.h:84
mi_interp::event_channel
mi_console_file * event_channel
Definition: mi-common.h:77
mi_interp::suspend
void suspend() override
Definition: mi-interp.c:191
mi_interp::resume
void resume() override
Definition: mi-interp.c:162
EXEC_ASYNC_EXITED_SIGNALLED
Definition: mi-common.h:39
gdb_exception
Definition: common-exceptions.h:111
mi_interp::targ
mi_console_file * targ
Definition: mi-common.h:76
EXEC_ASYNC_EXITED
Definition: mi-common.h:40
mi_interp::pre_command_loop
void pre_command_loop() override
Definition: mi-interp.c:320
mi_interp::out
mi_console_file * out
Definition: mi-common.h:73
EXEC_ASYNC_EXITED_NORMALLY
Definition: mi-common.h:41
EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER
Definition: mi-common.h:34
EXEC_ASYNC_READ_WATCHPOINT_TRIGGER
Definition: mi-common.h:33
async_reason_lookup
const char * async_reason_lookup(enum async_reply_reason reason)
Definition: mi-common.c:49