This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4 6/7] Remote follow vfork
- From: Pedro Alves <palves at redhat dot com>
- To: Don Breazeal <donb at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Tue, 10 Feb 2015 16:39:17 +0000
- Subject: Re: [PATCH v4 6/7] Remote follow vfork
- Authentication-results: sourceware.org; auth=none
- References: <54C236B9 dot 8060200 at redhat dot com> <1422222420-25421-1-git-send-email-donb at codesourcery dot com> <1422222420-25421-7-git-send-email-donb at codesourcery dot com>
Hi Don,
No major comments here, other than what's been said in
previous patches. A couple remarks only.
On 01/25/2015 09:46 PM, Don Breazeal wrote:
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -1481,7 +1481,10 @@ remote_follow_fork (struct target_ops *target, int follow_child,
> pid_t child_pid;
>
> gdb_assert ((inferior_thread ()->pending_follow.kind
> - == TARGET_WAITKIND_FORKED));
> + == TARGET_WAITKIND_FORKED)
> + || (inferior_thread ()->pending_follow.kind
> + == TARGET_WAITKIND_VFORKED));
> +
Please use a temporary variable, something like:
kind = inferior_thread ()->pending_follow.kind
gdb_assert (kind == TARGET_WAITKIND_FORKED)
|| (kind == TARGET_WAITKIND_VFORKED));
Makes it easier to debug a core dump caused by this assert.
> child_ptid = inferior_thread ()->pending_follow.value.related_pid;
> child_pid = ptid_get_pid (child_ptid);
>
> @@ -4502,7 +4505,8 @@ remote_detach_1 (struct target_ops *ops, const char *args,
> {
> inferior_ptid = null_ptid;
> detach_inferior (pid);
> - inf_child_maybe_unpush_target (ops);
> + if (!extended)
> + inf_child_maybe_unpush_target (ops);
Hmm, I'm afraid I don't understand why is this part of this patch?
Thanks,
Pedro Alves