public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Klaus Gerlicher <klaus.gerlicher@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/1] replace PBUFSIZ with a target op
Date: Tue, 19 Sep 2023 05:45:10 +0000	[thread overview]
Message-ID: <20230919054511.17998-1-klaus.gerlicher@intel.com> (raw)

From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com>

Hi all,

this is my first contribution.

PBUFSIZ is meant to define the size of the packet buffer for communication with a target. It needs to be at
least 2 * tdesc->registers_size + overhead.

This #define has been increased constantly to accomodate for targets with ever increasing register sizes and
this could therefore become a target-related setting.

The accompanying patch solves this by making this a target op that will be queried from the client on
startup. It will return the current PBUFSIZ as a default for targets not yet using the new target op. Going
forward it would be a good idea to upgrade each supported target with this mechanism, so constantly changing
the global PBUFSIZ define becomes unnecessary.

The patch was tested with the testsuite on Linux x86 and x86_64.

Regards
Klaus


Gerlicher, Klaus (1):
  gdb, gdbserver: replace PBUFSIZ with a target op

 gdb/remote.h             |  8 +++---
 gdb/target-delegates.c   | 31 +++++++++++++++++++++--
 gdb/target.h             |  7 ++++++
 gdbserver/hostio.cc      | 54 ++++++++++++++++++++++++----------------
 gdbserver/notif.cc       |  8 +++---
 gdbserver/server.cc      | 26 +++++++++++--------
 gdbserver/server.h       | 31 ++++++++++++++++-------
 gdbserver/target.cc      |  9 +++++++
 gdbserver/target.h       |  9 +++++++
 gdbserver/tdesc.cc       | 11 +++++---
 gdbserver/tracepoint.cc  |  4 +--
 gdbsupport/common-defs.h |  5 ++++
 12 files changed, 146 insertions(+), 57 deletions(-)

-- 
2.34.1

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-19  5:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19  5:45 Klaus Gerlicher [this message]
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
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=20230919054511.17998-1-klaus.gerlicher@intel.com \
    --to=klaus.gerlicher@intel.com \
    --cc=gdb-patches@sourceware.org \
    /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).