From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29866 invoked by alias); 14 Apr 2018 19:18:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 29817 invoked by uid 89); 14 Apr 2018 19:18:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=1998, our 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; Sat, 14 Apr 2018 19:18:18 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E23DF42CBF41 for ; Sat, 14 Apr 2018 19:10:10 +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 94506215CDC8 for ; Sat, 14 Apr 2018 19:10:10 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 24/40] target_ops/C++: m32r GNU/Linux Date: Sat, 14 Apr 2018 19:18:00 -0000 Message-Id: <20180414190953.24481-25-palves@redhat.com> In-Reply-To: <20180414190953.24481-1-palves@redhat.com> References: <20180414190953.24481-1-palves@redhat.com> X-SW-Source: 2018-04/txt/msg00281.txt.bz2 Straighforward conversion. Not tested. --- gdb/m32r-linux-nat.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c index e5dbfb9832..ccdea941e0 100644 --- a/gdb/m32r-linux-nat.c +++ b/gdb/m32r-linux-nat.c @@ -34,7 +34,15 @@ #include "m32r-tdep.h" +class m32r_linux_nat_target final : public linux_nat_target +{ +public: + /* Add our register access methods. */ + void fetch_registers (struct regcache *, int) override; + void store_registers (struct regcache *, int) override; +}; +static m32r_linux_nat_target the_m32r_linux_nat_target; /* Since EVB register is not available for native debug, we reduce the number of registers. */ @@ -191,9 +199,8 @@ fill_fpregset (const struct regcache *regcache, this for all registers (including the floating point and SSE registers). */ -static void -m32r_linux_fetch_inferior_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) { pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); @@ -213,9 +220,8 @@ m32r_linux_fetch_inferior_registers (struct target_ops *ops, /* Store register REGNO back into the child process. If REGNO is -1, do this for all registers (including the floating point and SSE registers). */ -static void -m32r_linux_store_inferior_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +m32r_linux_nat_target::store_registers (struct regcache *regcache, int regno) { pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); @@ -234,15 +240,6 @@ m32r_linux_store_inferior_registers (struct target_ops *ops, void _initialize_m32r_linux_nat (void) { - struct target_ops *t; - - /* Fill in the generic GNU/Linux methods. */ - t = linux_target (); - - /* Add our register access methods. */ - t->to_fetch_registers = m32r_linux_fetch_inferior_registers; - t->to_store_registers = m32r_linux_store_inferior_registers; - /* Register the target. */ - linux_nat_add_target (t); + add_target (&the_m32r_linux_nat_target); } -- 2.14.3