summaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2009-03-22 17:57:10 +0000
committerPedro Alves <pedro@codesourcery.com>2009-03-22 17:57:10 +0000
commit7f43a566f95a1cf96ed799471319b5c574ee575e (patch)
tree0aadadb9486ae9bb998bb3f45dd23cdcbc890a68 /gdb/infrun.c
parente0f2167a8e0855ab0a1545da2b5f1472cac923dc (diff)
downloadgdb-7f43a566f95a1cf96ed799471319b5c574ee575e.tar.gz
* infcall.c (run_inferior_call): Remove references to
suppress_stop_observer. * infcmd.c (suppress_stop_observer): Delete. (finish_command_continuation): Remove NOTE. Don't clear suppress_stop_observer anymore. (finish_command_continuation_free_arg): Likewise. (finish_forward): Remove references to suppress_stop_observer. Call normal_stop observer if we haven't already. * inferior.h (suppress_stop_observer): Delete. * infrun.c (normal_stop): When deciding to suppress the normal_stop observer, check for proceed_to_finish instead of suppress_stop_observer.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d774e32022b..8466ed6bb22 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4433,11 +4433,25 @@ Further execution is probably impossible.\n"));
done:
annotate_stopped ();
- if (!suppress_stop_observer
- && !(target_has_execution
- && last.kind != TARGET_WAITKIND_SIGNALLED
- && last.kind != TARGET_WAITKIND_EXITED
- && inferior_thread ()->step_multi))
+
+ /* Suppress the stop observer if we're in the middle of:
+
+ - a step n (n > 1), as there still more steps to be done.
+
+ - a "finish" command, as the observer will be called in
+ finish_command_continuation, so it can include the inferior
+ function's return value.
+
+ - calling an inferior function, as we pretend we inferior didn't
+ run at all. The return value of the call is handled by the
+ expression evaluator, through call_function_by_hand. */
+
+ if (!target_has_execution
+ || last.kind == TARGET_WAITKIND_SIGNALLED
+ || last.kind == TARGET_WAITKIND_EXITED
+ || (!inferior_thread ()->step_multi
+ && !(inferior_thread ()->stop_bpstat
+ && inferior_thread ()->proceed_to_finish)))
{
if (!ptid_equal (inferior_ptid, null_ptid))
observer_notify_normal_stop (inferior_thread ()->stop_bpstat,