Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE
@ 2017-04-04 10:13 Alan Hayward
  2017-04-11  9:02 ` Yao Qi
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Hayward @ 2017-04-04 10:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: nd

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

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

I do not have an M32R machine to test on.

Ok to commit?

Alan.


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

	* m32r-tdep.c (m32r_push_dummy_call): Use M32R_MAX_REGISTER_SIZE.
	* m32r-tdep.h (M32R_MAX_REGISTER_SIZE): Add.


diff --git a/gdb/m32r-tdep.h b/gdb/m32r-tdep.h
index 102cccecd200b7c192ade124a2fb9d9c59bdb5dd..037fd8965a7c01bd8c3ec0d1eb4a49a70d4478e6 100644
--- a/gdb/m32r-tdep.h
+++ b/gdb/m32r-tdep.h
@@ -47,4 +47,7 @@ enum m32r_regnum

 #define M32R_NUM_REGS 25

+/* Big enough to hold the size of the largest register in bytes.  */
+#define M32R_MAX_REGISTER_SIZE	4
+
 #endif /* m32r-tdep.h */
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 40f29d343b91f254cce2dd783553795c9c990eff..cb53a352b2d47068ad7cd5dacd3325d66bd77964 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -677,7 +677,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   enum type_code typecode;
   CORE_ADDR regval;
   gdb_byte *val;
-  gdb_byte valbuf[MAX_REGISTER_SIZE];
+  gdb_byte valbuf[M32R_MAX_REGISTER_SIZE];
   int len;

   /* First force sp to a 4-byte alignment.  */


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

* Re: [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE
  2017-04-04 10:13 [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE Alan Hayward
@ 2017-04-11  9:02 ` Yao Qi
  2017-04-12  8:22   ` Alan Hayward
  0 siblings, 1 reply; 4+ messages in thread
From: Yao Qi @ 2017-04-11  9:02 UTC (permalink / raw)
  To: Alan Hayward; +Cc: gdb-patches

Alan Hayward <Alan.Hayward@arm.com> writes:

> +/* Big enough to hold the size of the largest register in bytes.  */
> +#define M32R_MAX_REGISTER_SIZE	4
> +
>  #endif /* m32r-tdep.h */
> diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
> index 40f29d343b91f254cce2dd783553795c9c990eff..cb53a352b2d47068ad7cd5dacd3325d66bd77964 100644
> --- a/gdb/m32r-tdep.c
> +++ b/gdb/m32r-tdep.c
> @@ -677,7 +677,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
>    enum type_code typecode;
>    CORE_ADDR regval;
>    gdb_byte *val;
> -  gdb_byte valbuf[MAX_REGISTER_SIZE];
> +  gdb_byte valbuf[M32R_MAX_REGISTER_SIZE];

valbuf is only used for argument registers, r0 - r3.  Can you rename
M32R_MAX_REGISTER_SIZE with M32R_ARG_REGISTER_SIZE? and move its
definition into m32r-tdep.c.

/* The size of argument registers (r0 - r3) in bytes.  */
#define M32R_ARG_REGISTER_SIZE 4

OK with the change.

-- 
Yao (齐尧)


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

* Re: [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE
  2017-04-11  9:02 ` Yao Qi
@ 2017-04-12  8:22   ` Alan Hayward
       [not found]     ` <CAH=s-PP8Pkk7FO6C2EGaBGg8_gLyY8VHJxSfie3rYBx38_ac2g@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Hayward @ 2017-04-12  8:22 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches, nd


> On 11 Apr 2017, at 10:02, Yao Qi <qiyaoltc@gmail.com> wrote:
> 
> Alan Hayward <Alan.Hayward@arm.com> writes:
> 
>> +/* Big enough to hold the size of the largest register in bytes.  */
>> +#define M32R_MAX_REGISTER_SIZE	4
>> +
>> #endif /* m32r-tdep.h */
>> diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
>> index 40f29d343b91f254cce2dd783553795c9c990eff..cb53a352b2d47068ad7cd5dacd3325d66bd77964 100644
>> --- a/gdb/m32r-tdep.c
>> +++ b/gdb/m32r-tdep.c
>> @@ -677,7 +677,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
>>   enum type_code typecode;
>>   CORE_ADDR regval;
>>   gdb_byte *val;
>> -  gdb_byte valbuf[MAX_REGISTER_SIZE];
>> +  gdb_byte valbuf[M32R_MAX_REGISTER_SIZE];
> 
> valbuf is only used for argument registers, r0 - r3.  Can you rename
> M32R_MAX_REGISTER_SIZE with M32R_ARG_REGISTER_SIZE? and move its
> definition into m32r-tdep.c.
> 
> /* The size of argument registers (r0 - r3) in bytes.  */
> #define M32R_ARG_REGISTER_SIZE 4
> 
> OK with the change.
> 
> -- 
> Yao (齐尧)

Ok, pushed the following patch:

Alan.


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

	* m32r-tdep.c M32R_ARG_REGISTER_SIZE: Added.
	(m32r_push_dummy_call): Use M32R_ARG_REGISTER_SIZE.

diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 1d0d7ed..4701f7a 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -39,6 +39,9 @@
#include "m32r-tdep.h"
#include <algorithm>

+/* The size of the argument registers (r0 - r3) in bytes.  */
+#define M32R_ARG_REGISTER_SIZE 4
+
/* Local functions */

extern void _initialize_m32r_tdep (void);
@@ -677,7 +680,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
  enum type_code typecode;
  CORE_ADDR regval;
  gdb_byte *val;
-  gdb_byte valbuf[MAX_REGISTER_SIZE];
+  gdb_byte valbuf[M32R_ARG_REGISTER_SIZE];
  int len;

  /* First force sp to a 4-byte alignment.  */



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

* Re: [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE
       [not found]     ` <CAH=s-PP8Pkk7FO6C2EGaBGg8_gLyY8VHJxSfie3rYBx38_ac2g@mail.gmail.com>
@ 2017-04-12  8:54       ` Alan Hayward
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Hayward @ 2017-04-12  8:54 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches, nd


> On 12 Apr 2017, at 09:34, Yao Qi <qiyaoltc@gmail.com> wrote:
> 
> On Wed, Apr 12, 2017 at 9:22 AM, Alan Hayward <Alan.Hayward@arm.com> wrote:
>> 
>> 
>> 2017-04-12  Alan Hayward  <alan.hayward@arm.com>
>> 
>>        * m32r-tdep.c M32R_ARG_REGISTER_SIZE: Added.
> 
> The entry format is not right,
> 
> * m32r-tdep.c (M32R_ARG_REGISTER_SIZE): Added.

Apologies! Not sure why I missed that.
Fix committed.


Alan.


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

end of thread, other threads:[~2017-04-12  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 10:13 [PATCH 5/11] Add M32R_MAX_REGISTER_SIZE Alan Hayward
2017-04-11  9:02 ` Yao Qi
2017-04-12  8:22   ` Alan Hayward
     [not found]     ` <CAH=s-PP8Pkk7FO6C2EGaBGg8_gLyY8VHJxSfie3rYBx38_ac2g@mail.gmail.com>
2017-04-12  8:54       ` Alan Hayward

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