From 41d2bdb467371e3a18ff8eb69859b1d7cb56a2bd Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 22 Mar 2009 17:57:11 +0000 Subject: * 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. --- gdb/infrun.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'gdb/infrun.c') diff --git a/gdb/infrun.c b/gdb/infrun.c index d774e32..8466ed6 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, -- cgit v1.1