{
/* If we get a request for running in the bg but the target
doesn't support it, error out. */
- if (background && !target->can_async_p ())
+ if (background && !target_can_async_p (target))
error (_("Asynchronous execution not supported on this target."));
if (!background)
{
const char *run_cmd = start_p ? "start" : "run";
struct target_ops *run_target = find_run_target ();
- int async_p = mi_async && run_target->can_async_p ();
+ int async_p = mi_async && target_can_async_p (run_target);
if (inf->pid != 0)
{
{
const char *run_cmd = start_p ? "start" : "run";
struct target_ops *run_target = find_run_target ();
- int async_p = mi_async && run_target->can_async_p ();
+ int async_p = mi_async && target_can_async_p (run_target);
mi_execute_cli_command (run_cmd, async_p,
async_p ? "&" : NULL);
bool
target_can_async_p ()
{
- return current_inferior ()->top_target ()->can_async_p ();
+ return target_can_async_p (current_inferior ()->top_target ());
+}
+
+/* See target.h. */
+
+bool
+target_can_async_p (struct target_ops *target)
+{
+ return target->can_async_p ();
}
/* See target.h. */
gdb_assert (!proc_target->commit_resumed_state);
- if (!target->can_async_p ())
+ if (!target_can_async_p (target))
gdb_assert ((options & TARGET_WNOHANG) == 0);
return target->wait (ptid, status, options);
/* Can the target support asynchronous execution? */
extern bool target_can_async_p ();
+/* An overload of the above that can be called when the target is not yet
+ pushed, this calls TARGET::can_async_p directly. */
+extern bool target_can_async_p (struct target_ops *target);
+
/* Is the target in asynchronous execution mode? */
extern bool target_is_async_p ();