aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-02-03 16:07:53 +0100
committerPedro Alves <palves@redhat.com>2015-02-03 16:07:53 +0100
commitd9d41e786a077db1b536b1124af6e135b9ad46a0 (patch)
tree1eb216b087ea45fdaf784700d4f6e04e5aa25558 /gdb/linux-nat.c
parent64d2901806c171c0d949f8fb1b29b4e5ba8cf04d (diff)
downloadgdb-d9d41e786a077db1b536b1124af6e135b9ad46a0.zip
gdb-d9d41e786a077db1b536b1124af6e135b9ad46a0.tar.gz
gdb-d9d41e786a077db1b536b1124af6e135b9ad46a0.tar.bz2
Fix up some target is-async vs can-async confusions
In all these cases we're interested in whether the target is currently async, with its event sources installed in the event loop, not whether it can async if needed. Also, I'm not seeing the point of the target_async call from within linux_nat_wait. That's normally done on resume instead, which this target already does. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2015-02-03 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_child_follow_fork, linux_nat_wait_1): Use target_is_async_p instead of target_can_async. (linux_nat_wait): Use target_is_async_p instead of target_can_async. Don't enable async here. * remote.c (interrupt_query, remote_wait, putpkt_binary): Use target_is_async_p instead of target_can_async.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index b49cd57..b4893d44 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -520,7 +520,7 @@ linux_child_follow_fork (struct target_ops *ops, int follow_child,
/* If we're in async mode, need to tell the event loop
there's something here to process. */
- if (target_can_async_p ())
+ if (target_is_async_p ())
async_file_mark ();
}
}
@@ -3222,7 +3222,7 @@ linux_nat_wait_1 (struct target_ops *ops,
target_pid_to_str (lp->ptid));
}
- if (!target_can_async_p ())
+ if (!target_is_async_p ())
{
/* Causes SIGINT to be passed on to the attached process. */
set_sigint_trap ();
@@ -3293,7 +3293,7 @@ linux_nat_wait_1 (struct target_ops *ops,
ourstatus->kind = TARGET_WAITKIND_NO_RESUMED;
- if (!target_can_async_p ())
+ if (!target_is_async_p ())
clear_sigint_trap ();
restore_child_signals_mask (&prev_mask);
@@ -3321,7 +3321,7 @@ linux_nat_wait_1 (struct target_ops *ops,
sigsuspend (&suspend_mask);
}
- if (!target_can_async_p ())
+ if (!target_is_async_p ())
clear_sigint_trap ();
gdb_assert (lp);
@@ -3479,7 +3479,7 @@ linux_nat_wait (struct target_ops *ops,
}
/* Flush the async file first. */
- if (target_can_async_p ())
+ if (target_is_async_p ())
async_file_flush ();
/* Resume LWPs that are currently stopped without any pending status
@@ -3497,16 +3497,12 @@ linux_nat_wait (struct target_ops *ops,
/* If we requested any event, and something came out, assume there
may be more. If we requested a specific lwp or process, also
assume there may be more. */
- if (target_can_async_p ()
+ if (target_is_async_p ()
&& ((ourstatus->kind != TARGET_WAITKIND_IGNORE
&& ourstatus->kind != TARGET_WAITKIND_NO_RESUMED)
|| !ptid_equal (ptid, minus_one_ptid)))
async_file_mark ();
- /* Get ready for the next event. */
- if (target_can_async_p ())
- target_async (inferior_event_handler, 0);
-
return event_ptid;
}