[0/1] replace PBUFSIZ with a target op

Message ID 20230919054511.17998-1-klaus.gerlicher@intel.com
Headers
Series replace PBUFSIZ with a target op |

Message

Klaus Gerlicher Sept. 19, 2023, 5:45 a.m. UTC
  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(-)