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 BF1773858D37 for ; Wed, 1 Feb 2023 19:53:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF1773858D37 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 4B6ED1E112; Wed, 1 Feb 2023 14:53:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1675281203; bh=oN6MrVEbRE6wybYajY5XrK+g0h07lvBI4mlslbW8b6M=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FRIjBVTeUqrN+Jtw/1ApVSw4vVvxhI3LyMCNzXv/7FwHUE9K5ixxGEnfv5nR8I3vx o0WJgbPC3KEcAk9Cu8aF0RgIIfy9/bYz6upsIZl9OIFYLDYeqeBeO16XKdzJXDjm/n jb1avokQHCnfeZWQ1l8cEAvpdtTNz1LEDDHtlhcU= 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> From: Simon Marchi In-Reply-To: <87lelhkwo7.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 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