From patchwork Tue Apr 29 08:58:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 744 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 7DC9F360078 for ; Tue, 29 Apr 2014 01:58:42 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 334D841369324; Tue, 29 Apr 2014 01:58:42 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id F23A441369320 for ; Tue, 29 Apr 2014 01:58:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=OtKol ayLsRrQrkD0J79jPiXuAMMOAe5PHqmXzeIw8WI7s8ETmI38WKX2c3xf84H/88YHm YA/PVS0kF5oQMtH/fJ5gdROYWrX/yzTQpJLbooVYlNhJJWy38NE5v3T3pUMgf25D P957a62D6qEqPaS6uMfGccFT+l+9TujF+mZ4gs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=vi3eOpK1eTy ndzJuQOr4ZdTcK2o=; b=f2q5hqOSSA9grU1cNdi3wtvz/4AcKczzbY0Wp0CKKHW 10SKUYo98AbAzrWIb4BRHiVj9eOqbRiQraiGHTwKJN30bkUYB2+OkYbLxJG7Q3gj vJMgmU++iTnBdu01R43uZ4mRV6vce7tuVKwcsxdmRyMYan67lrannp4liPtJxaLo = 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-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 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 10:58:30 +0200 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 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14042908-8372-0000-0000-00000980A993 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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); }