aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-11-24 11:15:55 +0000
committerAndrew Burgess <aburgess@redhat.com>2021-11-25 09:54:58 +0000
commit0c1e6e265b276542ccb3f392c3070c3dd9339303 (patch)
tree3b45413e28d99ab95b068db30e0365c6c9ebc5ad /gdb/mi
parenteec685f8a6e1a654bb82b0f20134689861589866 (diff)
downloadgdb-0c1e6e265b276542ccb3f392c3070c3dd9339303.zip
gdb-0c1e6e265b276542ccb3f392c3070c3dd9339303.tar.gz
gdb-0c1e6e265b276542ccb3f392c3070c3dd9339303.tar.bz2
gdb: introduce a new overload of target_can_async_p
There are a few places where we call the target_ops::can_async_p member function directly, instead of using the target_can_async_p wrapper. In some of these places this is because we need to ask before the target has been pushed, and in another location (in target.c) it seems unnecessary to go through the wrapper when we are already in target.c code. However, in the next commit I'd like to hoist some common checks out of target specific code into target.c. To achieve this, in this commit, I introduce a new overload of target_can_async_p which takes a target_ops pointer, and calls the ::can_async_p method directly. I then make use of the new overload where appropriate. There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index e28fae0..311697b 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -408,7 +408,7 @@ run_one_inferior (inferior *inf, bool start_p)
{
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)
{
@@ -473,7 +473,7 @@ mi_cmd_exec_run (const char *command, char **argv, int argc)
{
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);