mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
55f6301ac0
This removes the object-like macro target_has_execution, replacing it with a function call. target_has_execution_current is also now handled by this function. gdb/ChangeLog 2020-09-28 Tom Tromey <tom@tromey.com> * inferior.h (class inferior) <has_execution>: Update. * windows-tdep.c (windows_solib_create_inferior_hook): Update. * valops.c (find_function_in_inferior) (value_allocate_space_in_inferior): Update. * top.c (kill_or_detach): Update. * target.c (target_preopen, set_target_permissions): Update. (target_has_execution_current): Remove. * sparc64-tdep.c (adi_examine_command, adi_assign_command): Update. * solib.c (update_solib_list, reload_shared_libraries): Update. * solib-svr4.c (svr4_solib_create_inferior_hook): Update. * solib-dsbt.c (enable_break): Update. * score-tdep.c (score7_fetch_inst): Update. * rs6000-nat.c (rs6000_nat_target::xfer_shared_libraries): Update. * remote.c (remote_target::start_remote) (remote_target::remote_check_symbols, remote_target::open_1) (remote_target::remote_detach_1, remote_target::verify_memory) (remote_target::xfer_partial, remote_target::read_description) (remote_target::get_min_fast_tracepoint_insn_len): Update. * record-full.c (record_full_open_1): Update. * record-btrace.c (record_btrace_target_open): Update. * objc-lang.c (lookup_objc_class, lookup_child_selector) (value_nsstring): Update. * linux-thread-db.c (add_thread_db_info) (thread_db_find_new_threads_silently, check_thread_db_callback) (try_thread_db_load_1, record_thread): Update. * linux-tdep.c (linux_info_proc, linux_vsyscall_range_raw): Update. * linux-fork.c (checkpoint_command): Update. * infrun.c (set_non_stop, set_observer_mode) (check_multi_target_resumption, for_each_just_stopped_thread) (maybe_remove_breakpoints, normal_stop) (class infcall_suspend_state): Update. * infcmd.c (ERROR_NO_INFERIOR, kill_if_already_running) (info_program_command, attach_command): Update. * infcall.c (call_function_by_hand_dummy): Update. * inf-loop.c (inferior_event_handler): Update. * gcore.c (gcore_command, derive_heap_segment): Update. * exec.c (exec_file_command): Update. * eval.c (evaluate_subexp): Update. * compile/compile.c (compile_to_object): Update. * cli/cli-dump.c (restore_command): Update. * breakpoint.c (update_watchpoint) (update_inserted_breakpoint_locations) (insert_breakpoint_locations, get_bpstat_thread): Update. * target.h (target_has_execution): Remove macro. (target_has_execution_current): Don't declare. (target_has_execution): Rename from target_has_execution_1. Add argument default.
93 lines
2.8 KiB
C
93 lines
2.8 KiB
C
/* Handling of inferior events for the event loop for GDB, the GNU debugger.
|
|
Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
|
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
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(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
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#include "defs.h"
|
|
#include "inferior.h"
|
|
#include "infrun.h"
|
|
#include "gdbsupport/event-loop.h"
|
|
#include "event-top.h"
|
|
#include "inf-loop.h"
|
|
#include "remote.h"
|
|
#include "language.h"
|
|
#include "gdbthread.h"
|
|
#include "continuations.h"
|
|
#include "interps.h"
|
|
#include "top.h"
|
|
#include "observable.h"
|
|
|
|
/* General function to handle events in the inferior. */
|
|
|
|
void
|
|
inferior_event_handler (enum inferior_event_type event_type)
|
|
{
|
|
switch (event_type)
|
|
{
|
|
case INF_REG_EVENT:
|
|
fetch_inferior_event ();
|
|
break;
|
|
|
|
case INF_EXEC_COMPLETE:
|
|
if (!non_stop)
|
|
{
|
|
/* Unregister the inferior from the event loop. This is done
|
|
so that when the inferior is not running we don't get
|
|
distracted by spurious inferior output. */
|
|
if (target_has_execution () && target_can_async_p ())
|
|
target_async (0);
|
|
}
|
|
|
|
/* Do all continuations associated with the whole inferior (not
|
|
a particular thread). */
|
|
if (inferior_ptid != null_ptid)
|
|
do_all_inferior_continuations (0);
|
|
|
|
/* When running a command list (from a user command, say), these
|
|
are only run when the command list is all done. */
|
|
if (current_ui->async)
|
|
{
|
|
check_frame_language_change ();
|
|
|
|
/* Don't propagate breakpoint commands errors. Either we're
|
|
stopping or some command resumes the inferior. The user will
|
|
be informed. */
|
|
try
|
|
{
|
|
bpstat_do_actions ();
|
|
}
|
|
catch (const gdb_exception &e)
|
|
{
|
|
/* If the user was running a foreground execution
|
|
command, then propagate the error so that the prompt
|
|
can be reenabled. Otherwise, the user already has
|
|
the prompt and is typing some unrelated command, so
|
|
just inform the user and swallow the exception. */
|
|
if (current_ui->prompt_state == PROMPT_BLOCKED)
|
|
throw;
|
|
else
|
|
exception_print (gdb_stderr, e);
|
|
}
|
|
}
|
|
break;
|
|
|
|
default:
|
|
printf_unfiltered (_("Event type not recognized.\n"));
|
|
break;
|
|
}
|
|
}
|