From patchwork Sun Nov 18 16:33:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 30180 Received: (qmail 72484 invoked by alias); 18 Nov 2018 16:34:08 -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 72473 invoked by uid 89); 18 Nov 2018 16:34:07 -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, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HX-HELO:sk:gateway, H*RU:sk:gateway, Hx-spam-relays-external:sk:gateway, 2172 X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.51.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 18 Nov 2018 16:34:05 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 74886AF65 for ; Sun, 18 Nov 2018 10:34:03 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id OQ1JgM8OSaSeyOQ1Jgaa5n; Sun, 18 Nov 2018 10:34:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nswuumORqEIhE2a4M/cDogz8tyXVJNEArYLmJqcuFBA=; b=TSuacLnYxIe8qhRK74bl+4TIZc J8Q8mslrRLk1wAEvRBeD7HSXkCiG3aofmw1vx6IPJmI0F/NnM0xcHnJg6M+l2AvyD6s5ULMbZYKuJ xiV83+WX6hL1ZH57nUE3TdkyM; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:36108 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gOQ1J-002uNe-Cr; Sun, 18 Nov 2018 10:34:01 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Fix ia64-linux-nat.c Date: Sun, 18 Nov 2018 09:33:57 -0700 Message-Id: <20181118163357.21419-1-tom@tromey.com> PR build/23814 points out that ia64-linux-nat.c will not compile any more. This patch fixes the problem. Thanks to Andreas Schwab for trying the patch. gdb/ChangeLog 2018-11-18 Tom Tromey PR build/23814: * target-delegates.c: Rebuild. * ia64-linux-nat.c (class ia64_linux_nat_target) : Use override. Return true, not 1. (ia64_linux_nat_target::can_use_hw_breakpoint): Rename. Remove "self" argument. (ia64_linux_nat_target::low_new_thread): Rename. (class ia64_linux_nat_target) : Don't declare. * target.h (struct target_ops) : Return bool. --- gdb/ChangeLog | 13 +++++++++++++ gdb/ia64-linux-nat.c | 15 ++++++--------- gdb/target-delegates.c | 14 +++++++------- gdb/target.h | 2 +- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 1d39ec5c30..54f76b9238 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -57,8 +57,6 @@ public: ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override; - const struct target_desc *read_description () override; - /* Override watchpoint routines. */ /* The IA-64 architecture can step over a watch point (without @@ -70,7 +68,7 @@ public: has determined that a hardware watchpoint has indeed been hit. The CPU will then be able to execute one instruction without triggering a watchpoint. */ - bool have_steppable_watchpoint () { return 1; } + bool have_steppable_watchpoint () override { return true; } int can_use_hw_breakpoint (enum bptype, int, int) override; bool stopped_by_watchpoint () override; @@ -672,8 +670,8 @@ ia64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len, return -1; } -static void -ia64_linux_new_thread (struct lwp_info *lp) +void +ia64_linux_nat_target::low_new_thread (struct lwp_info *lp) { int i, any; @@ -719,10 +717,9 @@ ia64_linux_nat_target::stopped_by_watchpoint () return stopped_data_address (&addr); } -static int -ia64_linux_can_use_hw_breakpoint (struct target_ops *self, - enum bptype type, - int cnt, int othertype) +int +ia64_linux_nat_target::can_use_hw_breakpoint (enum bptype type, + int cnt, int othertype) { return 1; } diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 03136dfacf..eeb5057ce7 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -35,7 +35,7 @@ struct dummy_target : public target_ops int insert_mask_watchpoint (CORE_ADDR arg0, CORE_ADDR arg1, enum target_hw_bp_type arg2) override; 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_steppable_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; @@ -202,7 +202,7 @@ struct debug_target : public target_ops int insert_mask_watchpoint (CORE_ADDR arg0, CORE_ADDR arg1, enum target_hw_bp_type arg2) override; 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_steppable_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; @@ -989,27 +989,27 @@ debug_target::stopped_by_watchpoint () return result; } -int +bool target_ops::have_steppable_watchpoint () { return this->beneath ()->have_steppable_watchpoint (); } -int +bool dummy_target::have_steppable_watchpoint () { return false; } -int +bool debug_target::have_steppable_watchpoint () { - int result; + bool result; fprintf_unfiltered (gdb_stdlog, "-> %s->have_steppable_watchpoint (...)\n", this->beneath ()->shortname ()); result = this->beneath ()->have_steppable_watchpoint (); fprintf_unfiltered (gdb_stdlog, "<- %s->have_steppable_watchpoint (", this->beneath ()->shortname ()); fputs_unfiltered (") = ", gdb_stdlog); - target_debug_print_int (result); + target_debug_print_bool (result); fputs_unfiltered ("\n", gdb_stdlog); return result; } diff --git a/gdb/target.h b/gdb/target.h index 6f4b73bf00..4731e3bf79 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -554,7 +554,7 @@ struct target_ops TARGET_DEFAULT_RETURN (1); virtual bool stopped_by_watchpoint () TARGET_DEFAULT_RETURN (false); - virtual int have_steppable_watchpoint () + virtual bool have_steppable_watchpoint () TARGET_DEFAULT_RETURN (false); virtual bool stopped_data_address (CORE_ADDR *) TARGET_DEFAULT_RETURN (false);