This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] Merge async and sync code paths some more
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 18 Aug 2015 11:48:20 +0100
- Subject: Re: [PATCH 1/7] Merge async and sync code paths some more
- Authentication-results: sourceware.org; auth=none
- References: <1439398917-22761-1-git-send-email-palves at redhat dot com> <1439398917-22761-2-git-send-email-palves at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> + /* do only one step for now, before returning control to the event
s/do/Do
> + loop. Let the continuation figure out how many other steps we
> + need to do, and handle them one at the time, through
> + step_once. */
> diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
> index be7a915..fa8e5e3 100644
> --- a/gdb/linux-nat.c
> +++ b/gdb/linux-nat.c
> @@ -3442,12 +3442,6 @@ linux_nat_wait_1 (struct target_ops *ops,
> target_pid_to_str (lp->ptid));
> }
>
> - if (!target_is_async_p ())
> - {
> - /* Causes SIGINT to be passed on to the attached process. */
> - set_sigint_trap ();
> - }
> -
so SIGINT is handled by event-top.c:handle_sigint in event loop, right?
> /* But if we don't find a pending event, we'll have to wait. Always
> pull all events out of the kernel. We'll randomly select an
> event LWP out of all that have events, to prevent starvation. */
> @@ -3518,9 +3512,6 @@ linux_nat_wait_1 (struct target_ops *ops,
>
> ourstatus->kind = TARGET_WAITKIND_NO_RESUMED;
>
> - if (!target_is_async_p ())
> - clear_sigint_trap ();
> -
> restore_child_signals_mask (&prev_mask);
> return minus_one_ptid;
> }
> diff --git a/gdb/target.c b/gdb/target.c
> index e41a338..210cc70 100644
> --- a/gdb/target.c
> +++ b/gdb/target.c
> @@ -2229,6 +2229,17 @@ target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
> return (current_target.to_wait) (¤t_target, ptid, status, options);
> }
>
> +/* See target.h. */
> +
> +ptid_t
> +default_target_wait (ptid_t ptid,
> + struct target_waitstatus *status,
> + int options)
> +{
> + status->kind = TARGET_WAITKIND_NO_RESUMED;
> + return minus_one_ptid;
> +}
> +
> char *
> target_pid_to_str (ptid_t ptid)
> {
> diff --git a/gdb/target.h b/gdb/target.h
> index e283c86..48e6857 100644
> --- a/gdb/target.h
> +++ b/gdb/target.h
> @@ -471,7 +471,7 @@ struct target_ops
> ptid_t (*to_wait) (struct target_ops *,
> ptid_t, struct target_waitstatus *,
> int TARGET_DEBUG_PRINTER (target_debug_print_options))
> - TARGET_DEFAULT_NORETURN (noprocess ());
> + TARGET_DEFAULT_FUNC (default_to_wait);
s/default_to_wait/default_target_wait/ ?
Otherwise, the patch looks good to me.
--
Yao (éå)