summaryrefslogtreecommitdiff
path: root/gdb/observer.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2003-03-18 18:05:51 +0000
committerJoel Brobecker <brobecker@gnat.com>2003-03-18 18:05:51 +0000
commitb21e2d684a89f7b5c274ebebd5f2ea617e71041d (patch)
tree54c07d5c752eecfb0c5402cfa654369bf074c5d1 /gdb/observer.c
parenta4fb82a50d11e8365cc2bba2cb85308c60d25926 (diff)
downloadgdb-b21e2d684a89f7b5c274ebebd5f2ea617e71041d.tar.gz
* observer.c (observer_test_first_observer): New static variable.
(observer_test_second_observer): Likewise. (observer_test_third_observer): Likewise. (observer_test_first_notification_function): New static function. (observer_test_second_notification_function): Likewise. (observer_test_third_notification_function): Likewise.
Diffstat (limited to 'gdb/observer.c')
-rw-r--r--gdb/observer.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/observer.c b/gdb/observer.c
index 92ec48e614f..6815d0f9c83 100644
--- a/gdb/observer.c
+++ b/gdb/observer.c
@@ -190,3 +190,33 @@ observer_notify_normal_stop (void)
{
generic_observer_notify (normal_stop_subject, NULL);
}
+
+/* The following code is only used to unit-test the observers from
+ our testsuite. DO NOT USE IT within observer.c! */
+
+/* Since this code will not be used within GDB, it will trigger
+ a warning if we decide to compile with -Wunused-function.
+ This is ok for now. (brobecker 2003-03-18) */
+
+static int observer_test_first_observer = 0;
+static int observer_test_second_observer = 0;
+static int observer_test_third_observer = 0;
+
+static void
+observer_test_first_notification_function (void)
+{
+ observer_test_first_observer++;
+}
+
+static void
+observer_test_second_notification_function (void)
+{
+ observer_test_second_observer++;
+}
+
+static void
+observer_test_third_notification_function (void)
+{
+ observer_test_third_observer++;
+}
+