mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-01 18:32:32 +08:00
* 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.
This commit is contained in:
@ -1,3 +1,18 @@
|
|||||||
|
2009-03-22 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2009-03-22 Pedro Alves <pedro@codesourcery.com>
|
2009-03-22 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
* symfile.c (symfile_relocate_debug_section): Remove check for
|
* symfile.c (symfile_relocate_debug_section): Remove check for
|
||||||
|
@ -331,7 +331,6 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc)
|
|||||||
volatile struct gdb_exception e;
|
volatile struct gdb_exception e;
|
||||||
int saved_async = 0;
|
int saved_async = 0;
|
||||||
int saved_suppress_resume_observer = suppress_resume_observer;
|
int saved_suppress_resume_observer = suppress_resume_observer;
|
||||||
int saved_suppress_stop_observer = suppress_stop_observer;
|
|
||||||
ptid_t call_thread_ptid = call_thread->ptid;
|
ptid_t call_thread_ptid = call_thread->ptid;
|
||||||
char *saved_target_shortname = xstrdup (target_shortname);
|
char *saved_target_shortname = xstrdup (target_shortname);
|
||||||
|
|
||||||
@ -344,7 +343,6 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc)
|
|||||||
saved_async = target_async_mask (0);
|
saved_async = target_async_mask (0);
|
||||||
|
|
||||||
suppress_resume_observer = 1;
|
suppress_resume_observer = 1;
|
||||||
suppress_stop_observer = 1;
|
|
||||||
|
|
||||||
TRY_CATCH (e, RETURN_MASK_ALL)
|
TRY_CATCH (e, RETURN_MASK_ALL)
|
||||||
proceed (real_pc, TARGET_SIGNAL_0, 0);
|
proceed (real_pc, TARGET_SIGNAL_0, 0);
|
||||||
@ -355,7 +353,6 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc)
|
|||||||
call_thread = NULL;
|
call_thread = NULL;
|
||||||
|
|
||||||
suppress_resume_observer = saved_suppress_resume_observer;
|
suppress_resume_observer = saved_suppress_resume_observer;
|
||||||
suppress_stop_observer = saved_suppress_stop_observer;
|
|
||||||
|
|
||||||
/* Don't restore the async mask if the target has changed,
|
/* Don't restore the async mask if the target has changed,
|
||||||
saved_async is for the original target. */
|
saved_async is for the original target. */
|
||||||
|
22
gdb/infcmd.c
22
gdb/infcmd.c
@ -169,8 +169,6 @@ struct gdb_environ *inferior_environ;
|
|||||||
|
|
||||||
/* When set, no calls to target_resumed observer will be made. */
|
/* When set, no calls to target_resumed observer will be made. */
|
||||||
int suppress_resume_observer = 0;
|
int suppress_resume_observer = 0;
|
||||||
/* When set, normal_stop will not call the normal_stop observer. */
|
|
||||||
int suppress_stop_observer = 0;
|
|
||||||
|
|
||||||
/* Accessor routines. */
|
/* Accessor routines. */
|
||||||
|
|
||||||
@ -1346,13 +1344,16 @@ static void
|
|||||||
finish_command_continuation (void *arg)
|
finish_command_continuation (void *arg)
|
||||||
{
|
{
|
||||||
struct finish_command_continuation_args *a = arg;
|
struct finish_command_continuation_args *a = arg;
|
||||||
|
struct thread_info *tp = NULL;
|
||||||
bpstat bs = NULL;
|
bpstat bs = NULL;
|
||||||
|
|
||||||
if (!ptid_equal (inferior_ptid, null_ptid)
|
if (!ptid_equal (inferior_ptid, null_ptid)
|
||||||
&& target_has_execution
|
&& target_has_execution
|
||||||
&& is_stopped (inferior_ptid))
|
&& is_stopped (inferior_ptid))
|
||||||
bs = inferior_thread ()->stop_bpstat;
|
{
|
||||||
|
tp = inferior_thread ();
|
||||||
|
bs = tp->stop_bpstat;
|
||||||
|
}
|
||||||
|
|
||||||
if (bpstat_find_breakpoint (bs, a->breakpoint) != NULL
|
if (bpstat_find_breakpoint (bs, a->breakpoint) != NULL
|
||||||
&& a->function != NULL)
|
&& a->function != NULL)
|
||||||
@ -1369,22 +1370,15 @@ finish_command_continuation (void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We suppress normal call of normal_stop observer and do it here so
|
/* We suppress normal call of normal_stop observer and do it here so
|
||||||
that that *stopped notification includes the return value. */
|
that the *stopped notification includes the return value. */
|
||||||
/* NOTE: This is broken in non-stop mode. There is no guarantee the
|
if (bs != NULL && tp->proceed_to_finish)
|
||||||
next stop will be in the same thread that we started doing a
|
|
||||||
finish on. This suppressing (or some other replacement means)
|
|
||||||
should be a thread property. */
|
|
||||||
observer_notify_normal_stop (bs, 1 /* print frame */);
|
observer_notify_normal_stop (bs, 1 /* print frame */);
|
||||||
suppress_stop_observer = 0;
|
|
||||||
delete_breakpoint (a->breakpoint);
|
delete_breakpoint (a->breakpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finish_command_continuation_free_arg (void *arg)
|
finish_command_continuation_free_arg (void *arg)
|
||||||
{
|
{
|
||||||
/* NOTE: See finish_command_continuation. This would go away, if
|
|
||||||
this suppressing is made a thread property. */
|
|
||||||
suppress_stop_observer = 0;
|
|
||||||
xfree (arg);
|
xfree (arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1469,8 +1463,6 @@ finish_forward (struct symbol *function, struct frame_info *frame)
|
|||||||
old_chain = make_cleanup_delete_breakpoint (breakpoint);
|
old_chain = make_cleanup_delete_breakpoint (breakpoint);
|
||||||
|
|
||||||
tp->proceed_to_finish = 1; /* We want stop_registers, please... */
|
tp->proceed_to_finish = 1; /* We want stop_registers, please... */
|
||||||
make_cleanup_restore_integer (&suppress_stop_observer);
|
|
||||||
suppress_stop_observer = 1;
|
|
||||||
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
|
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
|
||||||
|
|
||||||
cargs = xmalloc (sizeof (*cargs));
|
cargs = xmalloc (sizeof (*cargs));
|
||||||
|
@ -368,10 +368,6 @@ extern int debug_displaced;
|
|||||||
void displaced_step_dump_bytes (struct ui_file *file,
|
void displaced_step_dump_bytes (struct ui_file *file,
|
||||||
const gdb_byte *buf, size_t len);
|
const gdb_byte *buf, size_t len);
|
||||||
|
|
||||||
|
|
||||||
/* When set, normal_stop will not call the normal_stop observer. */
|
|
||||||
extern int suppress_stop_observer;
|
|
||||||
|
|
||||||
/* When set, no calls to target_resumed observer will be made. */
|
/* When set, no calls to target_resumed observer will be made. */
|
||||||
extern int suppress_resume_observer;
|
extern int suppress_resume_observer;
|
||||||
|
|
||||||
|
24
gdb/infrun.c
24
gdb/infrun.c
@ -4433,11 +4433,25 @@ Further execution is probably impossible.\n"));
|
|||||||
|
|
||||||
done:
|
done:
|
||||||
annotate_stopped ();
|
annotate_stopped ();
|
||||||
if (!suppress_stop_observer
|
|
||||||
&& !(target_has_execution
|
/* Suppress the stop observer if we're in the middle of:
|
||||||
&& last.kind != TARGET_WAITKIND_SIGNALLED
|
|
||||||
&& last.kind != TARGET_WAITKIND_EXITED
|
- a step n (n > 1), as there still more steps to be done.
|
||||||
&& inferior_thread ()->step_multi))
|
|
||||||
|
- 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))
|
if (!ptid_equal (inferior_ptid, null_ptid))
|
||||||
observer_notify_normal_stop (inferior_thread ()->stop_bpstat,
|
observer_notify_normal_stop (inferior_thread ()->stop_bpstat,
|
||||||
|
Reference in New Issue
Block a user