]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* observer.c (observer_test_first_notification_function)
authorVladimir Prus <vladimir@codesourcery.com>
Tue, 17 Feb 2009 19:52:27 +0000 (19:52 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Tue, 17 Feb 2009 19:52:27 +0000 (19:52 +0000)
(observer_test_second_notification_function)
(observer_test_third_notification_function): Adjust prototype.

gdb/ChangeLog
gdb/doc/ChangeLog
gdb/doc/observer.texi
gdb/observer.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.gdb/observer.exp

index 9c3a5382eb972b44c47038c61c980e95b9a801c0..f4b2e734dae44510de33c7c2bc38b71e46230921 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-17  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * observer.c (observer_test_first_notification_function)
+       (observer_test_second_notification_function)
+       (observer_test_third_notification_function): Adjust prototype.
+
 2009-02-17  Pedro Alves  <pedro@codesourcery.com>
 
        * Makefile.in (ALL_64_TARGET_OBS): Add amd64-dicos-tdep.o.
index 7d913d6305f4d68eb65b88a0c9f4a0559270cb3f..ea227138bdf6702d284b38df803e284e7c4e27d0 100644 (file)
@@ -1,3 +1,7 @@
+2009-02-17  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * observer.texi (test_notification): New observer.
+
 2009-02-14  Vladimir Prus  <vladimir@codesourcery.com>
 
         * observer.texi: Add parameter 'print_frame' to normal_stop
index c8e8b9691b9e38c49584b0b18bc067939beaba84..04f5034081a838d2c2c6191f66965770d9cbb0bb 100644 (file)
@@ -200,3 +200,8 @@ Either @value{GDBN} detached from the inferior, or the inferior
 exited.  The argument @var{pid} identifies the inferior.
 @end deftypefun
 
+ @deftypefun void test_notification (int @var{somearg})
+This observer is used for internal testing.  Do not use.  
+See testsuite/gdb.gdb/observer.exp.
+ @end deftypefun
+
index 8a059c1f6a96410895a90b76720fa8587ad892fb..106bfcd1521ad623d299e82047425cad05c8bdde 100644 (file)
@@ -181,19 +181,19 @@ int observer_test_second_observer = 0;
 int observer_test_third_observer = 0;
 
 void
-observer_test_first_notification_function (struct bpstats *bs)
+observer_test_first_notification_function (int arg)
 {
   observer_test_first_observer++;
 }
 
 void
-observer_test_second_notification_function (struct bpstats *bs)
+observer_test_second_notification_function (int arg)
 {
   observer_test_second_observer++;
 }
 
 void
-observer_test_third_notification_function (struct bpstats *bs)
+observer_test_third_notification_function (int arg)
 {
   observer_test_third_observer++;
 }
index 24dc96dad4fafb93f9a47ae1cfc298e7839dd61f..6c22a6676dfddcf37476cdadee89d4c7400bff5a 100644 (file)
@@ -1,3 +1,12 @@
+2009-02-17  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * gdb.gdb/observer.exp: Use test_notification observer, not
+       normal_stop, everywhere.
+       (test_normal_stop_notifications): Rename to...
+       (test_notifications): ...this.
+       (test_observer_normal_stop): Rename to...
+       (test_observer): ...this.
+
 2009-02-16  Doug Evans  <dje@google.com>
 
        * gdb.arch/amd64-disp-step.S (test_int3): New test.
index afc6909c83a5a71728dfb7977d9dc7354619c66c..e57b91b9944ec90f2a551287a8d11157dc048313 100644 (file)
@@ -101,32 +101,32 @@ proc setup_test { executable } {
 }
 
 proc attach_first_observer { message } {
-    gdb_test "set \$first_obs = observer_attach_normal_stop (&observer_test_first_notification_function)" \
+    gdb_test "set \$first_obs = observer_attach_test_notification (&observer_test_first_notification_function)" \
        "" "$message; attach first observer"
 }
 
 proc attach_second_observer { message } {
-    gdb_test "set \$second_obs = observer_attach_normal_stop (&observer_test_second_notification_function)" \
+    gdb_test "set \$second_obs = observer_attach_test_notification (&observer_test_second_notification_function)" \
        "" "$message; attach second observer"
 }
 
 proc attach_third_observer { message } {
-    gdb_test "set \$third_obs = observer_attach_normal_stop (&observer_test_third_notification_function)" \
+    gdb_test "set \$third_obs = observer_attach_test_notification (&observer_test_third_notification_function)" \
        "" "$message; attach third observer"
 }
 
 proc detach_first_observer { message } {
-    gdb_test "call observer_detach_normal_stop (\$first_obs)" \
+    gdb_test "call observer_detach_test_notification (\$first_obs)" \
        "" "$message; detach first observer"
 }
 
 proc detach_second_observer { message } {
-    gdb_test "call observer_detach_normal_stop (\$second_obs)" \
+    gdb_test "call observer_detach_test_notification (\$second_obs)" \
        "" "$message; detach second observer"
 }
 
 proc detach_third_observer { message } {
-    gdb_test "call observer_detach_normal_stop (\$third_obs)" \
+    gdb_test "call observer_detach_test_notification (\$third_obs)" \
        "" "$message; detach third observer"
 }
 
@@ -151,21 +151,21 @@ proc reset_counters { message } {
        "$message; reset third observer counter"
 }
 
-proc test_normal_stop_notifications { first second third message args } {
+proc test_notifications { first second third message args } {
     # Do any initialization
     for {set i 0} {$i < [llength $args]} {incr i} {
        [lindex $args $i] $message
     }
     reset_counters $message
-    # Call observer_notify_normal_stop.  Note that this procedure
+    # Call observer_notify_test_notification.  Note that this procedure
     # takes one argument, but this argument is ignored by the observer
     # callbacks we have installed.  So we just pass an arbitrary value.
-    gdb_test "call observer_notify_normal_stop (0)" "" \
+    gdb_test "call observer_notify_test_notification (0)" "" \
        "$message; sending notification"
     check_counters $first $second $third $message
 }
 
-proc test_observer_normal_stop { executable } {
+proc test_observer { executable } {
 
     set setup_result [setup_test $executable]
     if {$setup_result <0} then {
@@ -173,56 +173,56 @@ proc test_observer_normal_stop { executable } {
     }
 
     # First, try sending a notification without any observer attached.
-    test_normal_stop_notifications 0 0 0 "no observer attached"
+    test_notifications 0 0 0 "no observer attached"
 
     # Now, attach one observer, and send a notification.
-    test_normal_stop_notifications 0 1 0 "second observer attached" \
+    test_notifications 0 1 0 "second observer attached" \
        attach_second_observer
 
     # Remove the observer, and send a notification.
-    test_normal_stop_notifications 0 0 0 "second observer detached" \
+    test_notifications 0 0 0 "second observer detached" \
        detach_second_observer
 
     # With a new observer.
-    test_normal_stop_notifications 1 0 0 "1st observer added" \
+    test_notifications 1 0 0 "1st observer added" \
        attach_first_observer
 
     # With 2 observers.
-    test_normal_stop_notifications 1 1 0 "2nd observer added" \
+    test_notifications 1 1 0 "2nd observer added" \
        attach_second_observer
 
     # With 3 observers.
-    test_normal_stop_notifications 1 1 1 "3rd observer added" \
+    test_notifications 1 1 1 "3rd observer added" \
        attach_third_observer
 
     # Remove middle observer.
-    test_normal_stop_notifications 1 0 1 "2nd observer removed" \
+    test_notifications 1 0 1 "2nd observer removed" \
        detach_second_observer
 
     # Remove first observer.
-    test_normal_stop_notifications 0 0 1 "1st observer removed" \
+    test_notifications 0 0 1 "1st observer removed" \
        detach_first_observer
 
     # Remove last observer.
-    test_normal_stop_notifications 0 0 0 "3rd observer removed" \
+    test_notifications 0 0 0 "3rd observer removed" \
        detach_third_observer
 
     # Go back to 3 observers, and remove them in a different order...
-    test_normal_stop_notifications 1 1 1 "three observers added" \
+    test_notifications 1 1 1 "three observers added" \
        attach_first_observer \
        attach_second_observer \
        attach_third_observer 
 
     # Remove the third observer.
-    test_normal_stop_notifications 1 1 0 "third observer removed" \
+    test_notifications 1 1 0 "third observer removed" \
        detach_third_observer
 
     # Remove the second observer.
-    test_normal_stop_notifications 1 0 0 "second observer removed" \
+    test_notifications 1 0 0 "second observer removed" \
        detach_second_observer
 
     # Remove the first observer, no more observers.
-    test_normal_stop_notifications 0 0 0 "first observer removed" \
+    test_notifications 0 0 0 "first observer removed" \
        detach_first_observer
 
     return 0
@@ -262,7 +262,7 @@ remote_file host delete x$tool
 
 gdb_start
 set file [remote_download host $GDB_FULLPATH x$tool]
-set result [test_observer_normal_stop $file];
+set result [test_observer $file];
 gdb_exit;
 catch "remote_file host delete $file";