From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23656 invoked by alias); 18 Jul 2014 08:07: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 23623 invoked by uid 89); 18 Jul 2014 08:07:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 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; Fri, 18 Jul 2014 08:07:37 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 Jul 2014 09:07:34 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 18 Jul 2014 09:07:32 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B8C3117D805F for ; Fri, 18 Jul 2014 09:09:09 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s6I87Wgw34406424 for ; Fri, 18 Jul 2014 08:07:32 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s6I87UkO025079 for ; Fri, 18 Jul 2014 02:07:31 -0600 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s6I87Ub1025062; Fri, 18 Jul 2014 02:07:30 -0600 From: Andreas Arnez To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, jjohnstn@redhat.com (Jeff Johnston) Subject: Re: [PATCH v2 13/13] IA64 Linux: Define regset structures. References: <201407151230.s6FCUXER017208@d06av02.portsmouth.uk.ibm.com> Date: Fri, 18 Jul 2014 09:06:00 -0000 In-Reply-To: <201407151230.s6FCUXER017208@d06av02.portsmouth.uk.ibm.com> (Ulrich Weigand's message of "Tue, 15 Jul 2014 14:30:33 +0200 (CEST)") Message-ID: <87lhrrccot.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: 14071808-8372-0000-0000-000000932A3E X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00489.txt.bz2 On Tue, Jul 15 2014, Ulrich Weigand wrote: > Andreas Arnez wrote: > >> +static const struct regcache_map_entry ia64_linux_gregmap[] = >> + { >> + { 32, IA64_GR0_REGNUM }, /* r0 ... r31 */ >> + { 8, REGCACHE_MAP_SKIP_BYTES }, /* FIXME: NAT collection bits? */ >> + { 1, IA64_PR_REGNUM }, >> + { 8, IA64_BR0_REGNUM }, /* b0 ... b7 */ >> + { 1, IA64_IP_REGNUM }, >> + { 1, IA64_CFM_REGNUM }, >> + { 1, IA64_PSR_REGNUM }, >> + { 1, IA64_RSC_REGNUM }, >> + { 1, IA64_BSP_REGNUM }, >> + { 1, IA64_BSPSTORE_REGNUM }, >> + { 1, IA64_RNAT_REGNUM }, >> + { 1, IA64_CCV_REGNUM }, >> + { 1, IA64_UNAT_REGNUM }, >> + { 1, IA64_FPSR_REGNUM }, >> + { 1, IA64_PFS_REGNUM }, >> + { 1, IA64_LC_REGNUM }, >> + { 1, IA64_EC_REGNUM }, >> + { 0 } >> + }; >> + >> +#define IA64_LINUX_GREGS_SIZE (55 * 8) > > If I'm reading the kernel sources correctly, the core file note will actually > contain 128 register slots. Right... the comment to the definition of ELF_NREG says "we really need just 72 but let's leave some headroom..." In fact, GDB only uses 55 slots. And the change would make GDB consistent in itself; that's why I just declared 55 slots here. However, an old GDB rejects a core file that doesn't have exactly 128 register slots. Thus it certainly makes sense to increase this constant to 128 * 8, such that users can write a core file with a new GDB and read it with an old one. OK, done. > >> +static const struct regcache_map_entry ia64_linux_fpregmap[] = >> + { >> + { 128, IA64_FR0_REGNUM }, /* f0 ... f127 */ >> + { 0 } >> + }; >> + >> +#define IA64_LINUX_FPREGS_SIZE (128 * 8) > > The size of one FP register should be 16 bytes, not 8. Absolutely. Fixed. Incremental patch below. -- diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c index 9989602..ff44d80 100644 --- a/gdb/ia64-linux-tdep.c +++ b/gdb/ia64-linux-tdep.c @@ -156,7 +156,10 @@ static const struct regcache_map_entry ia64_linux_gregmap[] = { 0 } }; -#define IA64_LINUX_GREGS_SIZE (55 * 8) +/* Size of 'gregset_t', as defined by the Linux kernel. Note that + this is more than actually mapped in the regmap above. */ + +#define IA64_LINUX_GREGS_SIZE (128 * 8) static const struct regcache_map_entry ia64_linux_fpregmap[] = { @@ -164,7 +167,7 @@ static const struct regcache_map_entry ia64_linux_fpregmap[] = { 0 } }; -#define IA64_LINUX_FPREGS_SIZE (128 * 8) +#define IA64_LINUX_FPREGS_SIZE (128 * 16) static void ia64_linux_supply_fpregset (const struct regset *regset,