This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/8] Check LWP_SIGNAL_CAN_BE_DELIVERED for enqueue/dequeue pending signals
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 17 Mar 2016 11:07:41 +0000
- Subject: Re: [PATCH 2/8] Check LWP_SIGNAL_CAN_BE_DELIVERED for enqueue/dequeue pending signals
- Authentication-results: sourceware.org; auth=none
- References: <1457088276-1170-1-git-send-email-yao dot qi at linaro dot org> <1457088276-1170-3-git-send-email-yao dot qi at linaro dot org> <56E2A42E dot 4080308 at redhat dot com> <86a8lxxzsu dot fsf at gmail dot com>
On 03/17/2016 08:40 AM, Yao Qi wrote:
>
> Here is the version to change it to function and also update comments as
> Luis suggested.
Thanks.
+/* The signal can be delivered to the inferior if we are not trying to
+ reinsert a breakpoint and not trying to finish a fast tracepoint
+ collect. */
+
+static int
+lwp_signal_can_be_delivered (struct lwp_info *lwp)
+{
+ return !(lwp->bp_reinsert != 0 || lwp->collecting_fast_tracepoint);
The comment is written in terms of "and", but the implementation is in
terms of "or", negated.
If you write it like:
return (lwp->bp_reinsert == 0 && !lwp->collecting_fast_tracepoint);
then it matches exactly what the comment says, making it easier to
reason about.
Otherwise LGTM.
Thanks,
Pedro Alves