From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30960 invoked by alias); 15 May 2014 15:49:44 -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 30773 invoked by uid 89); 15 May 2014 15:49:43 -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: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 15 May 2014 15:49:41 +0000 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 May 2014 16:49:38 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 May 2014 16:49:37 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7710717D805F for ; Thu, 15 May 2014 16:50:46 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4FFnbXC57016498 for ; Thu, 15 May 2014 15:49:37 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4FFnbVg017518 for ; Thu, 15 May 2014 09:49:37 -0600 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-188.boeblingen.de.ibm.com [9.152.212.188]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s4FFnZVV017450 for ; Thu, 15 May 2014 09:49:36 -0600 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 08/11] SCORE: Replace regset_alloc() invocation by a static regset structure. Date: Thu, 15 May 2014 15:49:00 -0000 Message-Id: <1400168975-3145-9-git-send-email-arnez@linux.vnet.ibm.com> In-Reply-To: <1400168975-3145-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1400168975-3145-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14051515-1948-0000-0000-000008CD3D4D X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00238.txt.bz2 Since this changes makes the only member of the tdep structure obsolete, the tdep structure is removed. gdb/ * score-tdep.c (score7_linux_gregset): New static regset structure. (score7_linux_regset_from_core_section): Remove dynamic regset allocation. (score_gdbarch_init): Drop allocation of tdep structure. * score-tdep.h (struct gdbarch_tdep): Remove declaration. --- gdb/score-tdep.c | 21 ++++++++------------- gdb/score-tdep.h | 7 ------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 078315a..c224189 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -1447,6 +1447,12 @@ score7_linux_supply_gregset(const struct regset *regset, } } +static const struct regset score7_linux_gregset = + { + NULL, + score7_linux_supply_gregset, NULL + }; + /* Return the appropriate register set from the core section identified by SECT_NAME and SECT_SIZE. */ @@ -1454,20 +1460,11 @@ static const struct regset * score7_linux_regset_from_core_section(struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) { - struct gdbarch_tdep *tdep; - gdb_assert (gdbarch != NULL); gdb_assert (sect_name != NULL); - tdep = gdbarch_tdep (gdbarch); - if (strcmp(sect_name, ".reg") == 0 && sect_size == sizeof(elf_gregset_t)) - { - if (tdep->gregset == NULL) - tdep->gregset = regset_alloc (gdbarch, - score7_linux_supply_gregset, NULL); - return tdep->gregset; - } + return &score7_linux_gregset; return NULL; } @@ -1476,7 +1473,6 @@ static struct gdbarch * score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; - struct gdbarch_tdep *tdep; target_mach = info.bfd_arch_info->mach; arches = gdbarch_list_lookup_by_info (arches, &info); @@ -1484,8 +1480,7 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { return (arches->gdbarch); } - tdep = xcalloc(1, sizeof(struct gdbarch_tdep)); - gdbarch = gdbarch_alloc (&info, tdep); + gdbarch = gdbarch_alloc (&info, NULL); set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 32); diff --git a/gdb/score-tdep.h b/gdb/score-tdep.h index b34f5a9..02a334e 100644 --- a/gdb/score-tdep.h +++ b/gdb/score-tdep.h @@ -49,13 +49,6 @@ enum gdb_regnum /* Forward declarations. */ struct regset; -/* Target-dependent structure in gdbarch */ -struct gdbarch_tdep -{ - /* Cached core file helpers. */ - struct regset *gregset; -}; - /* Linux Core file support (dirty hack) S+core Linux register set definition, copy from S+core Linux. */ -- 1.8.4.2