This changes the parameter of target_ops::async from int to bool.
Regression tested on x86-64 Fedora 34.
/* Implement the "async" target method. */
void
-fbsd_nat_target::async (int enable)
+fbsd_nat_target::async (bool enable)
{
- if ((enable != 0) == is_async_p ())
+ if (enable == is_async_p ())
return;
/* Block SIGCHILD while we create/destroy the pipe, as the handler
bool can_async_p () override;
- void async (int) override;
+ void async (bool) override;
thread_control_capabilities get_thread_control_capabilities () override
{ return tc_schedlock; }
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);
+ target_async (false);
}
/* Do all continuations associated with the whole inferior (not
{
/* Unregister from the event loop. */
if (is_async_p ())
- async (0);
+ async (false);
inf_child_target::close ();
}
/* Enable async mode if it is supported by the target. */
if (target_can_async_p ())
- target_async (1);
+ target_async (true);
/* Set up the "saved terminal modes" of the inferior
based on what modes we are starting it with. */
if (target_can_async_p ())
{
- target_async (1);
+ target_async (true);
/* Tell the event loop we have an event to process. */
mark_async_event_handler (infrun_async_inferior_event_token);
}
{
/* If nothing is resumed, remove the target from the
event loop. */
- target_async (0);
+ target_async (false);
}
else if (event.ws.kind () != TARGET_WAITKIND_IGNORE)
return event;
if (target_can_async_p ())
{
- target_async (1);
+ target_async (true);
/* Tell the event loop we have something to process. */
async_file_mark ();
}
/* target_async implementation. */
void
-linux_nat_target::async (int enable)
+linux_nat_target::async (bool enable)
{
- if ((enable != 0) == is_async_p ())
+ if (enable == is_async_p ())
return;
/* Block child signals while we create/destroy the pipe, as their
bool supports_non_stop () override;
bool always_non_stop_p () override;
- void async (int) override;
+ void async (bool) override;
void stop (ptid_t) override;
strata stratum () const override { return record_stratum; }
void close () override;
- void async (int) override;
+ void async (bool) override;
void detach (inferior *inf, int from_tty) override
{ record_detach (this, inf, from_tty); }
/* The async method of target record-btrace. */
void
-record_btrace_target::async (int enable)
+record_btrace_target::async (bool enable)
{
if (enable)
mark_async_event_handler (record_btrace_async_inferior_event_handler);
/* Async support. */
if (target_can_async_p ())
{
- target_async (1);
+ target_async (true);
mark_async_event_handler (record_btrace_async_inferior_event_handler);
}
}
strata stratum () const override { return record_stratum; }
void close () override;
- void async (int) override;
+ void async (bool) override;
ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override;
bool stopped_by_watchpoint () override;
bool stopped_data_address (CORE_ADDR *) override;
/* "async" target method. */
void
-record_full_base_target::async (int enable)
+record_full_base_target::async (bool enable)
{
if (enable)
mark_async_event_handler (record_full_async_inferior_event_token);
bool is_async_p () override;
- void async (int) override;
+ void async (bool) override;
int async_wait_fd () override;
the poll in stop_all_threads to consider events from it, so enable
it temporarily. */
gdb_assert (!this->is_async_p ());
- SCOPE_EXIT { target_async (0); };
- target_async (1);
+ SCOPE_EXIT { target_async (false); };
+ target_async (true);
stop_all_threads ("remote connect in all-stop");
}
process_initial_stop_replies (from_tty);
if (target_can_async_p ())
- target_async (1);
+ target_async (true);
}
/* Give the target a chance to look up symbols. */
/* If running asynchronously, register the target file descriptor
with the event loop. */
if (target_can_async_p ())
- target_async (1);
+ target_async (true);
/* Disable address space randomization if requested (and supported). */
if (supports_disable_randomization ())
}
void
-remote_target::async (int enable)
+remote_target::async (bool enable)
{
struct remote_state *rs = get_remote_state ();
bool attach_no_wait () override;
bool can_async_p () override;
bool is_async_p () override;
- void async (int arg0) override;
+ void async (bool arg0) override;
int async_wait_fd () override;
bool has_pending_events () override;
void thread_events (int arg0) override;
bool attach_no_wait () override;
bool can_async_p () override;
bool is_async_p () override;
- void async (int arg0) override;
+ void async (bool arg0) override;
int async_wait_fd () override;
bool has_pending_events () override;
void thread_events (int arg0) override;
}
void
-target_ops::async (int arg0)
+target_ops::async (bool arg0)
{
this->beneath ()->async (arg0);
}
void
-dummy_target::async (int arg0)
+dummy_target::async (bool arg0)
{
tcomplain ();
}
void
-debug_target::async (int arg0)
+debug_target::async (bool arg0)
{
gdb_printf (gdb_stdlog, "-> %s->async (...)\n", this->beneath ()->shortname ());
this->beneath ()->async (arg0);
gdb_printf (gdb_stdlog, "<- %s->async (", this->beneath ()->shortname ());
- target_debug_print_int (arg0);
+ target_debug_print_bool (arg0);
gdb_puts (")\n", gdb_stdlog);
}
clear_inline_frame_state (curr_target, scope_ptid);
if (target_can_async_p ())
- target_async (1);
+ target_async (true);
}
/* See target.h. */
/* See target.h. */
void
-target_async (int enable)
+target_async (bool enable)
{
/* If we are trying to enable async mode then it must be the case that
async mode is possible for this target. */
TARGET_DEFAULT_RETURN (false);
virtual bool is_async_p ()
TARGET_DEFAULT_RETURN (false);
- virtual void async (int)
+ virtual void async (bool)
TARGET_DEFAULT_NORETURN (tcomplain ());
virtual int async_wait_fd ()
TARGET_DEFAULT_NORETURN (noprocess ());
extern bool target_is_async_p ();
/* Enables/disabled async target events. */
-extern void target_async (int enable);
+extern void target_async (bool enable);
/* Enables/disables thread create and exit events. */
extern void target_thread_events (int enable);
current_ui->secondary_prompt_depth++;
if (m_target_is_async_orig)
- target_async (0);
+ target_async (false);
}
~gdb_readline_wrapper_cleanup ()
saved_after_char_processing_hook = NULL;
if (m_target_is_async_orig)
- target_async (1);
+ target_async (true);
}
DISABLE_COPY_AND_ASSIGN (gdb_readline_wrapper_cleanup);