gdb: rename source_styling_changed observer

In a later commit I plan to add disassembler styling.  In the same way
that we have a source_styling_changed observer I would need to add a
disassembler_styling_changed observer.

However, currently, these observers would only be notified from
cli-style.c:set_style_enabled, and observed in tui-winsource.c,
tui_source_window::style_changed, as a result, having two observers
seems unnecessary right now, so, in this commit, I plan to rename
source_styling_changed to just styling_changed, then, in the later
commit, when disassembler styling is added, I can use the same
observer for both source styling, and disassembler styling.

There should be no user visible changes after this commit.
This commit is contained in:
Andrew Burgess
2021-10-25 21:27:20 +01:00
parent c6a6aad52d
commit 43077a2374
4 changed files with 7 additions and 7 deletions

View File

@ -278,7 +278,7 @@ static void
set_style_enabled (const char *args, int from_tty, struct cmd_list_element *c)
{
g_source_cache.clear ();
gdb::observers::source_styling_changed.notify ();
gdb::observers::styling_changed.notify ();
}
static void

View File

@ -75,7 +75,7 @@ DEFINE_OBSERVABLE (inferior_call_pre);
DEFINE_OBSERVABLE (inferior_call_post);
DEFINE_OBSERVABLE (register_changed);
DEFINE_OBSERVABLE (user_selected_context_changed);
DEFINE_OBSERVABLE (source_styling_changed);
DEFINE_OBSERVABLE (styling_changed);
DEFINE_OBSERVABLE (current_source_symtab_and_line_changed);
DEFINE_OBSERVABLE (gdb_exiting);

View File

@ -241,9 +241,9 @@ extern observable<struct frame_info */* frame */, int /* regnum */>
extern observable<user_selected_what /* selection */>
user_selected_context_changed;
/* This is notified when the source styling setting has changed and
should be reconsulted. */
extern observable<> source_styling_changed;
/* This is notified when a styling setting has changed, content may need
to be updated based on the new settings. */
extern observable<> styling_changed;
/* The CLI's notion of the current source has changed. This differs
from user_selected_context_changed in that it is also set by the

View File

@ -292,14 +292,14 @@ tui_source_window_base::tui_source_window_base ()
m_start_line_or_addr.loa = LOA_ADDRESS;
m_start_line_or_addr.u.addr = 0;
gdb::observers::source_styling_changed.attach
gdb::observers::styling_changed.attach
(std::bind (&tui_source_window::style_changed, this),
m_observable, "tui-winsource");
}
tui_source_window_base::~tui_source_window_base ()
{
gdb::observers::source_styling_changed.detach (m_observable);
gdb::observers::styling_changed.detach (m_observable);
}
/* See tui-data.h. */