Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>
Subject: [PATCH 8/11] Add FRV_MAX_REGISTER_SIZE
Date: Tue, 04 Apr 2017 10:14:00 -0000	[thread overview]
Message-ID: <3B3BD949-1C9D-44FF-AB6A-03091ECA49D0@arm.com> (raw)

Max size set to 64bits, which I determined using frv_register_type()

Tested on a --enable-targets=all build using make check with board files
unix and native-gdbserver.

I do not have a FRV machine to test on.

Ok to commit?

Alan.

2017-04-04  Alan Hayward  <alan.hayward@arm.com>

	* frv-linux-tdep.c (frv_linux_supply_gregset): Use FRV_MAX_REGISTER_SIZE.
	* frv-tdep.h (FRV_MAX_REGISTER_SIZE): Add.


diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index eb87f93058b0287e8f05c585d1b6aa1ff2bffb78..6f5585e774c86afe7e271f90df1bf3db93340421 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -413,9 +413,9 @@ frv_linux_supply_gregset (const struct regset *regset,
 			  int regnum, const void *gregs, size_t len)
 {
   int regi;
-  char zerobuf[MAX_REGISTER_SIZE];
+  char zerobuf[FRV_MAX_REGISTER_SIZE];

-  memset (zerobuf, 0, MAX_REGISTER_SIZE);
+  memset (zerobuf, 0, FRV_MAX_REGISTER_SIZE);

   /* gr0 always contains 0.  Also, the kernel passes the TBR value in
      this slot.  */
diff --git a/gdb/frv-tdep.h b/gdb/frv-tdep.h
index c1a0f35456c879c655198820f5319bf0ab42b9f7..9c8c32eb08b6e4b4d87139b201008c1ee419f6a9 100644
--- a/gdb/frv-tdep.h
+++ b/gdb/frv-tdep.h
@@ -92,6 +92,9 @@ enum {
   frv_num_pseudo_regs = last_pseudo_regnum - first_pseudo_regnum + 1,
 };

+/* Big enough to hold the size of the largest register in bytes.  */
+#define FRV_MAX_REGISTER_SIZE	8
+
 /* Return the FR-V ABI associated with GDBARCH.  */
 enum frv_abi frv_abi (struct gdbarch *gdbarch);



             reply	other threads:[~2017-04-04 10:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 10:14 Alan Hayward [this message]
2017-04-11 10:02 ` Yao Qi
     [not found]   ` <EBF2EEFF-20D5-43F3-B35D-5BB37C3CB153@arm.com>
2017-04-27  8:55     ` Alan Hayward
2017-05-03  8:44       ` Yao Qi
2017-05-03  9:27         ` Pedro Alves
     [not found]           ` <CE496FA1-0D8A-47DC-B8E5-91598F30C93E@arm.com>
2017-05-03 11:23             ` Pedro Alves
2017-05-03 11:36               ` Alan Hayward
2017-05-03 13:34             ` Yao Qi

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=3B3BD949-1C9D-44FF-AB6A-03091ECA49D0@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.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