Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 7/11] Add BFIN_MAX_REGISTER_SIZE
@ 2017-04-04 10:14 Alan Hayward
       [not found] ` <86tw63p2rx.fsf@gmail.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alan Hayward @ 2017-04-04 10:14 UTC (permalink / raw)
  To: gdb-patches; +Cc: nd

Max size set to 32bits, which I determined using regformats/reg-bfin.dat

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

I do not have an BFIN machine to test on.

Ok to commit?

Alan.


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

	* bfin-tdep.c (bfin_pseudo_register_read): Use BFIN_MAX_REGISTER_SIZE.
	(bfin_pseudo_register_write): Likewise.
	* bfin-tdep.h (BFIN_MAX_REGISTER_SIZE): Add.


diff --git a/gdb/bfin-tdep.h b/gdb/bfin-tdep.h
index 164466c2d6d1bd2dc0bc47ca3729d0e42e2d7ccb..e89e5c3138eb8245b10ccda98f0672e8e3fd728b 100644
--- a/gdb/bfin-tdep.h
+++ b/gdb/bfin-tdep.h
@@ -84,6 +84,9 @@ enum gdb_regnum {
 #define BFIN_NUM_REGS (BFIN_PC_REGNUM + 1)
 #define BFIN_NUM_PSEUDO_REGS (1)

+/* Big enough to hold the size of the largest register in bytes.  */
+#define BFIN_MAX_REGISTER_SIZE	4
+
 /* The ABIs for Blackfin.  */
 enum bfin_abi
 {
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 3df1ba387a323dc6827b1189432f8877d1833184..9b45633cab15b8e0adb0d51a2fa650dc2bc6339b 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -689,7 +689,7 @@ static enum register_status
 bfin_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
 			   int regnum, gdb_byte *buffer)
 {
-  gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
+  gdb_byte *buf = (gdb_byte *) alloca (BFIN_MAX_REGISTER_SIZE);
   enum register_status status;

   if (regnum != BFIN_CC_REGNUM)
@@ -710,7 +710,7 @@ static void
 bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
 			    int regnum, const gdb_byte *buffer)
 {
-  gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
+  gdb_byte *buf = (gdb_byte *) alloca (BFIN_MAX_REGISTER_SIZE);

   if (regnum != BFIN_CC_REGNUM)
     internal_error (__FILE__, __LINE__,



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-14 17:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 10:14 [PATCH 7/11] Add BFIN_MAX_REGISTER_SIZE Alan Hayward
     [not found] ` <86tw63p2rx.fsf@gmail.com>
     [not found]   ` <EDE97F7B-EFCE-4B4D-B996-C458F1DC7E56@arm.com>
2017-04-05 13:50     ` Andreas Schwab
2017-04-05 13:57       ` Alan Hayward
     [not found]     ` <86d1croshn.fsf@gmail.com>
2017-04-07  8:32       ` Alan Hayward
     [not found] ` <3239de71-1e7c-22dd-172d-56a3baad292b@redhat.com>
2017-04-05 15:51   ` Alan Hayward
2017-04-07 16:04     ` Yao Qi
2017-04-07 16:22       ` Alan Hayward
2017-04-14 17:26 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox