From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org, jjohnstn@redhat.com (Jeff Johnston)
Subject: Re: [PATCH v2 13/13] IA64 Linux: Define regset structures.
Date: Fri, 18 Jul 2014 09:06:00 -0000 [thread overview]
Message-ID: <87lhrrccot.fsf@br87z6lw.de.ibm.com> (raw)
In-Reply-To: <201407151230.s6FCUXER017208@d06av02.portsmouth.uk.ibm.com> (Ulrich Weigand's message of "Tue, 15 Jul 2014 14:30:33 +0200 (CEST)")
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,
next prev parent reply other threads:[~2014-07-18 8:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 16:49 [PATCH v2 00/13] Regset rework preparations part 2 Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 11/13] TILEGX Linux: Fill 'collect_regset' in regset structure Andreas Arnez
2014-07-15 10:12 ` Ulrich Weigand
2014-07-16 13:30 ` Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 03/13] S390: Migrate to regcache_supply/collect_regset Andreas Arnez
2014-07-15 9:27 ` Ulrich Weigand
2014-07-15 12:07 ` Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 07/13] HPPA Linux: Fill 'collect_regset' in regset structures Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 08/13] M32R Linux: Fill 'collect_regset' in regset structure Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 06/13] FRV Linux: Fill 'collect_regset' in regset structures Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 09/13] NIOS2 Linux: Fill 'collect_regset' in regset structure Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 10/13] SCORE: " Andreas Arnez
2014-07-15 10:01 ` Ulrich Weigand
2014-07-15 12:25 ` Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 13/13] IA64 Linux: Define regset structures Andreas Arnez
2014-07-15 13:01 ` Ulrich Weigand
2014-07-18 9:06 ` Andreas Arnez [this message]
2014-06-25 16:49 ` [PATCH v2 05/13] ALPHA Linux: Fill 'collect_regset' in " Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 12/13] M68K Linux: Define " Andreas Arnez
2014-07-15 12:13 ` Ulrich Weigand
2014-07-16 18:01 ` Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 02/13] regcache: Add functions suitable for regset_supply/collect Andreas Arnez
2014-07-07 9:32 ` Omair Javaid
2014-07-08 11:32 ` Andreas Arnez
2014-07-08 19:09 ` Omair Javaid
2014-07-10 7:54 ` Andreas Arnez
2014-07-19 13:10 ` Omair Javaid
2014-06-25 16:49 ` [PATCH v2 01/13] Rename 'descr' field in regset structure to 'regmap' Andreas Arnez
2014-06-25 16:49 ` [PATCH v2 04/13] AARCH64 Linux: Fill 'collect_regset' in regset structures Andreas Arnez
2014-07-07 9:57 ` Omair Javaid
2014-07-01 8:00 ` [ping][PATCH v2 00/13] Regset rework preparations part 2 Andreas Arnez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhrrccot.fsf@br87z6lw.de.ibm.com \
--to=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=jjohnstn@redhat.com \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).