From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 2CC3C3858D39 for ; Tue, 19 Sep 2023 14:08:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CC3C3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 38JE7sIX013815 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 10:07:58 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 38JE7sIX013815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1695132479; bh=FPlzsZq6BrM2PlYRfBy9iwUmNYXHQ9GHuLB/FVV78Q4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=M3UxYMqGXZJfdh6/E8qzm/nmBF+z2RvLk80LpU6R876cDKnFTzZSjDnsQzFU0kHro jEXiDfyFo3l9vM33wD/DaiT4wbEe9pwp0F3FNfCSxyURCd3fhmG/MvMZZxXgyQTp18 mpumIyARrk0K0svsNVqkq4mR/uxoMpLxxEG1f21U= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CB1441E092; Tue, 19 Sep 2023 10:07:53 -0400 (EDT) Message-ID: <3d0d3efc-f802-4a3a-a602-dc3e59c99c94@polymtl.ca> Date: Tue, 19 Sep 2023 10:07:52 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] gdb, gdbserver: replace PBUFSIZ with a target op Content-Language: fr To: Klaus Gerlicher , gdb-patches@sourceware.org References: <20230919054511.17998-1-klaus.gerlicher@intel.com> <20230919054511.17998-2-klaus.gerlicher@intel.com> From: Simon Marchi In-Reply-To: <20230919054511.17998-2-klaus.gerlicher@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 19 Sep 2023 14:07:54 +0000 X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 9/19/23 01:45, Klaus Gerlicher via Gdb-patches wrote: > From: "Gerlicher, Klaus" > > PBUFSIZ is a hardcoded value that needs to be as least twice as big as > the register set. > > This means that this could be tailored to the target register size as > not all targets need a big buffer. For SIMD targets the buffer will > obviously be much bigger than for regular scalar targets. > > This patch changes this and adds a target op query_pbuf_size (). It also > moves the static global client_state into the get_client_state () > function and lazily dynamically allocates storage for its own_buf. Just throwing an idea out there... instead of trying to determine a buffer size that is large enough, can we instead pass something like an std::vector (gdb::char_vector or gdb::byte_vector) around, and whatever builds the packets and replies makes sure there is enough space? Simon