From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id 5B8C43858D32 for ; Tue, 19 Sep 2023 05:45:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B8C43858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695102326; x=1726638326; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=ZjlZefWyZXSQ6smex8U1TWf+v3/jsgT6WKlxaC3eK2Q=; b=b5GY17qWNqYm6/jhrANah8bozp2exmVaP13mUZ9UAby0Ya4n4aw8Gf5i dsh/BrbyhacUgo7DyQ+niUbk4/bFV3f9/MHqjsI9BUwtTtpv3PhDgO1B7 D0f8kfc4hc3MDJ9/JsNcpDZMP4EeFOCzj27cuhFAyEPRK2mNJfmlgPnVt yEF/1/stmJTdw9ivCUit95gKzRGdohOTKn7Vv2uDiP7C0m9kgPt7btF2n g/Fih2EoQqqi1Mv3u14Ru7xfk0blCiCNyZd2YnRisk06DDEBT+FsUw+4S ePRmVAMLvKz9flK6etDdySYRHPLpP/1esdGRGcIBZy64wnHVhf68LUtJ7 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="377167739" X-IronPort-AV: E=Sophos;i="6.02,158,1688454000"; d="scan'208";a="377167739" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 22:45:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="695794032" X-IronPort-AV: E=Sophos;i="6.02,158,1688454000"; d="scan'208";a="695794032" Received: from dut1027pvc.igk.intel.com (HELO localhost) ([10.211.177.252]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 22:45:22 -0700 From: Klaus Gerlicher To: gdb-patches@sourceware.org Subject: [PATCH 0/1] replace PBUFSIZ with a target op Date: Tue, 19 Sep 2023 05:45:10 +0000 Message-Id: <20230919054511.17998-1-klaus.gerlicher@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,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: From: "Gerlicher, Klaus" 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 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