diff mbox

[RFA,2/4] Change types to match observer.attach

Message ID 1475468542-11446-3-git-send-email-tom@tromey.com
State New
Headers show

Commit Message

Tom Tromey Oct. 3, 2016, 4:22 a.m. UTC
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 mbox

Patch

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