From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA 2/4] Change types to match observer.attach
Date: Mon, 03 Oct 2016 04:22:00 -0000 [thread overview]
Message-ID: <1475468542-11446-3-git-send-email-tom@tromey.com> (raw)
In-Reply-To: <1475468542-11446-1-git-send-email-tom@tromey.com>
The first patch changed the return type of the observer attach
function. This patch changes the few spots where this type matters.
2016-10-02 Tom Tromey <tom@tromey.com>
* tui/tui-hooks.c (tui_bp_created_observer)
(tui_bp_deleted_observer, tui_bp_modified_observer)
(tui_inferior_exit_observer, tui_before_prompt_observer)
(tui_normal_stop_observer, tui_register_changed_observer): Change
type.
* record-btrace.c (record_btrace_thread_observer): Change type.
---
gdb/ChangeLog | 7 +++++++
gdb/record-btrace.c | 3 ++-
gdb/tui/tui-hooks.c | 21 ++++++++++++++-------
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 69d8a82..8265310 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2016-10-02 Tom Tromey <tom@tromey.com>
+ * tui/tui-hooks.c (tui_bp_created_observer)
+ (tui_bp_deleted_observer, tui_bp_modified_observer)
+ (tui_inferior_exit_observer, tui_before_prompt_observer)
+ (tui_normal_stop_observer, tui_register_changed_observer): Change
+ type.
+ * record-btrace.c (record_btrace_thread_observer): Change type.
+
* observer.sh: Remove.
* observer.h: New file.
* observer.c (namespace gdb_observers): Define new objects.
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 257d0b0..9876943 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -45,7 +45,8 @@
static struct target_ops record_btrace_ops;
/* A new thread observer enabling branch tracing for the new thread. */
-static struct observer *record_btrace_thread_observer;
+static gdb_observers::observer1<struct thread_info *>::func_type
+ record_btrace_thread_observer;
/* Memory access types used in set/show record btrace replay-memory-access. */
static const char replay_memory_access_read_only[] = "read-only";
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index 5a03b61..8ca254d 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -207,13 +207,20 @@ tui_normal_stop (struct bpstats *bs, int print_frame)
}
/* Observers created when installing TUI hooks. */
-static struct observer *tui_bp_created_observer;
-static struct observer *tui_bp_deleted_observer;
-static struct observer *tui_bp_modified_observer;
-static struct observer *tui_inferior_exit_observer;
-static struct observer *tui_before_prompt_observer;
-static struct observer *tui_normal_stop_observer;
-static struct observer *tui_register_changed_observer;
+static gdb_observers::observer1<struct breakpoint *>::func_type
+ tui_bp_created_observer;
+static gdb_observers::observer1<struct breakpoint *>::func_type
+ tui_bp_deleted_observer;
+static gdb_observers::observer1<struct breakpoint *>::func_type
+ tui_bp_modified_observer;
+static gdb_observers::observer1<struct inferior *>::func_type
+ tui_inferior_exit_observer;
+static gdb_observers::observer1<const char *>::func_type
+ tui_before_prompt_observer;
+static gdb_observers::observer2<struct bpstats *, int>::func_type
+ tui_normal_stop_observer;
+static gdb_observers::observer2<struct frame_info *, int>::func_type
+ tui_register_changed_observer;
/* Install the TUI specific hooks. */
void
--
2.7.4
next prev parent reply other threads:[~2016-10-03 4:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 4:22 [RFA 0/4] Conver observers to C++ Tom Tromey
2016-10-03 4:22 ` [RFA 1/4] Convert " Tom Tromey
2016-10-03 17:32 ` Trevor Saunders
2016-10-03 4:22 ` Tom Tromey [this message]
2016-10-03 4:22 ` [RFA 4/4] Change observer tests to use selftest framework Tom Tromey
2016-10-03 4:22 ` [RFA 3/4] Update all observer uses Tom Tromey
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=1475468542-11446-3-git-send-email-tom@tromey.com \
--to=tom@tromey.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