From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20406 invoked by alias); 29 Apr 2014 08:58:39 -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 20391 invoked by uid 89); 29 Apr 2014 08:58:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp12.uk.ibm.com Received: from e06smtp12.uk.ibm.com (HELO e06smtp12.uk.ibm.com) (195.75.94.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 29 Apr 2014 08:58:38 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 29 Apr 2014 09:58:34 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 29 Apr 2014 09:58:32 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id BE5AF1B08069 for ; Tue, 29 Apr 2014 09:58:39 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s3T8wV5Z1245460 for ; Tue, 29 Apr 2014 08:58:31 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s3T8wVwr018854 for ; Tue, 29 Apr 2014 04:58:31 -0400 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-188.boeblingen.de.ibm.com [9.152.212.188]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s3T8wVYb018829; Tue, 29 Apr 2014 04:58:31 -0400 From: Andreas Arnez To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [RFC 05/23] X86: Replace regset_alloc() invocations by static regset structures. References: <87eh0h6bkq.fsf@br87z6lw.de.ibm.com> <87ppk14wh4.fsf@br87z6lw.de.ibm.com> <201404281533.s3SFXGW3003471@glazunov.sibelius.xs4all.nl> Date: Tue, 29 Apr 2014 08:58:00 -0000 In-Reply-To: <201404281533.s3SFXGW3003471@glazunov.sibelius.xs4all.nl> (Mark Kettenis's message of "Mon, 28 Apr 2014 17:33:17 +0200 (CEST)") Message-ID: <8761ls1phk.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14042908-8372-0000-0000-00000980A993 X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00607.txt.bz2 On Mon, Apr 28 2014, Mark Kettenis wrote: >> From: Andreas Arnez >> Date: Mon, 28 Apr 2014 11:47:03 +0200 >> >> diff --git a/gdb/amd64obsd-tdep.c b/gdb/amd64obsd-tdep.c >> index c5ed731..e7041c9 100644 >> --- a/gdb/amd64obsd-tdep.c >> +++ b/gdb/amd64obsd-tdep.c >> @@ -49,11 +49,17 @@ amd64obsd_supply_regset (const struct regset *regset, >> >> gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE); >> >> - i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset); >> + i386_gregset.supply_regset (regset, regcache, regnum, regs, >> + tdep->sizeof_gregset); > > I'm not too happy with the additional level of indirection you're > introducing here. Don't particularly see the need to do this... Sure, I can keep i386_supply_gregset as a global function, if you prefer. I'll adjust [RFC 05/23] by the patch below. OK? -- diff --git a/gdb/amd64obsd-tdep.c b/gdb/amd64obsd-tdep.c index e7041c9..3a46956 100644 --- a/gdb/amd64obsd-tdep.c +++ b/gdb/amd64obsd-tdep.c @@ -49,8 +49,7 @@ amd64obsd_supply_regset (const struct regset *regset, gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE); - i386_gregset.supply_regset (regset, regcache, regnum, regs, - tdep->sizeof_gregset); + i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset); amd64_supply_fxsave (regcache, regnum, ((const gdb_byte *)regs) + tdep->sizeof_gregset); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index bee27f8..293e87a 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -3720,7 +3720,7 @@ i386_value_to_register (struct frame_info *frame, int regnum, in the general-purpose register set REGSET to register cache REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ -static void +void i386_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index fd601f2..e0950a3 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -377,6 +377,13 @@ extern int i386_sigtramp_p (struct frame_info *this_frame); extern int i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct reggroup *group); +/* Supply register REGNUM from the general-purpose register set REGSET + to register cache REGCACHE. If REGNUM is -1, do this for all + registers in REGSET. */ +extern void i386_supply_gregset (const struct regset *regset, + struct regcache *regcache, int regnum, + const void *gregs, size_t len); + /* General-purpose register set. */ extern const struct regset i386_gregset; diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c index 46b4719..70dd0eb 100644 --- a/gdb/i386obsd-tdep.c +++ b/gdb/i386obsd-tdep.c @@ -147,8 +147,7 @@ i386obsd_aout_supply_regset (const struct regset *regset, gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE); - i386_gregset.supply_regset (regset, regcache, regnum, regs, - tdep->sizeof_gregset); + i386_supply_gregset (regset, regcache, regnum, regs, tdep->sizeof_gregset); i387_supply_fsave (regcache, regnum, gregs + tdep->sizeof_gregset); }