From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id D1A713858D39 for ; Tue, 28 Mar 2023 11:55:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1A713858D39 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=1680004503; x=1711540503; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=JVJP1tl/m7YxaFZexMzXOFz27QbvUp8jleAlaI3PfMk=; b=mwSQXwCfueW4/SGjEeOvxA4jeL9olmD3p50fcsALk5DS3MQDMfV9Wju0 jiOG5z5jx6PCIEZA6yUpZg01p9QOmlcg3GlbEJ9QI9TPz4GebaNdko1uU 0GW27y+3Ru/HbKrhvFzpjhIscxoxj1RBfP8sKoVnQVOET9CGD+h4bNl0p OMR0Q//XX3v0+cavpf1xZh85t5c3Z19WBB8HpvBeCsjTMnotRQTwWPike ftA/Jw39ydVi7bkFAVwJfeQV7Q5yjlRmpc2EYbAwlUynPNQvnvL+11+K4 ilf5JWD6sUEFMRvvFyo5vBnZhiSQ8YZzjjJKbYRndC3w/DlwRwspQSPf7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="320944313" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="320944313" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 04:55:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10662"; a="753116064" X-IronPort-AV: E=Sophos;i="5.98,297,1673942400"; d="scan'208";a="753116064" Received: from mbouhaou-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.40.224]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 04:55:02 -0700 From: Mohamed Bouhaouel To: gdb-patches@sourceware.org Subject: [PATCH 0/3] Check for zpoint support when handling watchpoints Date: Tue, 28 Mar 2023 13:54:46 +0200 Message-Id: <20230328115449.6526-1-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 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: Hi all, This set of patches improves the flow of inserting a watchpoint or a hardware breakpoint. It consists of checking whether the target supports the z_point before doing the actual insertion. Having such a flow would avoid unnecessary too many warning messages, not increment the breakpoint counter when not supported, and prevent commands from being aborted upon resuming. Below are the behaviors, with and without the patches, of trying to insert a hardware watchpoint when the target does not support that. * Original behavior (gdb) awatch dim0 Hardware watchpoint 2: dim0 Warning: Could not insert hardware watchpoint 2. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoint. (gdb) continue Hardware watchpoint 2: dim0 Warning: Could not insert hardware watchpoint 2. Could not insert hardware breakpoints: You may have requested too many hardware breakpoints/watchpoint. Command aborted. (gdb) The warning messages keep popping up on each resume command (`continue`, `step`, ...) until the user manually deletes the watchpoint. * With patches applied (gdb) awatch dim0 Target does not support this type of hardware watchpoint. (gdb) Regards, Mohamed Mohamed Bouhaouel (3): gdb, gdbserver, zpoint: report z_point support gdb, breakpoint: add a breakpoint type converter gdb, zpoint: check for target hardware breakpoint support gdb/breakpoint.c | 20 ++++++++++++++++++++ gdb/breakpoint.h | 3 +++ gdb/remote.c | 41 ++++++++++++++++++++++++++++++++++++++--- gdbserver/mem-break.cc | 2 +- gdbserver/mem-break.h | 4 ++++ gdbserver/server.cc | 7 +++++++ 6 files changed, 73 insertions(+), 4 deletions(-) -- 2.25.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