gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / observable.c
1 /* GDB Notifications to Observers.
2
3 Copyright (C) 2003-2020 Free Software Foundation, Inc.
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
25 namespace gdb
26 {
27
28 namespace observers
29 {
30
31 unsigned int observer_debug;
32
33 #define DEFINE_OBSERVABLE(name) decltype (name) name (# name)
34
35 DEFINE_OBSERVABLE (normal_stop);
36 DEFINE_OBSERVABLE (signal_received);
37 DEFINE_OBSERVABLE (end_stepping_range);
38 DEFINE_OBSERVABLE (signal_exited);
39 DEFINE_OBSERVABLE (exited);
40 DEFINE_OBSERVABLE (no_history);
41 DEFINE_OBSERVABLE (sync_execution_done);
42 DEFINE_OBSERVABLE (command_error);
43 DEFINE_OBSERVABLE (target_changed);
44 DEFINE_OBSERVABLE (executable_changed);
45 DEFINE_OBSERVABLE (inferior_created);
46 DEFINE_OBSERVABLE (record_changed);
47 DEFINE_OBSERVABLE (solib_loaded);
48 DEFINE_OBSERVABLE (solib_unloaded);
49 DEFINE_OBSERVABLE (new_objfile);
50 DEFINE_OBSERVABLE (free_objfile);
51 DEFINE_OBSERVABLE (new_thread);
52 DEFINE_OBSERVABLE (thread_exit);
53 DEFINE_OBSERVABLE (thread_stop_requested);
54 DEFINE_OBSERVABLE (target_resumed);
55 DEFINE_OBSERVABLE (about_to_proceed);
56 DEFINE_OBSERVABLE (breakpoint_created);
57 DEFINE_OBSERVABLE (breakpoint_deleted);
58 DEFINE_OBSERVABLE (breakpoint_modified);
59 DEFINE_OBSERVABLE (traceframe_changed);
60 DEFINE_OBSERVABLE (architecture_changed);
61 DEFINE_OBSERVABLE (thread_ptid_changed);
62 DEFINE_OBSERVABLE (inferior_added);
63 DEFINE_OBSERVABLE (inferior_appeared);
64 DEFINE_OBSERVABLE (inferior_exit);
65 DEFINE_OBSERVABLE (inferior_removed);
66 DEFINE_OBSERVABLE (inferior_execd);
67 DEFINE_OBSERVABLE (memory_changed);
68 DEFINE_OBSERVABLE (before_prompt);
69 DEFINE_OBSERVABLE (gdb_datadir_changed);
70 DEFINE_OBSERVABLE (command_param_changed);
71 DEFINE_OBSERVABLE (tsv_created);
72 DEFINE_OBSERVABLE (tsv_deleted);
73 DEFINE_OBSERVABLE (tsv_modified);
74 DEFINE_OBSERVABLE (inferior_call_pre);
75 DEFINE_OBSERVABLE (inferior_call_post);
76 DEFINE_OBSERVABLE (register_changed);
77 DEFINE_OBSERVABLE (user_selected_context_changed);
78 DEFINE_OBSERVABLE (source_styling_changed);
79 DEFINE_OBSERVABLE (current_source_symtab_and_line_changed);
80
81 } /* namespace observers */
82 } /* namespace gdb */
83
84 static void
85 show_observer_debug (struct ui_file *file, int from_tty,
86 struct cmd_list_element *c, const char *value)
87 {
88 fprintf_filtered (file, _("Observer debugging is %s.\n"), value);
89 }
90
91 void _initialize_observer ();
92 void
93 _initialize_observer ()
94 {
95 add_setshow_zuinteger_cmd ("observer", class_maintenance,
96 &gdb::observers::observer_debug, _("\
97 Set observer debugging."), _("\
98 Show observer debugging."), _("\
99 When non-zero, observer debugging is enabled."),
100 NULL,
101 show_observer_debug,
102 &setdebuglist, &showdebuglist);
103 }
This page took 0.031877 seconds and 4 git commands to generate.