From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by sourceware.org (Postfix) with ESMTPS id 8BCC23858D34 for ; Wed, 8 Jul 2020 18:40:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8BCC23858D34 Received: by mail-wm1-x344.google.com with SMTP id g75so4272494wme.5 for ; Wed, 08 Jul 2020 11:40:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=esOM6m5ZN8i/STTAcyZoBeu/S45FCGSlJM8gmg/1KL8=; b=sk1lXgIcRYPS/+BcHVO5TCDEUnVk53SotIWmTcGyHhHW1mm9RM/XCKQw+yjeUj/ITr oSfUDozua3s3KG1E99FL/M0tpLyv1LQhWKzSYqD5B4h5FijdZXLCOTfix9jY5uNAbIO6 dxCBNV8au+6rJN5wngKuzJQCwzNUlnkI6dlvU5+YQ9kcPXPShqBB0GWBIdB7vyfZAOLR lJzAs044EssPfBhoKzfEZl6ID5oNlR4GZJFaJzGlwEydg1u9qQG9IGp/O1sTbFSIVXeg RdSGEROS8EBVlVcBzerNsFmao2NRuEZ4eH9WkE5SHQzAHZLGm7F2QyBa1HHShtyDOKBA mCwg== X-Gm-Message-State: AOAM530OHdivX3eE9ESadPYuvGW2Cl0AMCdcJno7GgIebr0sWWoQbXOS pWFNTE7iPUruO8x1CeTtyMFvF3aPdTiR8fpZs7OAjg== X-Google-Smtp-Source: ABdhPJys1Eh9Ja1Z+IWOvLMu9aaBwsyrf7xQ/hREhDXx/kfB2bL6ECScLlN+Aa856Wg6C8BPHDC1AsRk40vNGn89ivQ= X-Received: by 2002:a05:600c:2116:: with SMTP id u22mr10375098wml.82.1594233652546; Wed, 08 Jul 2020 11:40:52 -0700 (PDT) MIME-Version: 1.0 References: <20200708004605.91238-1-jhb@FreeBSD.org> In-Reply-To: <20200708004605.91238-1-jhb@FreeBSD.org> From: Pedro Alves Date: Wed, 8 Jul 2020 19:40:35 +0100 Message-ID: Subject: Re: [PATCH] Don't compare the pid returned from wait() against inferior_ptid. To: John Baldwin Cc: Pedro Alves , GDB Patches X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jul 2020 18:40:55 -0000 My Internet is down today (and mobile data is crawling slow so no tethering, probably same root issue, as its the same provider), so reply via mobile it is. This is OK. A Qua, 8/07/2020, 01:54, John Baldwin escreveu: > inf_ptrace::wait() needs to discard termination events reported by > detached child processes. Previously it compared the returned pid > against the pid in inferior_ptid to determine if a termination event > should be discarded or reported. inferior_ptid is now null_ptid in > wait() target methods, so this was always failing and never reporting > exit events. Instead, report termination events whose pid matches any > inferior belonging to the current target. > > gdb/ChangeLog: > > * inf-ptrace.c (inf_ptrace_target::wait): Don't compare against > inferior_ptid. > --- > gdb/ChangeLog | 5 +++++ > gdb/inf-ptrace.c | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index c86d7e4647..d4cd0d014e 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,8 @@ > +2020-07-07 John Baldwin > + > + * inf-ptrace.c (inf_ptrace_target::wait): Don't compare against > + inferior_ptid. > + > 2020-07-06 Andrew Burgess > > PR python/22748 > diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c > index d25d226abb..ae0b0f7ff0 100644 > --- a/gdb/inf-ptrace.c > +++ b/gdb/inf-ptrace.c > @@ -347,7 +347,7 @@ inf_ptrace_target::wait (ptid_t ptid, struct > target_waitstatus *ourstatus, > } > > /* Ignore terminated detached child processes. */ > - if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ()) > + if (!WIFSTOPPED (status) && find_inferior_pid (this, pid) == > nullptr) > pid = -1; > } > while (pid == -1); > -- > 2.25.1 > >