]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/observable.c
[gdb/tdep] Fix ARM_LINUX_JB_PC_EABI
[thirdparty/binutils-gdb.git] / gdb / observable.c
CommitLineData
76727919
TT
1/* GDB Notifications to Observers.
2
1d506c26 3 Copyright (C) 2003-2024 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
76727919
TT
20#include "observable.h"
21#include "command.h"
5b9707eb 22#include "cli/cli-cmds.h"
76727919
TT
23
24namespace gdb
25{
26
27namespace observers
28{
29
98c897e3 30bool observer_debug = false;
76727919
TT
31
32#define DEFINE_OBSERVABLE(name) decltype (name) name (# name)
33
34DEFINE_OBSERVABLE (normal_stop);
35DEFINE_OBSERVABLE (signal_received);
76727919
TT
36DEFINE_OBSERVABLE (target_changed);
37DEFINE_OBSERVABLE (executable_changed);
38DEFINE_OBSERVABLE (inferior_created);
42a4fec5 39DEFINE_OBSERVABLE (inferior_execd);
f5694400 40DEFINE_OBSERVABLE (inferior_forked);
76727919
TT
41DEFINE_OBSERVABLE (solib_loaded);
42DEFINE_OBSERVABLE (solib_unloaded);
43DEFINE_OBSERVABLE (new_objfile);
74daa597 44DEFINE_OBSERVABLE (all_objfiles_removed);
76727919
TT
45DEFINE_OBSERVABLE (free_objfile);
46DEFINE_OBSERVABLE (new_thread);
47DEFINE_OBSERVABLE (thread_exit);
7d1fd671 48DEFINE_OBSERVABLE (thread_deleted);
76727919
TT
49DEFINE_OBSERVABLE (thread_stop_requested);
50DEFINE_OBSERVABLE (target_resumed);
51DEFINE_OBSERVABLE (about_to_proceed);
52DEFINE_OBSERVABLE (breakpoint_created);
53DEFINE_OBSERVABLE (breakpoint_deleted);
54DEFINE_OBSERVABLE (breakpoint_modified);
4b2f71e6 55DEFINE_OBSERVABLE (new_architecture);
76727919
TT
56DEFINE_OBSERVABLE (thread_ptid_changed);
57DEFINE_OBSERVABLE (inferior_added);
58DEFINE_OBSERVABLE (inferior_appeared);
9056c917 59DEFINE_OBSERVABLE (inferior_pre_detach);
76727919
TT
60DEFINE_OBSERVABLE (inferior_exit);
61DEFINE_OBSERVABLE (inferior_removed);
c6ae6045 62DEFINE_OBSERVABLE (inferior_cloned);
76727919
TT
63DEFINE_OBSERVABLE (memory_changed);
64DEFINE_OBSERVABLE (before_prompt);
65DEFINE_OBSERVABLE (gdb_datadir_changed);
76727919
TT
66DEFINE_OBSERVABLE (inferior_call_pre);
67DEFINE_OBSERVABLE (inferior_call_post);
68DEFINE_OBSERVABLE (register_changed);
69DEFINE_OBSERVABLE (user_selected_context_changed);
43077a23 70DEFINE_OBSERVABLE (styling_changed);
a75cd9a2 71DEFINE_OBSERVABLE (current_source_symtab_and_line_changed);
b1f0f284 72DEFINE_OBSERVABLE (gdb_exiting);
0e3b7c25 73DEFINE_OBSERVABLE (connection_removed);
fb85cece
PM
74DEFINE_OBSERVABLE (target_pre_wait);
75DEFINE_OBSERVABLE (target_post_wait);
59912fb2
AB
76DEFINE_OBSERVABLE (new_program_space);
77DEFINE_OBSERVABLE (free_program_space);
76727919
TT
78
79} /* namespace observers */
80} /* namespace gdb */
81
82static void
83show_observer_debug (struct ui_file *file, int from_tty,
84 struct cmd_list_element *c, const char *value)
85{
6cb06a8c 86 gdb_printf (file, _("Observer debugging is %s.\n"), value);
76727919
TT
87}
88
6c265988 89void _initialize_observer ();
76727919 90void
6c265988 91_initialize_observer ()
76727919 92{
98c897e3
SM
93 add_setshow_boolean_cmd ("observer", class_maintenance,
94 &gdb::observers::observer_debug, _("\
76727919
TT
95Set observer debugging."), _("\
96Show observer debugging."), _("\
97When non-zero, observer debugging is enabled."),
98c897e3
SM
98 NULL,
99 show_observer_debug,
100 &setdebuglist, &showdebuglist);
76727919 101}