From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7/5GHir3+mGEYwAAWB0awg (envelope-from ) for ; Wed, 02 Feb 2022 16:27:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 6274B1F3BA; Wed, 2 Feb 2022 16:27:06 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A31211ECEB for ; Wed, 2 Feb 2022 16:27:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8336B385801A for ; Wed, 2 Feb 2022 21:27:04 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 74A393858D37 for ; Wed, 2 Feb 2022 21:26:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 74A393858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id EA3351ECEB; Wed, 2 Feb 2022 16:26:52 -0500 (EST) Subject: Re: [PATCH] gdb: A potential fix for PR-24069 To: Siwei He References: <20220202193116.79655-1-siweihe.eng@gmail.com> From: Simon Marchi Message-ID: <4bf807c4-d78f-05a4-6cf5-4fa283bc7c1d@simark.ca> Date: Wed, 2 Feb 2022 16:26:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit 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: , Cc: Louis-He <1726110778@qq.com>, gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2022-02-02 4:01 p.m., Siwei He via Gdb-patches wrote: > Hi Simon, > > You are absolutely right. I am new to the community and I noticed that I > didn't merge two of my commits together in the patch file. I have already > merged them and included in the attachment in this email. I also uploaded > it to the bug report: > https://sourceware.org/bugzilla/attachment.cgi?id=13953 > > Best, > Louis Thanks, that makes more sense. I'd like if we could at least get some understanding of what's happening here and get an explanation in the commit message, otherwise it feels like just feels like throwing random things on the wall and seeing what sticks. Could you please provide the output of a GDB session running a trivial program, with both "set debug infrun 1" and "set debug darwin 12" (not a typo, the last one is really "12")? Then we can have an idea of the sequence of events. If you can get one where things work and one where things don't work, it would be even better, since it would allow us to compare. I'm trying to understand what the code you change does. It is in a scope that starts like this: else if (hdr->msgh_id == 0x48) { /* MACH_NOTIFY_DEAD_NAME: notification for exit. */ What does that mean, does it mean we have received some message / notification to tell us the inferior has exited? So what does it mean to then receive a WIFSTOPPED wait status for that pid? I think it would be useful do add a debug print just after the wait4 call above, to print (in hexadecimal) the wstatus value returned by wait4. Simon