[RFA,2/4] Change types to match observer.attach
Commit Message
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(-)
@@ -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.
@@ -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";
@@ -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