Don't suppress *running when doing finish.
authorVladimir Prus <vladimir@codesourcery.com>
Fri, 13 Jun 2008 20:19:19 +0000 (20:19 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Fri, 13 Jun 2008 20:19:19 +0000 (20:19 +0000)
        * infcall.c (call_function_by_hand): Set both
        suppress_resume_observer and suppress_stop_observer.
        * infcmd.c (suppress_run_stop_observers): Split into...
        (suppress_resume_observer, suppress_stop_observer): ...those.
        (finish_command_continuation): Clear suppress_stop_observer.
        (finish_command): Set suppress_stop_observer.
        * inferior.h (suppress_run_stop_observers): Split into...
        (suppress_resume_observer, suppress_stop_observer): ...those.
        * infrun.c (normal_stop): Check for suppress_stop_observer.
        * thread.c (set_running): Check for suppress_resume_observer.

gdb/ChangeLog
gdb/infcall.c
gdb/infcmd.c
gdb/inferior.h
gdb/infrun.c
gdb/thread.c

index a207f3493b5468dac9cd5bd8b5dfe4982806b984..e69b4eae1ef81dc1b8c3e45fabd909408f8eadd8 100644 (file)
@@ -1,3 +1,17 @@
+2008-06-14  Vladimir Prus  <vladimir@codesourcery.com>
+
+       Don't suppress *running when doing finish.
+        * infcall.c (call_function_by_hand): Set both
+        suppress_resume_observer and suppress_stop_observer.
+        * infcmd.c (suppress_run_stop_observers): Split into...
+        (suppress_resume_observer, suppress_stop_observer): ...those.
+        (finish_command_continuation): Clear suppress_stop_observer.
+        (finish_command): Set suppress_stop_observer.
+        * inferior.h (suppress_run_stop_observers): Split into...
+        (suppress_resume_observer, suppress_stop_observer): ...those.
+        * infrun.c (normal_stop): Check for suppress_stop_observer.
+        * thread.c (set_running): Check for suppress_resume_observer.
+
 2008-06-12  Pedro Alves  <pedro_alves@portugalmail.pt>
            Pierre Muller  <muller@ics.u-strasbg.fr>
 
index 33a098ff59ee571785798066e7fe3612d5f52830..559b4a2e7b965cd0700b7eda4e0cbcf5ffb74983 100644 (file)
@@ -720,9 +720,10 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
     if (target_can_async_p ())
       saved_async = target_async_mask (0);
 
-    old_cleanups2 = make_cleanup_restore_integer 
-      (&suppress_run_stop_observers);
-    suppress_run_stop_observers = 1;
+    old_cleanups2 = make_cleanup_restore_integer (&suppress_resume_observer);
+    suppress_resume_observer = 1;
+    make_cleanup_restore_integer (&suppress_stop_observer);
+    suppress_stop_observer = 1;
     proceed (real_pc, TARGET_SIGNAL_0, 0);
     do_cleanups (old_cleanups2);
     
index a4f40a5d6fc3a7532ab9327a66da509a26a429fc..d9c9cb758340cd8c9eb17209c77f85e195138d28 100644 (file)
@@ -207,9 +207,10 @@ int step_multi;
 
 struct gdb_environ *inferior_environ;
 
-/* When set, normal_stop will not call the normal_stop observer.
-   Resume observer likewise will not be called.  */
-int suppress_run_stop_observers = 0;
+/* When set, no calls to target_resumed observer will be made.  */
+int suppress_resume_observer = 0;
+/* When set, normal_stop will not call the normal_stop observer.  */
+int suppress_stop_observer = 0;
 \f
 /* Accessor routines. */
 
@@ -1304,7 +1305,7 @@ finish_command_continuation (struct continuation_arg *arg, int error_p)
       observer_notify_normal_stop (stop_bpstat);
     }
 
-  suppress_run_stop_observers = 0;
+  suppress_stop_observer = 0;
   delete_breakpoint (breakpoint);
 }
 
@@ -1371,8 +1372,8 @@ finish_command (char *arg, int from_tty)
     }
 
   proceed_to_finish = 1;       /* We want stop_registers, please...  */
-  make_cleanup_restore_integer (&suppress_run_stop_observers);
-  suppress_run_stop_observers = 1;
+  make_cleanup_restore_integer (&suppress_stop_observer);
+  suppress_stop_observer = 1;
   proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
 
   arg1 =
index 1042a447fea532efe6897399fabcf94ed27aa48a..dd07efafe6cbbe1f89249d6091c318d05cf90e70 100644 (file)
@@ -393,7 +393,11 @@ void displaced_step_dump_bytes (struct ui_file *file,
 
 
 /* When set, normal_stop will not call the normal_stop observer.  */
-extern int suppress_run_stop_observers;
+extern int suppress_stop_observer;
+
+/* When set, no calls to target_resumed observer will be made.  */
+extern int suppress_resume_observer;
+
 \f
 /* Possible values for gdbarch_call_dummy_location.  */
 #define ON_STACK 1
index cfc3d9bb507262ed8440f8e5b75655ccfdae3c77..e951ede8e7800b9faa7bdde44d12ebafe38e4cb7 100644 (file)
@@ -3772,7 +3772,7 @@ Further execution is probably impossible.\n"));
 
 done:
   annotate_stopped ();
-  if (!suppress_run_stop_observers && !step_multi)
+  if (!suppress_stop_observer && !step_multi)
     observer_notify_normal_stop (stop_bpstat);
   /* Delete the breakpoint we stopped at, if it wants to be deleted.
      Delete any breakpoint that is to be deleted at the next stop.  */
index 64d41eb0541d3ba3e60ed3b1e31cbb29afbfbea5..80d745dc306ad9d5a1eb03e65627a16d1bb1bfbe 100644 (file)
@@ -431,7 +431,7 @@ set_running (ptid_t ptid, int running)
         the main thread is always present in the thread list.  If it's
         not, the first call to context_switch will mess up GDB internal
         state.  */
-      if (running && !main_thread_running && !suppress_run_stop_observers)
+      if (running && !main_thread_running && !suppress_resume_observer)
        observer_notify_target_resumed (ptid);
       main_thread_running = running;
       return;
@@ -449,14 +449,14 @@ set_running (ptid_t ptid, int running)
            any_started = 1;
          tp->running_ = running;
        }
-      if (any_started && !suppress_run_stop_observers)
+      if (any_started && !suppress_resume_observer)
        observer_notify_target_resumed (ptid);      
     }
   else
     {
       tp = find_thread_pid (ptid);
       gdb_assert (tp);
-      if (running && !tp->running_ && !suppress_run_stop_observers)
+      if (running && !tp->running_ && !suppress_resume_observer)
        observer_notify_target_resumed (ptid);
       tp->running_ = running;
     }