From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sOVKH0fD2mNqcycAWB0awg (envelope-from ) for ; Wed, 01 Feb 2023 14:53:43 -0500 Received: by simark.ca (Postfix, from userid 112) id 75B431E128; Wed, 1 Feb 2023 14:53:43 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=pQp/CazN; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 2B4321E112 for ; Wed, 1 Feb 2023 14:53:43 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D02FE3858404 for ; Wed, 1 Feb 2023 19:53:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D02FE3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675281222; bh=CTT+QRVkFUo34edP/V1iK0Cyh9BP9mWvtYKagXPsOYw=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=pQp/CazN/xnA3f2sq4yKu3IWRJRufLklQCWnve6w0KS8HSCTciRD7H6sXLV10LkEe OpecB1X7HoGaTFrkZYVlCbn4l/ujO4qGaVlbh83TMS+aoK3A0A+VAzKYJlk3aXb+G4 fwOP8Isdmcl8hu2PKG/SMkDMLW4WKXjn+er9LBdA= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id BF1773858D37 for ; Wed, 1 Feb 2023 19:53:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF1773858D37 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 4B6ED1E112; Wed, 1 Feb 2023 14:53:23 -0500 (EST) Message-ID: <4d0e7fbe-0530-d718-1fd5-a7dba5d1ccf7@simark.ca> Date: Wed, 1 Feb 2023 14:53:22 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 2/8] gdbserver: Add PID parameter to linux_get_auxv and linux_get_hwcap Content-Language: en-US To: Thiago Jung Bauermann , Simon Marchi Cc: Andrew Burgess , Thiago Jung Bauermann via Gdb-patches References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-3-thiago.bauermann@linaro.org> <87sffpu04g.fsf@redhat.com> <87lelhkwo7.fsf@linaro.org> In-Reply-To: <87lelhkwo7.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2/1/23 14:33, Thiago Jung Bauermann via Gdb-patches wrote: > > Simon Marchi writes: > >>>> @@ -946,17 +946,16 @@ extern int have_ptrace_getregset; >>>> *VALP and return 1. If not found or if there is an error, return >>>> 0. */ >>>> >>>> -int linux_get_auxv (int wordsize, CORE_ADDR match, >>>> - CORE_ADDR *valp); >>>> +int linux_get_auxv (int pid, int wordsize, CORE_ADDR match, CORE_ADDR *valp); >>>> >>>> /* Fetch the AT_HWCAP entry from the auxv vector, where entries are length >>>> WORDSIZE. If no entry was found, return zero. */ >>>> >>>> -CORE_ADDR linux_get_hwcap (int wordsize); >>>> +CORE_ADDR linux_get_hwcap (int pid, int wordsize); >>>> >>>> /* Fetch the AT_HWCAP2 entry from the auxv vector, where entries are length >>>> WORDSIZE. If no entry was found, return zero. */ >>>> >>>> -CORE_ADDR linux_get_hwcap2 (int wordsize); >>>> +CORE_ADDR linux_get_hwcap2 (int pid, int wordsize); >>> >>> Ideally the comment for these three functions would be updated to >>> mention the PID argument. > > This is how I changed the comments. What do you think? > > diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h > index 221de85aa2ee..4f95a27808ba 100644 > --- a/gdbserver/linux-low.h > +++ b/gdbserver/linux-low.h > @@ -941,20 +941,19 @@ bool thread_db_thread_handle (ptid_t ptid, gdb_byte **handle, int *handle_len); > > extern int have_ptrace_getregset; > > -/* Search for the value with type MATCH in the auxv vector with > - entries of length WORDSIZE bytes. If found, store the value in > - *VALP and return 1. If not found or if there is an error, return > - 0. */ > +/* Search for the value with type MATCH in the auxv vector, with entries of > + length WORDSIZE bytes, of process with PID. If found, store the value "of process with PID" sounds weird, syntactically. I would say "of process with pid PID" (same in the other comments). Otherwise, this is OK. Simon