]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/observable.c
Automatic Copyright Year update after running gdb/copyright.py
[thirdparty/binutils-gdb.git] / gdb / observable.c
CommitLineData
76727919
TT
1/* GDB Notifications to Observers.
2
4a94e368 3 Copyright (C) 2003-2022 Free Software Foundation, Inc.
76727919
TT
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "observable.h"
22#include "command.h"
23#include "gdbcmd.h"
24
25namespace gdb
26{
27
28namespace observers
29{
30
98c897e3 31bool observer_debug = false;
76727919
TT
32
33#define DEFINE_OBSERVABLE(name) decltype (name) name (# name)
34
35DEFINE_OBSERVABLE (normal_stop);
36DEFINE_OBSERVABLE (signal_received);
37DEFINE_OBSERVABLE (end_stepping_range);
38DEFINE_OBSERVABLE (signal_exited);
39DEFINE_OBSERVABLE (exited);
40DEFINE_OBSERVABLE (no_history);
41DEFINE_OBSERVABLE (sync_execution_done);
42DEFINE_OBSERVABLE (command_error);
43DEFINE_OBSERVABLE (target_changed);
44DEFINE_OBSERVABLE (executable_changed);
45DEFINE_OBSERVABLE (inferior_created);
42a4fec5 46DEFINE_OBSERVABLE (inferior_execd);
76727919
TT
47DEFINE_OBSERVABLE (record_changed);
48DEFINE_OBSERVABLE (solib_loaded);
49DEFINE_OBSERVABLE (solib_unloaded);
50DEFINE_OBSERVABLE (new_objfile);
51DEFINE_OBSERVABLE (free_objfile);
52DEFINE_OBSERVABLE (new_thread);
53DEFINE_OBSERVABLE (thread_exit);
54DEFINE_OBSERVABLE (thread_stop_requested);
55DEFINE_OBSERVABLE (target_resumed);
56DEFINE_OBSERVABLE (about_to_proceed);
57DEFINE_OBSERVABLE (breakpoint_created);
58DEFINE_OBSERVABLE (breakpoint_deleted);
59DEFINE_OBSERVABLE (breakpoint_modified);
60DEFINE_OBSERVABLE (traceframe_changed);
61DEFINE_OBSERVABLE (architecture_changed);
62DEFINE_OBSERVABLE (thread_ptid_changed);
63DEFINE_OBSERVABLE (inferior_added);
64DEFINE_OBSERVABLE (inferior_appeared);
65DEFINE_OBSERVABLE (inferior_exit);
66DEFINE_OBSERVABLE (inferior_removed);
67DEFINE_OBSERVABLE (memory_changed);
68DEFINE_OBSERVABLE (before_prompt);
69DEFINE_OBSERVABLE (gdb_datadir_changed);
70DEFINE_OBSERVABLE (command_param_changed);
71DEFINE_OBSERVABLE (tsv_created);
72DEFINE_OBSERVABLE (tsv_deleted);
73DEFINE_OBSERVABLE (tsv_modified);
74DEFINE_OBSERVABLE (inferior_call_pre);
75DEFINE_OBSERVABLE (inferior_call_post);
76DEFINE_OBSERVABLE (register_changed);
77DEFINE_OBSERVABLE (user_selected_context_changed);
43077a23 78DEFINE_OBSERVABLE (styling_changed);
a75cd9a2 79DEFINE_OBSERVABLE (current_source_symtab_and_line_changed);
b1f0f284 80DEFINE_OBSERVABLE (gdb_exiting);
0e3b7c25 81DEFINE_OBSERVABLE (connection_removed);
76727919
TT
82
83} /* namespace observers */
84} /* namespace gdb */
85
86static void
87show_observer_debug (struct ui_file *file, int from_tty,
88 struct cmd_list_element *c, const char *value)
89{
90 fprintf_filtered (file, _("Observer debugging is %s.\n"), value);
91}
92
6c265988 93void _initialize_observer ();
76727919 94void
6c265988 95_initialize_observer ()
76727919 96{
98c897e3
SM
97 add_setshow_boolean_cmd ("observer", class_maintenance,
98 &gdb::observers::observer_debug, _("\
76727919
TT
99Set observer debugging."), _("\
100Show observer debugging."), _("\
101When non-zero, observer debugging is enabled."),
98c897e3
SM
102 NULL,
103 show_observer_debug,
104 &setdebuglist, &showdebuglist);
76727919 105}