From patchwork Mon Apr 28 09:45:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 700 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 0B5A936007C for ; Mon, 28 Apr 2014 02:46:03 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id BE75B5006225; Mon, 28 Apr 2014 02:46:02 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.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-mx22.g.dreamhost.com (Postfix) with ESMTPS id 92ABE500621E for ; Mon, 28 Apr 2014 02:46:02 -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=cAcMB b4NLmNvNkxv19JZmsc1FlrJ9BnZDuZpupiWCxh397DTqBkVVegQ/GJZZKk8FB1Nv W6AO1kWHDtTUP++/VqHPRkf1pXfrEcxxtm1m06KcZyetKkDoP7BVBYvcnvK1ZNqu 5hYttSVpTjWE923kVebJTIOY13ghzZPy1s9HrE= 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=1pwvSYWzNPO 7BU3QMKNcTyDae4c=; b=K04snypkfUVKrMqdm94+/VJgg5qtvAB0IIa1QinvsRs aeKfN12UGutVoFv0+5UMF+f2iutghC1N8q2rVTQHE4o7b9+9A8RfYOarXbQ04CAy FGD6n2sleSf/ot6rXv+Zu0elUhjMUh4F0ktq5YkTUk1Yu1xFACLDBGBco9xZrHKo = Received: (qmail 26316 invoked by alias); 28 Apr 2014 09:46:01 -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 26301 invoked by uid 89); 28 Apr 2014 09:46:00 -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: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Apr 2014 09:45:59 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Apr 2014 10:45:56 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Apr 2014 10:45:54 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0C36D1B08040 for ; Mon, 28 Apr 2014 10:46:01 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s3S9jr911442220 for ; Mon, 28 Apr 2014 09:45:53 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s3S9jrlS019735 for ; Mon, 28 Apr 2014 03:45:53 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-188.boeblingen.de.ibm.com [9.152.212.188]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s3S9jqte019717; Mon, 28 Apr 2014 03:45:52 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Richard Earnshaw Subject: [RFC 04/23] ARM: Replace regset_alloc() invocations by static regset structures References: <87eh0h6bkq.fsf@br87z6lw.de.ibm.com> Date: Mon, 28 Apr 2014 11:45:52 +0200 In-Reply-To: <87eh0h6bkq.fsf@br87z6lw.de.ibm.com> (Andreas Arnez's message of "Mon, 28 Apr 2014 11:35:33 +0200") Message-ID: <87tx9d4wj3.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: 14042809-3548-0000-0000-000008DFF5D2 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in After removal of the regset_alloc invocations, the appropriate tdep fields become obsolete and are thus removed. gdb/ * arm-linux-tdep.c (arm_linux_gregset, arm_linux_fpregset) (arm_linux_vfpregset): New static regset structures. (arm_linux_regset_from_core_section): Remove dynamic allocation of regset structures. * arm-tdep.h (struct gdbarch_tdep): Remove 'gregset', 'fpregset', and 'vfpregset' fields. --- gdb/arm-linux-tdep.c | 38 ++++++++++++++++++-------------------- gdb/arm-tdep.h | 3 --- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 98b912b..028a95b 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -686,6 +686,21 @@ arm_linux_collect_vfp (const struct regset *regset, regs + (regno - ARM_D0_REGNUM) * 8); } +static const struct regset arm_linux_gregset = + { + NULL, arm_linux_supply_gregset, arm_linux_collect_gregset + }; + +static const struct regset arm_linux_fpregset = + { + NULL, arm_linux_supply_nwfpe, arm_linux_collect_nwfpe + }; + +static const struct regset arm_linux_vfpregset = + { + NULL, arm_linux_supply_vfp, arm_linux_collect_vfp + }; + /* Return the appropriate register set for the core section identified by SECT_NAME and SECT_SIZE. */ @@ -693,34 +708,17 @@ static const struct regset * arm_linux_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - if (strcmp (sect_name, ".reg") == 0 && sect_size == ARM_LINUX_SIZEOF_GREGSET) - { - if (tdep->gregset == NULL) - tdep->gregset = regset_alloc (gdbarch, arm_linux_supply_gregset, - arm_linux_collect_gregset); - return tdep->gregset; - } + return &arm_linux_gregset; if (strcmp (sect_name, ".reg2") == 0 && sect_size == ARM_LINUX_SIZEOF_NWFPE) - { - if (tdep->fpregset == NULL) - tdep->fpregset = regset_alloc (gdbarch, arm_linux_supply_nwfpe, - arm_linux_collect_nwfpe); - return tdep->fpregset; - } + return &arm_linux_fpregset; if (strcmp (sect_name, ".reg-arm-vfp") == 0 && sect_size == ARM_LINUX_SIZEOF_VFP) - { - if (tdep->vfpregset == NULL) - tdep->vfpregset = regset_alloc (gdbarch, arm_linux_supply_vfp, - arm_linux_collect_vfp); - return tdep->vfpregset; - } + return &arm_linux_vfpregset; return NULL; } diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index f8ba122..29669d0 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -193,9 +193,6 @@ struct gdbarch_tdep /* Convention for returning structures. */ enum struct_return struct_return; - /* Cached core file helpers. */ - struct regset *gregset, *fpregset, *vfpregset; - /* ISA-specific data types. */ struct type *arm_ext_type; struct type *neon_double_type;