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 5CD343853D45 for ; Fri, 18 Nov 2022 16:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CD343853D45 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (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 C248B1E0CB; Fri, 18 Nov 2022 11:21:52 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1668788513; bh=oTyZ8Vq/iwlT2HluE1Zv+vSOXIk6ZbR7LF7557t0Fvo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IvlhRUnBcCB8CKL5afrZydfPN1kqewYU+wZmEZTc+3W77rOKOf+lYQOee59dnmLtn q0osyUP5tLKaiIk7R+DCZT1w08yKD7i2+/wEiz06nh9RYtE/UjMbaquVN0yNUPJrob txVj4smPfXi20jJVzKvbc8V0EC23S7j4Phz4ri3E= Message-ID: <063fea41-05e0-0e95-2d35-f277da5c2a71@simark.ca> Date: Fri, 18 Nov 2022 11:21:52 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH 6/8] gdbserver: use current_process in ps_getpid Content-Language: en-US To: Andrew Burgess , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20221117194241.1776125-1-simon.marchi@efficios.com> <20221117194241.1776125-7-simon.marchi@efficios.com> <87bkp48pjs.fsf@redhat.com> From: Simon Marchi In-Reply-To: <87bkp48pjs.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/18/22 06:33, Andrew Burgess via Gdb-patches wrote: > Simon Marchi via Gdb-patches writes: > >> The following patch ("gdbserver: switch to right process in >> find_one_thread") makes it so find_one_thread calls into libthread_db >> with a current process but no current thread. This tripped on ps_getpid >> using current_thread in order to get the process' pid. Get the pid from >> `current_process ()` instead, which removes the need to have a current >> thread. Eventually, it would be good to get it from the >> gdb_ps_prochandle_t structure, to avoid the need for a current process >> as well. > > LGTM. > > Reviewed-By: Andrew Burgess > > Thanks, > Andrew Thanks, pushed. Simon