From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by sourceware.org (Postfix) with ESMTP id CC3E93857C53 for ; Wed, 8 Jul 2020 00:54:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC3E93857C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=jhb@FreeBSD.org Received: from ralph.baldwin.net (unknown [71.198.231.75]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7579110B4CF; Tue, 7 Jul 2020 20:46:16 -0400 (EDT) From: John Baldwin To: Pedro Alves , gdb-patches@sourceware.org Subject: [PATCH] Don't compare the pid returned from wait() against inferior_ptid. Date: Tue, 7 Jul 2020 17:46:05 -0700 Message-Id: <20200708004605.91238-1-jhb@FreeBSD.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 07 Jul 2020 20:46:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, 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 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 00:54:31 -0000 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