From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 30CC7385DC1B for ; Thu, 16 Apr 2020 01:33:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 30CC7385DC1B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (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 83EA81E581; Wed, 15 Apr 2020 21:33:33 -0400 (EDT) Subject: Re: [PATCH 16/28] Don't write to inferior_ptid in darwin-nat.c To: Pedro Alves , gdb-patches@sourceware.org References: <20200414175434.8047-1-palves@redhat.com> <20200414175434.8047-17-palves@redhat.com> From: Simon Marchi Message-ID: Date: Wed, 15 Apr 2020 21:33:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200414175434.8047-17-palves@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-23.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_PASS, 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 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: Thu, 16 Apr 2020 01:33:35 -0000 On 2020-04-14 1:54 p.m., Pedro Alves via Gdb-patches wrote: > Untested. > > gdb/ChangeLog: > yyyy-mm-dd Pedro Alves > > * darwin-nat.c (darwin_nat_target::decode_message): Don't write to > inferior_ptid. > (darwin_nat_target::stop_inferior, darwin_nat_target::kill): Avoid > inferior_ptid. > (darwin_attach_pid): Use switch_to_no_thread instead of writing to > inferior_ptid directly. > (darwin_nat_target::init_thread_list): Switch to thread, instead > of writing to inferior_ptid. > (darwin_nat_target::attach): Don't write to inferior_ptid. > (darwin_nat_target::get_ada_task_ptid): Avoid inferior_ptid. > --- > gdb/darwin-nat.c | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) I tried to build it, here's a small patch to fix some typos. It would be good to check the other patches that you were not able to build for that pid_t/ptid_t typo. diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index aacd40ba6f..367db9c1fe 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1431,7 +1431,7 @@ darwin_nat_target::stop_inferior (inferior *inf) /* Wait until the process is really stopped. */ while (1) { - ptid = wait_1 (pid_t (inf->pid), &wstatus); + ptid = wait_1 (ptid_t (inf->pid), &wstatus); if (wstatus.kind == TARGET_WAITKIND_STOPPED && wstatus.value.sig == GDB_SIGNAL_STOP) break; @@ -1556,13 +1556,13 @@ darwin_nat_target::kill () darwin_resume_inferior (inf); - ptid = wait_1 (pid_t (inf->pid), &wstatus); + ptid = wait_1 (ptid_t (inf->pid), &wstatus); } else if (errno != ESRCH) warning (_("Failed to kill inferior: kill (%d, 9) returned [%s]"), inf->pid, safe_strerror (errno)); - target_mourn_inferior (pid_t (inf->pid)); + target_mourn_inferior (ptid_t (inf->pid)); } static void