From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14809 invoked by alias); 14 Feb 2019 15:30:58 -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 14662 invoked by uid 89); 14 Feb 2019 15:30:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=repair, Jul, Repair, jul X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Feb 2019 15:30:42 +0000 Received: from svr-orw-mbx-06.mgc.mentorg.com ([147.34.90.206]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1guIyG-0000hG-Hc from Thomas_Schwinge@mentor.com ; Thu, 14 Feb 2019 07:30:40 -0800 Received: from svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) by SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 14 Feb 2019 07:30:38 -0800 Received: from tftp-cs (147.34.91.1) by svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) with Microsoft SMTP Server id 15.0.1320.4 via Frontend Transport; Thu, 14 Feb 2019 07:30:38 -0800 Received: by tftp-cs (Postfix, from userid 49978) id CFFCFC2320; Thu, 14 Feb 2019 07:30:37 -0800 (PST) From: Thomas Schwinge To: CC: Pedro Alves Subject: Re: [RESEND][PATCH 01/40] Convert struct target_ops to C++ In-Reply-To: References: <20180414190953.24481-1-palves@redhat.com> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Thu, 14 Feb 2019 15:30:00 -0000 Message-ID: <87r2caie0n.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2019-02/txt/msg00230.txt.bz2 --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-length: 468 Hi! On Thu, 3 May 2018 01:05:55 +0100, Pedro Alves wrote: > >From f6ac5f3d63e03a81c4ff3749aba234961cc9090e Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Thu, 3 May 2018 00:37:22 +0100 > Subject: [PATCH] Convert struct target_ops to C++ Pushed to master the attached commit 2d0a338c7c321de6c63be4e7e3f06ba12b783c63 '[gdb, hurd] Repair build after "Convert struct target_ops to C++" changes'. Gr=C3=BC=C3=9Fe Thomas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-gdb-hurd-Repair-build-after-Convert-struct-target_op.patch" Content-length: 5516 >From 2d0a338c7c321de6c63be4e7e3f06ba12b783c63 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 20 Jul 2018 02:03:25 +0200 Subject: [PATCH] [gdb, hurd] Repair build after "Convert struct target_ops to C++" changes ..., that is commit f6ac5f3d63e03a81c4ff3749aba234961cc9090e causing: In file included from [...]/gdb/gnu-nat.c:24:0: [...]/gdb/gnu-nat.h:123:1: error: expected class-name before '{' token { ^ [...]/gdb/gnu-nat.h:128:16: error: 'inferior' has not been declared void detach (inferior *, int) override; ^~~~~~~~ [...]/gdb/gnu-nat.h:132:8: error: use of enum 'target_xfer_status' without previous declaration enum target_xfer_status xfer_partial (enum target_object object, ^~~~~~~~~~~~~~~~~~ [...]/gdb/gnu-nat.h:132:46: error: use of enum 'target_object' without previous declaration enum target_xfer_status xfer_partial (enum target_object object, ^~~~~~~~~~~~~ [...]/gdb/gnu-nat.h:124:8: error: 'void gnu_nat_target::attach(const char*, int)' marked 'override', but does not override void attach (const char *, int) override; ^~~~~~ [...] [...]/gdb/gnu-nat.c: In member function 'virtual void gnu_nat_target::detach(inferior*, int)': [...]/gdb/gnu-nat.c:2286:34: error: 'ops' was not declared in this scope inf_child_maybe_unpush_target (ops); ^~~ [...]/gdb/gnu-nat.c:2286:34: note: suggested alternative: 'open' inf_child_maybe_unpush_target (ops); ^~~ open [...]/gdb/gnu-nat.c:2286:3: error: 'inf_child_maybe_unpush_target' was not declared in this scope inf_child_maybe_unpush_target (ops); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [...]/gdb/gnu-nat.c:2286:3: note: suggested alternative: 'maybe_unpush_target' inf_child_maybe_unpush_target (ops); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ maybe_unpush_target [...]/gdb/i386-gnu-nat.c:200:1: warning: 'void gnu_store_registers(target_ops*, regcache*, int)' defined but not used [-Wunused-function] gnu_store_registers (struct target_ops *ops, ^~~~~~~~~~~~~~~~~~~ [...]/gdb/i386-gnu-nat.c:109:1: warning: 'void gnu_fetch_registers(target_ops*, regcache*, int)' defined but not used [-Wunused-function] gnu_fetch_registers (struct target_ops *ops, ^~~~~~~~~~~~~~~~~~~ [...] /usr/bin/ld: i386-gnu-nat.o:(.data.rel+0x0): undefined reference to `vtable for i386_gnu_nat_target' collect2: error: ld returned 1 exit status gdb/ * gnu-nat.c (gnu_nat_target::detach): Instead of 'inf_child_maybe_unpush_target (ops)' call 'maybe_unpush_target'. * gnu-nat.h: #include "inf-child.h". * i386-gnu-nat.c (gnu_fetch_registers): Rename/move to 'i386_gnu_nat_target::fetch_registers'. (gnu_store_registers): Rename/move to 'i386_gnu_nat_target::store_registers'. --- gdb/ChangeLog | 8 ++++++++ gdb/gnu-nat.c | 2 +- gdb/gnu-nat.h | 2 ++ gdb/i386-gnu-nat.c | 10 ++++------ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c88216b94b..fcaae6125e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2019-02-14 Thomas Schwinge + * gnu-nat.c (gnu_nat_target::detach): Instead of + 'inf_child_maybe_unpush_target (ops)' call 'maybe_unpush_target'. + * gnu-nat.h: #include "inf-child.h". + * i386-gnu-nat.c (gnu_fetch_registers): Rename/move to + 'i386_gnu_nat_target::fetch_registers'. + (gnu_store_registers): Rename/move to + 'i386_gnu_nat_target::store_registers'. + * config/i386/nm-i386gnu.h: Don't "#include" any files. * gnu-nat.h (mach_thread_info): New function. * gnu-nat.c (thread_takeover_sc_cmd): Use it. diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index bd8fcb6e59..78966c805d 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2280,7 +2280,7 @@ gnu_nat_target::detach (inferior *inf, int from_tty) inferior_ptid = null_ptid; detach_inferior (pid); - inf_child_maybe_unpush_target (ops); + maybe_unpush_target (); } diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h index dbad0cac93..4bd4176ead 100644 --- a/gdb/gnu-nat.h +++ b/gdb/gnu-nat.h @@ -35,6 +35,8 @@ extern __typeof__ (mach_thread_info) mach_thread_info asm ("thread_info"); #include +#include "inf-child.h" + struct inf; extern struct inf *gnu_current_inf; diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c index c23c4bc79c..75ae641f8e 100644 --- a/gdb/i386-gnu-nat.c +++ b/gdb/i386-gnu-nat.c @@ -105,9 +105,8 @@ fetch_fpregs (struct regcache *regcache, struct proc *thread) } /* Fetch register REGNO, or all regs if REGNO is -1. */ -static void -gnu_fetch_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +i386_gnu_nat_target::fetch_registers (struct regcache *regcache, int regno) { struct proc *thread; ptid_t ptid = regcache->ptid (); @@ -196,9 +195,8 @@ store_fpregs (const struct regcache *regcache, struct proc *thread, int regno) } /* Store at least register REGNO, or all regs if REGNO == -1. */ -static void -gnu_store_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +i386_gnu_nat_target::store_registers (struct regcache *regcache, int regno) { struct proc *thread; struct gdbarch *gdbarch = regcache->arch (); -- 2.19.2 --=-=-=--