1999-10-06 01:13:56 +02:00
|
|
|
/* Handling of inferior events for the event loop for GDB, the GNU debugger.
|
2015-01-01 10:32:14 +01:00
|
|
|
Copyright (C) 1999-2015 Free Software Foundation, Inc.
|
1999-10-06 01:13:56 +02:00
|
|
|
Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-08-23 20:08:50 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-10-06 01:13:56 +02:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2011-01-09 04:08:57 +01:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-10-06 01:13:56 +02:00
|
|
|
|
|
|
|
#include "defs.h"
|
Add new infrun.h header.
Move infrun.c declarations out of inferior.h to a new infrun.h file.
Tested by building on:
i686-w64-mingw32, enable-targets=all
x86_64-linux, enable-targets=all
i586-pc-msdosdjgpp
And also grepped the whole tree for each symbol moved to find where
infrun.h might be necessary.
gdb/
2014-05-22 Pedro Alves <palves@redhat.com>
* inferior.h (debug_infrun, debug_displaced, stop_on_solib_events)
(sync_execution, sched_multi, step_stop_if_no_debug, non_stop)
(disable_randomization, enum exec_direction_kind)
(execution_direction, stop_registers, start_remote)
(clear_proceed_status, proceed, resume, user_visible_resume_ptid)
(wait_for_inferior, normal_stop, get_last_target_status)
(prepare_for_detach, fetch_inferior_event, init_wait_for_inferior)
(insert_step_resume_breakpoint_at_sal)
(follow_inferior_reset_breakpoints, stepping_past_instruction_at)
(set_step_info, print_stop_event, signal_stop_state)
(signal_print_state, signal_pass_state, signal_stop_update)
(signal_print_update, signal_pass_update)
(update_signals_program_target, clear_exit_convenience_vars)
(displaced_step_dump_bytes, update_observer_mode)
(signal_catch_update, gdb_signal_from_command): Move
declarations ...
* infrun.h: ... to this new file.
* amd64-tdep.c: Include infrun.h.
* annotate.c: Include infrun.h.
* arch-utils.c: Include infrun.h.
* arm-linux-tdep.c: Include infrun.h.
* arm-tdep.c: Include infrun.h.
* break-catch-sig.c: Include infrun.h.
* breakpoint.c: Include infrun.h.
* common/agent.c: Include infrun.h instead of inferior.h.
* corelow.c: Include infrun.h.
* event-top.c: Include infrun.h.
* go32-nat.c: Include infrun.h.
* i386-tdep.c: Include infrun.h.
* inf-loop.c: Include infrun.h.
* infcall.c: Include infrun.h.
* infcmd.c: Include infrun.h.
* infrun.c: Include infrun.h.
* linux-fork.c: Include infrun.h.
* linux-nat.c: Include infrun.h.
* linux-thread-db.c: Include infrun.h.
* monitor.c: Include infrun.h.
* nto-tdep.c: Include infrun.h.
* procfs.c: Include infrun.h.
* record-btrace.c: Include infrun.h.
* record-full.c: Include infrun.h.
* remote-m32r-sdi.c: Include infrun.h.
* remote-mips.c: Include infrun.h.
* remote-notif.c: Include infrun.h.
* remote-sim.c: Include infrun.h.
* remote.c: Include infrun.h.
* reverse.c: Include infrun.h.
* rs6000-tdep.c: Include infrun.h.
* s390-linux-tdep.c: Include infrun.h.
* solib-irix.c: Include infrun.h.
* solib-osf.c: Include infrun.h.
* solib-svr4.c: Include infrun.h.
* target.c: Include infrun.h.
* top.c: Include infrun.h.
* windows-nat.c: Include infrun.h.
* mi/mi-interp.c: Include infrun.h.
* mi/mi-main.c: Include infrun.h.
* python/py-threadevent.c: Include infrun.h.
2014-05-22 13:29:11 +02:00
|
|
|
#include "inferior.h"
|
|
|
|
#include "infrun.h"
|
2011-01-09 04:08:57 +01:00
|
|
|
#include "target.h" /* For enum inferior_event_type. */
|
1999-10-06 01:13:56 +02:00
|
|
|
#include "event-loop.h"
|
|
|
|
#include "event-top.h"
|
|
|
|
#include "inf-loop.h"
|
2008-03-14 16:14:49 +01:00
|
|
|
#include "remote.h"
|
2008-03-14 19:57:44 +01:00
|
|
|
#include "language.h"
|
2008-07-10 00:16:15 +02:00
|
|
|
#include "gdbthread.h"
|
2011-05-27 Pedro Alves <pedro@codesourcery.com>
* defs.h (struct continuation, continuation_ftype)
(continuation_free_arg_ftype, add_continuation)
(do_all_continuations, do_all_continuations_thread)
(discard_all_continuations, discard_all_continuations_thread)
(add_intermediate_continuation, do_all_intermediate_continuations)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations)
(discard_all_intermediate_continuations_thread)
(add_inferior_continuation, do_all_inferior_continuations)
(discard_all_inferior_continuations): Move to ...
* continuations.h: ... this new file.
* breakpoint.c, continuations.c, event-top.c, inf-loop.c,
infcmd.c, inferior.c, infrun.c, interps.c: Include
continuations.h.
2011-05-27 20:28:18 +02:00
|
|
|
#include "continuations.h"
|
2011-09-02 18:56:30 +02:00
|
|
|
#include "interps.h"
|
2011-12-16 21:29:28 +01:00
|
|
|
#include "top.h"
|
Make display_gdb_prompt CLI-only.
Enabling target-async by default will require implementing sync
execution on top of an async target, much like foreground command are
implemented on the CLI in async mode.
In order to do that, we will need better control of when to print the
MI prompt. Currently the interp->display_prompt_p hook is all we
have, and MI just always returns false, meaning, make
display_gdb_prompt a no-op. We'll need to be able to know to print
the MI prompt in some of the conditions that display_gdb_prompt is
called from the core, but not all.
This is all a litte twisted currently. As we can see,
display_gdb_prompt is really CLI specific, so make the console
interpreters (console/tui) themselves call it. To be able to do that,
and add a few different observers that the interpreters can use to
distinguish when or why the the prompt is being printed:
#1 - one called whenever a command is cancelled due to an error.
#2 - another for when a foreground command just finished.
In both cases, CLI wants to print the prompt, while MI doesn't.
MI will want to print the prompt in the second case when in a special
MI mode.
The display_gdb_prompt call in interp_set made me pause. The comment
there reads:
/* Finally, put up the new prompt to show that we are indeed here.
Also, display_gdb_prompt for the console does some readline magic
which is needed for the console interpreter, at least... */
But, that looks very much like a no-op to me currently:
- the MI interpreter always return false in the prompt hook, meaning
actually display no prompt.
- the interpreter used at that point is still quiet. And the
console/tui interpreters return false in the prompt hook if they're
quiet, meaning actually display no prompt.
The only remaining possible use would then be the readline magic. But
whatever that might have been, it's not reacheable today either,
because display_gdb_prompt returns early, before touching readline if
the interpreter returns false in the display_prompt_p hook.
Tested on x86_64 Fedora 20, sync and async modes.
gdb/
2014-05-29 Pedro Alves <palves@redhat.com>
* cli/cli-interp.c (cli_interpreter_display_prompt_p): Delete.
(_initialize_cli_interp): Adjust.
* event-loop.c: Include "observer.h".
(start_event_loop): Notify 'command_error' observers instead of
calling display_gdb_prompt. Remove FIXME comment.
* event-top.c (display_gdb_prompt): Remove call into the
interpreters.
* inf-loop.c: Include "observer.h".
(inferior_event_handler): Notify 'command_error' observers instead
of calling display_gdb_prompt.
* infrun.c (fetch_inferior_event): Notify 'sync_execution_done'
observers instead of calling display_gdb_prompt.
* interps.c (interp_set): Don't call display_gdb_prompt.
(current_interp_display_prompt_p): Delete.
* interps.h (interp_prompt_p): Delete declaration.
(interp_prompt_p_ftype): Delete.
(struct interp_procs) <prompt_proc_p>: Delete field.
(current_interp_display_prompt_p): Delete declaration.
* mi-interp.c (mi_interpreter_prompt_p): Delete.
(_initialize_mi_interp): Adjust.
* tui-interp.c (tui_init): Install 'sync_execution_done' and
'command_error' observers.
(tui_on_sync_execution_done, tui_on_command_error): New
functions.
(tui_display_prompt_p): Delete.
(_initialize_tui_interp): Adjust.
gdb/doc/
2014-05-29 Pedro Alves <palves@redhat.com>
* observer.texi (sync_execution_done, command_error): New
subjects.
2014-05-23 12:37:12 +02:00
|
|
|
#include "observer.h"
|
1999-10-06 01:13:56 +02:00
|
|
|
|
2011-01-09 04:08:57 +01:00
|
|
|
/* General function to handle events in the inferior. So far it just
|
1999-10-06 01:13:56 +02:00
|
|
|
takes care of detecting errors reported by select() or poll(),
|
|
|
|
otherwise it assumes that all is OK, and goes on reading data from
|
2011-01-09 04:08:57 +01:00
|
|
|
the fd. This however may not always be what we want to do. */
|
1999-10-06 01:13:56 +02:00
|
|
|
void
|
|
|
|
inferior_event_handler (enum inferior_event_type event_type,
|
|
|
|
gdb_client_data client_data)
|
|
|
|
{
|
2011-08-26 23:45:24 +02:00
|
|
|
struct cleanup *cleanup_if_error = make_bpstat_clear_actions_cleanup ();
|
2010-05-14 23:25:51 +02:00
|
|
|
|
1999-10-06 01:13:56 +02:00
|
|
|
switch (event_type)
|
|
|
|
{
|
|
|
|
case INF_REG_EVENT:
|
2014-07-14 20:55:32 +02:00
|
|
|
/* Catch errors for now, until the inner layers of
|
1999-10-06 01:13:56 +02:00
|
|
|
fetch_inferior_event (i.e. readchar) can return meaningful
|
|
|
|
error status. If an error occurs while getting an event from
|
2011-05-30 20:04:32 +02:00
|
|
|
the target, just cancel the current command. */
|
2014-07-14 20:55:32 +02:00
|
|
|
{
|
|
|
|
volatile struct gdb_exception ex;
|
|
|
|
|
|
|
|
TRY_CATCH (ex, RETURN_MASK_ALL)
|
|
|
|
{
|
|
|
|
fetch_inferior_event (client_data);
|
|
|
|
}
|
|
|
|
if (ex.reason < 0)
|
|
|
|
{
|
|
|
|
bpstat_clear_actions ();
|
|
|
|
do_all_intermediate_continuations (1);
|
|
|
|
do_all_continuations (1);
|
|
|
|
|
|
|
|
throw_exception (ex);
|
|
|
|
}
|
|
|
|
}
|
1999-10-06 01:13:56 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case INF_EXEC_COMPLETE:
|
Non-stop inferior control.
* infrun.c (resume): In non-stop mode, always resume just one
thread.
(proceed): Don't call prepare_to_proceed in non-stop mode.
(fetch_inferior_event): In non-stop mode, switch context before
handling the event.
(error_is_running, ensure_not_running): New.
(handle_inferior_event): In non-stop mode: Mark only the event
thread as stopped. Require that the target module manages adding
threads to the thread list. Assert that there isn't a
deferred_step_ptid set. Don't switch to infwait_thread_hop_state.
(normal_stop): Only mark not-running if inferior hasn't exited.
In non-stop mode, only mark the event thread.
* thread.c:Include "cli/cli-decode.h".
(print_thread_info): Don't read from a running thread.
Output "(running)" if thread is running.
(switch_to_thread): Don't read stop_pc if thread is executing.
(do_restore_current_thread_cleanup): Don't write to a running
thread.
(thread_apply_all_command): Don't read from a running thread. In
non-stop mode, do a full context-switch instead of just switching
threads.
(thread_apply_command): In non-stop mode, do a full context-switch
instead of just switching threads.
(do_captured_thread_select): Likewise. Inform user if selected
thread is running.
(_initialize_thread): Mark "info threads" and "thread" and
async_ok.
* inf-loop.c (inferior_event_handler): In non-stop mode, don't
unregister the target from the event loop.
* infcmd.c (continue_command, step_1, jump_command)
(signal_command): Ensure the selected thread isn't running.
(interrupt_target_command): In non-stop mode, interrupt only the
selected thread.
* inferior.h (error_is_running, ensure_not_running): Declare.
* target.h (struct target_ops): Add ptid argument to the to_stop
member.
(target_stop): Add ptid_t argument.
* target.c (update_current_target): Add ptid argument to to_stop's
type.
(debug_to_stop): Add ptid_t argument.
(debug_to_rcmd): Set to_stop_ptid.
* remote.c (remote_stop): Add ptid_t argument.
(async_remote_interrupt): Add inferior_ptid to target_stop.
* inf-ptrace.c (inf_ptrace_stop): Add ptid argument.
* Makefile.in (thread.o): Depend on $(cli_decode_h).
2008-07-10 00:42:43 +02:00
|
|
|
if (!non_stop)
|
|
|
|
{
|
2011-01-09 04:08:57 +01:00
|
|
|
/* Unregister the inferior from the event loop. This is done
|
Non-stop inferior control.
* infrun.c (resume): In non-stop mode, always resume just one
thread.
(proceed): Don't call prepare_to_proceed in non-stop mode.
(fetch_inferior_event): In non-stop mode, switch context before
handling the event.
(error_is_running, ensure_not_running): New.
(handle_inferior_event): In non-stop mode: Mark only the event
thread as stopped. Require that the target module manages adding
threads to the thread list. Assert that there isn't a
deferred_step_ptid set. Don't switch to infwait_thread_hop_state.
(normal_stop): Only mark not-running if inferior hasn't exited.
In non-stop mode, only mark the event thread.
* thread.c:Include "cli/cli-decode.h".
(print_thread_info): Don't read from a running thread.
Output "(running)" if thread is running.
(switch_to_thread): Don't read stop_pc if thread is executing.
(do_restore_current_thread_cleanup): Don't write to a running
thread.
(thread_apply_all_command): Don't read from a running thread. In
non-stop mode, do a full context-switch instead of just switching
threads.
(thread_apply_command): In non-stop mode, do a full context-switch
instead of just switching threads.
(do_captured_thread_select): Likewise. Inform user if selected
thread is running.
(_initialize_thread): Mark "info threads" and "thread" and
async_ok.
* inf-loop.c (inferior_event_handler): In non-stop mode, don't
unregister the target from the event loop.
* infcmd.c (continue_command, step_1, jump_command)
(signal_command): Ensure the selected thread isn't running.
(interrupt_target_command): In non-stop mode, interrupt only the
selected thread.
* inferior.h (error_is_running, ensure_not_running): Declare.
* target.h (struct target_ops): Add ptid argument to the to_stop
member.
(target_stop): Add ptid_t argument.
* target.c (update_current_target): Add ptid argument to to_stop's
type.
(debug_to_stop): Add ptid_t argument.
(debug_to_rcmd): Set to_stop_ptid.
* remote.c (remote_stop): Add ptid_t argument.
(async_remote_interrupt): Add inferior_ptid to target_stop.
* inf-ptrace.c (inf_ptrace_stop): Add ptid argument.
* Makefile.in (thread.o): Depend on $(cli_decode_h).
2008-07-10 00:42:43 +02:00
|
|
|
so that when the inferior is not running we don't get
|
|
|
|
distracted by spurious inferior output. */
|
|
|
|
if (target_has_execution)
|
|
|
|
target_async (NULL, 0);
|
|
|
|
}
|
2008-03-14 19:57:44 +01:00
|
|
|
|
2008-11-05 21:23:07 +01:00
|
|
|
/* Do all continuations associated with the whole inferior (not
|
|
|
|
a particular thread). */
|
|
|
|
if (!ptid_equal (inferior_ptid, null_ptid))
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_inferior_continuations (0);
|
2008-11-05 21:23:07 +01:00
|
|
|
|
2008-04-17 13:49:56 +02:00
|
|
|
/* If we were doing a multi-step (eg: step n, next n), but it
|
|
|
|
got interrupted by a breakpoint, still do the pending
|
|
|
|
continuations. The continuation itself is responsible for
|
2008-05-06 20:49:19 +02:00
|
|
|
distinguishing the cases. The continuations are allowed to
|
|
|
|
touch the inferior memory, e.g. to remove breakpoints, so run
|
|
|
|
them before running breakpoint commands, which may resume the
|
|
|
|
target. */
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 23:57:42 +02:00
|
|
|
if (non_stop
|
|
|
|
&& target_has_execution
|
|
|
|
&& !ptid_equal (inferior_ptid, null_ptid))
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_intermediate_continuations_thread (inferior_thread (), 0);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 23:57:42 +02:00
|
|
|
else
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_intermediate_continuations (0);
|
2008-04-17 13:49:56 +02:00
|
|
|
|
2008-05-06 20:49:19 +02:00
|
|
|
/* Always finish the previous command before running any
|
|
|
|
breakpoint commands. Any stop cancels the previous command.
|
|
|
|
E.g. a "finish" or "step-n" command interrupted by an
|
|
|
|
unrelated breakpoint is canceled. */
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 23:57:42 +02:00
|
|
|
if (non_stop
|
|
|
|
&& target_has_execution
|
|
|
|
&& !ptid_equal (inferior_ptid, null_ptid))
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_continuations_thread (inferior_thread (), 0);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 23:57:42 +02:00
|
|
|
else
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_continuations (0);
|
2008-03-14 19:57:44 +01:00
|
|
|
|
2011-09-02 18:56:30 +02:00
|
|
|
/* When running a command list (from a user command, say), these
|
|
|
|
are only run when the command list is all done. */
|
|
|
|
if (interpreter_async)
|
2008-03-14 19:57:44 +01:00
|
|
|
{
|
2011-09-02 18:56:30 +02:00
|
|
|
volatile struct gdb_exception e;
|
|
|
|
|
2011-12-16 21:29:28 +01:00
|
|
|
check_frame_language_change ();
|
2011-09-02 18:56:30 +02:00
|
|
|
|
|
|
|
/* Don't propagate breakpoint commands errors. Either we're
|
|
|
|
stopping or some command resumes the inferior. The user will
|
|
|
|
be informed. */
|
|
|
|
TRY_CATCH (e, RETURN_MASK_ALL)
|
|
|
|
{
|
|
|
|
bpstat_do_actions ();
|
|
|
|
}
|
|
|
|
exception_print (gdb_stderr, e);
|
2008-03-14 19:57:44 +01:00
|
|
|
}
|
1999-10-06 01:13:56 +02:00
|
|
|
break;
|
|
|
|
|
1999-12-07 04:56:43 +01:00
|
|
|
case INF_EXEC_CONTINUE:
|
|
|
|
/* Is there anything left to do for the command issued to
|
2011-01-09 04:08:57 +01:00
|
|
|
complete? */
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 23:57:42 +02:00
|
|
|
|
|
|
|
if (non_stop)
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_intermediate_continuations_thread (inferior_thread (), 0);
|
Remove global continuations in favour of a per-thread
continuations.
* gdbthread.h (struct thread_info): Add comments around
continuations and intermediate_continuations.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments.
* infrun.c (fetch_inferior_event): Only call normal_stop if
stop_soon is NO_STOP_QUIETLY.
(context_switch): Don't context-switch the continuations.
* thread.c (clear_thread_inferior_resources): Discard all
continuations of the thread we're clearing.
(save_infrun_state, load_infrun_state): Delete continuations and
intermediate_continuations arguments, and the code referencing
them.
* utils.c: Include "gdbthread.h".
(cmd_continuation, intermediate_continuation): Delete.
(add_continuation): Add thread_info* argument. Install the
continuation on it.
(restore_thread_cleanup): New.
(do_all_continuations_ptid, do_all_continuations_thread_callback):
New.
(do_all_continuations): Reimplement.
(discard_all_continuations_thread_callback,
discard_all_continuations_thread): New.
(discard_all_continuations): Reimplement.
(add_intermediate_continuation): Add thread_info* argument.
Install the continuation on it.
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread): New.
(do_all_intermediate_continuations): Reimplement.
(discard_all_intermediate_continuations_thread_callback): New.
(discard_all_intermediate_continuations_thread): New.
(discard_all_intermediate_continuations): Reimplement.
* breakpoint.c (until_break_command): Install the continuation on
the current thread.
* defs.h (cmd_continuation, intermediate_continuation): Delete.
(struct thread_info): Forward declare.
(add_continuation, add_intermediate_continuation): Add
thread_info* argument.
(do_all_continuations_thread, discard_all_continuations_thread)
(do_all_intermediate_continuations_thread)
(discard_all_intermediate_continuations_thread): Declare.
* inf-loop.c (inferior_event_handler): In non-stop only run
continuations on the thread that stopped. In all-stop, run
continuations on all threads.
* infcmd.c (step_once, finish_command): Adjust.
2008-09-08 23:57:42 +02:00
|
|
|
else
|
2011-05-30 20:04:32 +02:00
|
|
|
do_all_intermediate_continuations (0);
|
1999-12-07 04:56:43 +01:00
|
|
|
break;
|
|
|
|
|
1999-10-06 01:13:56 +02:00
|
|
|
case INF_TIMER:
|
|
|
|
default:
|
2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up some of printf_filtered and printf_unfiltered.
* ada-lang.c, annotate.c, arch-utils.c, breakpoint.c: Update.
* corelow.c, cp-namespace.c, cp-support.c, dcache.c: Update.
* demangle.c, dsrec.c, dwarf2read.c, dwarfread.c: Update.
* event-loop.c, event-top.c, exec.c, f-valprint.c: Update.
* gdbtypes.c, inf-loop.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcmd.c, inflow.c, infrun.c, inftarg.c, language.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, maint.c: Update.
* mdebugread.c, memattr.c, monitor.c, objc-lang.c: Update.
* ocd.c, osabi.c, printcmd.c, procfs.c, regcache.c: Update.
* remote.c, solib-som.c, solib.c, somsolib.c, source.c: Update.
* stack.c, symfile.c, symmisc.c, target.c, thread.c: Update.
* top.c, utils.c, valprint.c, value.c, cli/cli-cmds.c: Update.
* cli/cli-dump.c, cli/cli-logging.c, tui/tui-hooks.c: Update.
* tui/tui-regs.c, tui/tui-win.c: Update.
2005-02-12 01:39:24 +01:00
|
|
|
printf_unfiltered (_("Event type not recognized.\n"));
|
1999-10-06 01:13:56 +02:00
|
|
|
break;
|
|
|
|
}
|
2011-08-26 23:45:24 +02:00
|
|
|
|
|
|
|
discard_cleanups (cleanup_if_error);
|
1999-10-06 01:13:56 +02:00
|
|
|
}
|