public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 1/1] gdb, gdbserver: replace PBUFSIZ with a target op
Date: Wed, 20 Sep 2023 06:21:31 +0000	[thread overview]
Message-ID: <SN7PR11MB7091B3135FA9D7A9AD408D20E8F9A@SN7PR11MB7091.namprd11.prod.outlook.com> (raw)
In-Reply-To: <3d0d3efc-f802-4a3a-a602-dc3e59c99c94@polymtl.ca>

Hi Simon,

Thanks for the quick response.

At least the initial buffer size needs to be fixed since now most clients aren't aware of any dynamic behavior here and therefore we need at least something pre-allocated for these clients.

For the clients interested we could change the CS buffer to a re-allocatable type that is pre-allocated with the current PBUFSIZ. We could pass this buffer around with a target op. The target could resize at will instead of letting it return a fixed number.

Is this something in line that you would support?

Klaus

-----Original Message-----
From: Simon Marchi <simon.marchi@polymtl.ca> 
Sent: Tuesday, September 19, 2023 4:08 PM
To: Gerlicher, Klaus <klaus.gerlicher@intel.com>; gdb-patches@sourceware.org
Subject: Re: [PATCH 1/1] gdb, gdbserver: replace PBUFSIZ with a target op

On 9/19/23 01:45, Klaus Gerlicher via Gdb-patches wrote:
> From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com>
> 
> 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
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2023-09-20  6:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  5:45 [PATCH 0/1] " Klaus Gerlicher
2023-09-19  5:45 ` [PATCH 1/1] gdb, gdbserver: " Klaus Gerlicher
2023-09-19 14:07   ` Simon Marchi
2023-09-20  6:21     ` Gerlicher, Klaus [this message]
2023-09-20 12:59       ` Andrew Burgess
2023-09-20 16:32         ` Pedro Alves
2023-09-21  6:02           ` Gerlicher, Klaus
2023-09-21 14:02             ` Andrew Burgess
2023-09-21 14:07             ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN7PR11MB7091B3135FA9D7A9AD408D20E8F9A@SN7PR11MB7091.namprd11.prod.outlook.com \
    --to=klaus.gerlicher@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).