From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/4] gdb: rename source_styling_changed observer
Date: Tue, 26 Oct 2021 10:37:57 +0100 [thread overview]
Message-ID: <33d7cb45d4f4e7d99ef12dbbf2d1606d0aa27d32.1635241044.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1635241044.git.andrew.burgess@embecosm.com>
In the next 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 next
commit, I can use the same observer for both source styling, and
disassembler styling.
There should be no user visible changes after this commit.
---
gdb/cli/cli-style.c | 2 +-
gdb/observable.c | 2 +-
gdb/observable.h | 6 +++---
gdb/tui/tui-winsource.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index aca19c51b84..228fa698c13 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -279,7 +279,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
diff --git a/gdb/observable.c b/gdb/observable.c
index b020076cf26..d965ec3e52d 100644
--- a/gdb/observable.c
+++ b/gdb/observable.c
@@ -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);
diff --git a/gdb/observable.h b/gdb/observable.h
index f20f532870f..707c214ac66 100644
--- a/gdb/observable.h
+++ b/gdb/observable.h
@@ -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
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 955b68901fe..e2ab87eb9d4 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -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. */
--
2.25.4
next prev parent reply other threads:[~2021-10-26 9:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 9:37 [PATCH 0/4] Disassembler Output Styling Andrew Burgess
2021-10-26 9:37 ` [PATCH 1/4] gdb/python: make some global variables static Andrew Burgess
2021-10-27 20:20 ` Tom Tromey
2021-11-25 10:12 ` Andrew Burgess
2021-11-25 15:02 ` Enze Li
2021-11-25 18:11 ` Andrew Burgess
2021-10-26 9:37 ` Andrew Burgess [this message]
2021-10-27 20:22 ` [PATCH 2/4] gdb: rename source_styling_changed observer Tom Tromey
2021-11-25 10:17 ` Andrew Burgess
2021-10-26 9:37 ` [PATCH 3/4] gdb: use python to colorize disassembler output Andrew Burgess
2021-10-27 20:38 ` Tom Tromey
2021-10-28 16:28 ` Andrew Burgess
2021-11-22 14:44 ` Andrew Burgess
2021-10-26 9:37 ` [PATCH 4/4] gdb/python: move styling support to gdb.styling Andrew Burgess
2021-10-27 20:39 ` Tom Tromey
2021-11-25 10:36 ` [PATCHv2 0/2] Disassembler Output Styling Andrew Burgess
2021-11-25 10:36 ` [PATCHv2 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2021-11-25 11:04 ` Eli Zaretskii
2021-11-25 10:36 ` [PATCHv2 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2021-12-06 14:32 ` Ping: [PATCHv2 0/2] Disassembler Output Styling Andrew Burgess
2021-12-13 14:12 ` [PATCHv3 " Andrew Burgess
2021-12-13 14:12 ` [PATCHv3 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2021-12-13 14:12 ` [PATCHv3 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-01-11 14:30 ` [PATCHv4 0/2] Disassembler Output Styling Andrew Burgess
2022-01-11 14:31 ` [PATCHv4 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2022-02-10 21:13 ` Tom Tromey
2022-02-11 14:27 ` Andrew Burgess
2022-02-13 18:02 ` Tom Tromey
2022-02-14 11:22 ` Andrew Burgess
2022-01-11 14:31 ` [PATCHv4 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-02-10 21:15 ` Tom Tromey
2022-02-10 21:16 ` Tom Tromey
2022-01-21 16:26 ` [PATCHv5 0/2] Disassembler Output Styling Andrew Burgess
2022-01-21 16:26 ` [PATCHv5 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2022-01-21 16:26 ` [PATCHv5 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-02-03 20:32 ` [PATCHv5 0/2] Disassembler Output Styling Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=33d7cb45d4f4e7d99ef12dbbf2d1606d0aa27d32.1635241044.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).