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 BFC76387605F for ; Thu, 19 Mar 2020 13:22:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BFC76387605F 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 348D81E5F8; Thu, 19 Mar 2020 09:22:01 -0400 (EDT) Subject: Re: [PATCH] Avoid get_ptrace_pid() usage on NetBSD in x86-bsd-nat.c To: Kamil Rytarowski , gdb-patches@sourceware.org References: <20200318161328.24088-1-n54@gmx.com> <6b3250d6-027d-46c7-2884-569d9a0aaa13@simark.ca> <3048d145-21f9-161c-f6fd-7214c7b13a48@gmx.com> From: Simon Marchi Message-ID: <5b1b7e0a-3683-5e2b-a07f-9bf89817b4a2@simark.ca> Date: Thu, 19 Mar 2020 09:22:00 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <3048d145-21f9-161c-f6fd-7214c7b13a48@gmx.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS 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, 19 Mar 2020 13:22:03 -0000 On 2020-03-19 8:47 a.m., Kamil Rytarowski wrote: > This is a good idea.. however it is intrusive now and requires patching > code shared with windows, linux, darwin, ... > > I prefer to leave it for refactoring in future. I don't have environment > to test other Operating Systems than NetBSD. Hmm no, the callers of x86bsd_dr_set are only in this file (x86bsd_dr_set_control and x86bsd_dr_set_addr). They would now look like this: static void x86bsd_dr_set_control (unsigned long control) { x86bsd_dr_set (inferior_ptid, 7, control); } static void x86bsd_dr_set_addr (int regnum, CORE_ADDR addr) { gdb_assert (regnum >= 0 && regnum <= 4); x86bsd_dr_set (inferior_ptid, regnum, addr); } Adding a ptid parameter to x86bsd_dr_set_control and x86bsd_dr_set_addr would be the next logical step, but that indeed would be a more intrusive change, so I don't suggest doing that right now. Simon