From patchwork Tue Mar 28 11:54:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bouhaouel, Mohamed" X-Patchwork-Id: 55626 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8D3363858C53 for ; Tue, 28 Mar 2023 11:55:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D3363858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680004528; bh=A6jdLmeHxFXgqzIpP36sihvAZJkmPA3IbudzAuI2L10=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IdLtAjvF4t+9iBh1/BzB5HC4ZEEADrwxN7Zvybklje0+nY2w1kMRV4Gz0xzjACB+r 1VkmyvABzwcJKdwFthSp32lSH4gAK71fmp9teLtv+7SuesKA/toDGUMoPznnfuKr5C 5FnhucErSnTmrikQttHHeGolJ9XkpqgWyVQa1Ixk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 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 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mohamed Bouhaouel via Gdb-patches From: "Bouhaouel, Mohamed" Reply-To: Mohamed Bouhaouel Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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(-) Reviewed-By: Guinevere Larsen