From patchwork Fri Aug 31 15:11:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 29147 Received: (qmail 44559 invoked by alias); 31 Aug 2018 15:12:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 44476 invoked by uid 89); 31 Aug 2018 15:12:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Aug 2018 15:12:03 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CB884025EF3 for ; Fri, 31 Aug 2018 15:12:01 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34D731C73B for ; Fri, 31 Aug 2018 15:12:01 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/2] Eliminate target_have_continuable_watchpoint Date: Fri, 31 Aug 2018 16:11:58 +0100 Message-Id: <20180831151159.10583-2-palves@redhat.com> In-Reply-To: <20180831151159.10583-1-palves@redhat.com> References: <20180831151159.10583-1-palves@redhat.com> target_have_continuable_watchpoint isn't used anywhere so remove it. The property isn't necessary because checking for "continuable" is the same as checking for "!steppable && !non-steppable". gdb/ChangeLog: 2018-08-31 Pedro Alves * nto-procfs.c (nto_procfs_target::have_continuable_watchpoint): Delete. * s390-linux-nat.c (s390_linux_nat_target::have_continuable_watchpoint): Delete. * target.h (target_ops::have_continuable_watchpoint): Delete. (target_have_continuable_watchpoint): Delete. * x86-nat.h (x86_nat_target::have_continuable_watchpoint): Delete. * target-delegates.c: Regenerate. --- gdb/nto-procfs.c | 3 --- gdb/s390-linux-nat.c | 1 - gdb/target-delegates.c | 27 --------------------------- gdb/target.h | 7 ------- gdb/x86-nat.h | 2 -- 5 files changed, 40 deletions(-) diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 117edb161c3..54357af85b2 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -119,9 +119,6 @@ struct nto_procfs_target : public inf_child_target void interrupt () override; - bool have_continuable_watchpoint () - { return true; } - const char *extra_thread_info (struct thread_info *) override; char *pid_to_exec_file (int pid) override; diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c index 2c605628105..7a04e854eb7 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c @@ -122,7 +122,6 @@ public: int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *) override; int region_ok_for_hw_watchpoint (CORE_ADDR, int) override; - bool have_continuable_watchpoint () override { return true; } bool stopped_by_watchpoint () override; int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type, struct expression *) override; diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 319a9bb46b4..03136dfacf2 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -36,7 +36,6 @@ struct dummy_target : public target_ops int remove_mask_watchpoint (CORE_ADDR arg0, CORE_ADDR arg1, enum target_hw_bp_type arg2) override; bool stopped_by_watchpoint () override; int have_steppable_watchpoint () override; - bool have_continuable_watchpoint () override; bool stopped_data_address (CORE_ADDR *arg0) override; bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; @@ -204,7 +203,6 @@ struct debug_target : public target_ops int remove_mask_watchpoint (CORE_ADDR arg0, CORE_ADDR arg1, enum target_hw_bp_type arg2) override; bool stopped_by_watchpoint () override; int have_steppable_watchpoint () override; - bool have_continuable_watchpoint () override; bool stopped_data_address (CORE_ADDR *arg0) override; bool watchpoint_addr_within_range (CORE_ADDR arg0, CORE_ADDR arg1, int arg2) override; int region_ok_for_hw_watchpoint (CORE_ADDR arg0, int arg1) override; @@ -1016,31 +1014,6 @@ debug_target::have_steppable_watchpoint () return result; } -bool -target_ops::have_continuable_watchpoint () -{ - return this->beneath ()->have_continuable_watchpoint (); -} - -bool -dummy_target::have_continuable_watchpoint () -{ - return false; -} - -bool -debug_target::have_continuable_watchpoint () -{ - bool result; - fprintf_unfiltered (gdb_stdlog, "-> %s->have_continuable_watchpoint (...)\n", this->beneath ()->shortname ()); - result = this->beneath ()->have_continuable_watchpoint (); - fprintf_unfiltered (gdb_stdlog, "<- %s->have_continuable_watchpoint (", this->beneath ()->shortname ()); - fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_bool (result); - fputs_unfiltered ("\n", gdb_stdlog); - return result; -} - bool target_ops::stopped_data_address (CORE_ADDR *arg0) { diff --git a/gdb/target.h b/gdb/target.h index 39aa8c3c730..b29d34b8a65 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -552,8 +552,6 @@ struct target_ops TARGET_DEFAULT_RETURN (false); virtual int have_steppable_watchpoint () TARGET_DEFAULT_RETURN (false); - virtual bool have_continuable_watchpoint () - TARGET_DEFAULT_RETURN (false); virtual bool stopped_data_address (CORE_ADDR *) TARGET_DEFAULT_RETURN (false); virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) @@ -1933,11 +1931,6 @@ extern struct thread_info *target_thread_handle_to_thread_info #define target_have_steppable_watchpoint \ (current_top_target ()->have_steppable_watchpoint ()) -/* Non-zero if we have continuable watchpoints */ - -#define target_have_continuable_watchpoint \ - (current_top_target ()->have_continuable_watchpoint ()) - /* Provide defaults for hardware watchpoint functions. */ /* If the *_hw_beakpoint functions have not been defined diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h index cc27fa43b4d..f6d8a26baf9 100644 --- a/gdb/x86-nat.h +++ b/gdb/x86-nat.h @@ -76,8 +76,6 @@ struct x86_nat_target : public BaseTarget the one that caused the trap. Therefore we don't need to step over it. But we do need to reset the status register to avoid another trap. */ - bool have_continuable_watchpoint () override - { return true; } int can_use_hw_breakpoint (enum bptype type, int cnt, int othertype) override { return x86_can_use_hw_breakpoint (type, cnt, othertype); }