aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/linux-nat.c8
-rw-r--r--gdb/remote.c11
-rw-r--r--gdb/target.c2
3 files changed, 11 insertions, 10 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index f8f7284..fbb60a3 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4088,9 +4088,11 @@ linux_nat_target::is_async_p ()
bool
linux_nat_target::can_async_p ()
{
- /* We're always async, unless the user explicitly prevented it with the
- "maint set target-async" command. */
- return target_async_permitted;
+ /* This flag should be checked in the common target.c code. */
+ gdb_assert (target_async_permitted);
+
+ /* Otherwise, this targets is always able to support async mode. */
+ return true;
}
bool
diff --git a/gdb/remote.c b/gdb/remote.c
index 724386e..6ecea5b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -14379,14 +14379,11 @@ remote_target::thread_info_to_thread_handle (struct thread_info *tp)
bool
remote_target::can_async_p ()
{
- struct remote_state *rs = get_remote_state ();
-
- /* We don't go async if the user has explicitly prevented it with the
- "maint set target-async" command. */
- if (!target_async_permitted)
- return false;
+ /* This flag should be checked in the common target.c code. */
+ gdb_assert (target_async_permitted);
- /* We're async whenever the serial device is. */
+ /* We're async whenever the serial device can. */
+ struct remote_state *rs = get_remote_state ();
return serial_can_async_p (rs->remote_desc);
}
diff --git a/gdb/target.c b/gdb/target.c
index 970e2a7..db1abcc 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -399,6 +399,8 @@ target_can_async_p ()
bool
target_can_async_p (struct target_ops *target)
{
+ if (!target_async_permitted)
+ return false;
return target->can_async_p ();
}