diff options
author | Andrew Burgess <aburgess@redhat.com> | 2021-11-24 11:36:12 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2021-11-25 10:00:18 +0000 |
commit | fce6cd341b48a2589cb4520c7718c80cb0b27c80 (patch) | |
tree | 236e91b872a6a2a2753503bfd2d002365a8844d0 /gdb/remote.c | |
parent | 0c1e6e265b276542ccb3f392c3070c3dd9339303 (diff) | |
download | gdb-fce6cd341b48a2589cb4520c7718c80cb0b27c80.zip gdb-fce6cd341b48a2589cb4520c7718c80cb0b27c80.tar.gz gdb-fce6cd341b48a2589cb4520c7718c80cb0b27c80.tar.bz2 |
gdb: hoist target_async_permitted checks into target.c
This commit moves the target_async_permitted check out of each targets
::can_async_p method and into the target_can_async_p wrapper function.
I've left some asserts in the two ::can_async_p methods that I
changed, which will hopefully catch any direct calls to these methods
that might be added in the future.
There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 11 |
1 files changed, 4 insertions, 7 deletions
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); } |