From: Vladimir Prus Date: Fri, 13 Jun 2008 20:19:19 +0000 (+0000) Subject: Don't suppress *running when doing finish. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;ds=sidebyside;h=8f6a8e8417fa1e8191993f4869628460605e6221;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a207f3493b5..e69b4eae1ef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2008-06-14 Vladimir Prus + + 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 Pierre Muller diff --git a/gdb/infcall.c b/gdb/infcall.c index 33a098ff59e..559b4a2e7b9 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -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); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index a4f40a5d6fc..d9c9cb75834 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -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; /* 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 = diff --git a/gdb/inferior.h b/gdb/inferior.h index 1042a447fea..dd07efafe6c 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -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; + /* Possible values for gdbarch_call_dummy_location. */ #define ON_STACK 1 diff --git a/gdb/infrun.c b/gdb/infrun.c index cfc3d9bb507..e951ede8e78 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -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. */ diff --git a/gdb/thread.c b/gdb/thread.c index 64d41eb0541..80d745dc306 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -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; }