summaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-04-24 19:26:04 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-04-24 19:26:41 -0400
commitc90e7d6352b2e16ac007d08b2e03ae10081147b5 (patch)
tree2ca6bb8a1d338ff48f2eed24dcb25300e4204f54 /gdb/tui
parentec098003e27d67bca9e9880320e26ab8ad30fe31 (diff)
downloadbinutils-gdb-c90e7d6352b2e16ac007d08b2e03ae10081147b5.tar.gz
gdbsupport, gdb: give names to observers
Give a name to each observer, this will help produce more meaningful debug message. gdbsupport/ChangeLog: * observable.h (class observable) <struct observer> <observer>: Add name parameter. <name>: New field. <attach>: Add name parameter, update all callers. Change-Id: Ie0cc4664925215b8d2b09e026011b7803549fba0
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-hooks.c4
-rw-r--r--gdb/tui/tui-interp.c20
-rw-r--r--gdb/tui/tui-win.c4
-rw-r--r--gdb/tui/tui-winsource.c2
4 files changed, 16 insertions, 14 deletions
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 2d7660acade..52519aecf17 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -222,7 +222,7 @@ static void
attach_or_detach (T &observable, typename T::func_type func, bool attach)
{
if (attach)
- observable.attach (func, tui_observers_token);
+ observable.attach (func, tui_observers_token, "tui-hooks");
else
observable.detach (tui_observers_token);
}
@@ -282,5 +282,5 @@ void
_initialize_tui_hooks ()
{
/* Install the permanent hooks. */
- gdb::observers::new_objfile.attach (tui_new_objfile_hook);
+ gdb::observers::new_objfile.attach (tui_new_objfile_hook, "tui-hooks");
}
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index f70e1a7b4c2..aaa353c5146 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -343,14 +343,16 @@ _initialize_tui_interp ()
}
/* If changing this, remember to update cli-interp.c as well. */
- gdb::observers::normal_stop.attach (tui_on_normal_stop);
- gdb::observers::signal_received.attach (tui_on_signal_received);
- gdb::observers::end_stepping_range.attach (tui_on_end_stepping_range);
- gdb::observers::signal_exited.attach (tui_on_signal_exited);
- gdb::observers::exited.attach (tui_on_exited);
- gdb::observers::no_history.attach (tui_on_no_history);
- gdb::observers::sync_execution_done.attach (tui_on_sync_execution_done);
- gdb::observers::command_error.attach (tui_on_command_error);
+ gdb::observers::normal_stop.attach (tui_on_normal_stop, "tui-interp");
+ gdb::observers::signal_received.attach (tui_on_signal_received, "tui-interp");
+ gdb::observers::end_stepping_range.attach (tui_on_end_stepping_range,
+ "tui-interp");
+ gdb::observers::signal_exited.attach (tui_on_signal_exited, "tui-interp");
+ gdb::observers::exited.attach (tui_on_exited, "tui-interp");
+ gdb::observers::no_history.attach (tui_on_no_history, "tui-interp");
+ gdb::observers::sync_execution_done.attach (tui_on_sync_execution_done,
+ "tui-interp");
+ gdb::observers::command_error.attach (tui_on_command_error, "tui-interp");
gdb::observers::user_selected_context_changed.attach
- (tui_on_user_selected_context_changed);
+ (tui_on_user_selected_context_changed, "tui-interp");
}
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index c73d129d1c7..17682b022a3 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1120,6 +1120,6 @@ the line numbers and uses less horizontal space."),
tui_set_compact_source, tui_show_compact_source,
&tui_setlist, &tui_showlist);
- tui_border_style.changed.attach (tui_rehighlight_all);
- tui_active_border_style.changed.attach (tui_rehighlight_all);
+ tui_border_style.changed.attach (tui_rehighlight_all, "tui-win");
+ tui_active_border_style.changed.attach (tui_rehighlight_all, "tui-win");
}
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 058079e208a..908d9015bf1 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -294,7 +294,7 @@ tui_source_window_base::tui_source_window_base ()
gdb::observers::source_styling_changed.attach
(std::bind (&tui_source_window::style_changed, this),
- m_observable);
+ m_observable, "tui-winsource");
}
tui_source_window_base::~tui_source_window_base ()