Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	nd <nd@arm.com>
Subject: Re: [PATCH 2/11] Add IA64_MAX_REGISTER_SIZE
Date: Thu, 27 Apr 2017 10:48:00 -0000	[thread overview]
Message-ID: <A24429AE-11F0-41CB-BCBB-A6864C891026@arm.com> (raw)
In-Reply-To: <86mvb2p32v.fsf@gmail.com>


> On 27 Apr 2017, at 11:17, Yao Qi <qiyaoltc@gmail.com> wrote:
> 
> Alan Hayward <Alan.Hayward@arm.com> writes:
> 
> Hi Alan,
> As I keep saying, please split your patch.  You have two complete
> different approaches in this patch to remove MAX_FP_REGISTER_SIZE, and
> each of them is independent of the other.  One looks very correct to me
> but I am not sure the other one.  This leads to that part of the patch
> can go in.
> 
>> 2017-04-26  Alan Hayward  <alan.hayward@arm.com>
>> 
>> 	* ia64-tdep.c (IA64_MAX_FP_REGISTER_SIZE) Add.
>> 	(ia64_register_to_value): Use IA64_MAX_FP_REGISTER_SIZE.
>> 	(ia64_value_to_register): Likewise.
>> 	(examine_prologue): Use get_frame_register_unsigned.
>> 	(ia64_sigtramp_frame_prev_register): Use extract_unsigned_integer.
> 
> Use read_memory_unsigned_integer.
> 
>> 	(ia64_access_reg): Likewise.
> 
> Use get_frame_register_unsigned.
> 
>> 	(ia64_access_rse_reg): Likewise.
>> 	(ia64_libunwind_frame_prev_register): Likewise.
>> 	(ia64_extract_return_value): Use IA64_MAX_FP_REGISTER_SIZE.
>> 	(ia64_store_return_value): Likewise.
>> 	(ia64_push_dummy_call): Likewise.
>> 
>> 
>> diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
>> index 22e158866bbbf0d9457737ac973027521e2c1655..4f19e15acdcf34816c10bcab6884659c6688f6bf 100644
> 

<snip>

> This part of the patch (not using IA64_MAX_FP_REGISTER_SIZE) is good
> to me.
> 

Above patch pushed.
That leaves this patch to be reviewed:


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

	* ia64-tdep.c (IA64_MAX_FP_REGISTER_SIZE) Add.
	(ia64_register_to_value): Use IA64_MAX_FP_REGISTER_SIZE.
	(ia64_value_to_register): Likewise.
	(ia64_extract_return_value): Likewise.
	(ia64_store_return_value): Likewise.
	(ia64_push_dummy_call): Likewise.


diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 8583450fee89e4f0cb6a779efde95c692e097199..4f19e15acdcf34816c10bcab6884659c6688f6bf 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -125,6 +125,9 @@ static CORE_ADDR ia64_find_global_pointer (struct gdbarch *gdbarch,

 #define NUM_IA64_RAW_REGS 462

+/* Big enough to hold a FP register in bytes.  */
+#define IA64_FP_REGISTER_SIZE 16
+
 static int sp_regnum = IA64_GR12_REGNUM;

 /* NOTE: we treat the register stack registers r32-r127 as
@@ -1227,7 +1230,7 @@ ia64_register_to_value (struct frame_info *frame, int regnum,
 			int *optimizedp, int *unavailablep)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
-  gdb_byte in[MAX_REGISTER_SIZE];
+  gdb_byte in[IA64_FP_REGISTER_SIZE];

   /* Convert to TYPE.  */
   if (!get_frame_register_bytes (frame, regnum, 0,
@@ -1245,7 +1248,7 @@ ia64_value_to_register (struct frame_info *frame, int regnum,
                          struct type *valtype, const gdb_byte *in)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
-  gdb_byte out[MAX_REGISTER_SIZE];
+  gdb_byte out[IA64_FP_REGISTER_SIZE];
   convert_typed_floating (in, valtype, out, ia64_ext_type (gdbarch));
   put_frame_register (frame, regnum, out);
 }
@@ -3208,7 +3211,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache,
   float_elt_type = is_float_or_hfa_type (type);
   if (float_elt_type != NULL)
     {
-      gdb_byte from[MAX_REGISTER_SIZE];
+      gdb_byte from[IA64_FP_REGISTER_SIZE];
       int offset = 0;
       int regnum = IA64_FR8_REGNUM;
       int n = TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type);
@@ -3273,7 +3276,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache,
   float_elt_type = is_float_or_hfa_type (type);
   if (float_elt_type != NULL)
     {
-      gdb_byte to[MAX_REGISTER_SIZE];
+      gdb_byte to[IA64_FP_REGISTER_SIZE];
       int offset = 0;
       int regnum = IA64_FR8_REGNUM;
       int n = TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type);
@@ -3835,7 +3838,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 	  len = TYPE_LENGTH (type);
 	  while (len > 0 && floatreg < IA64_FR16_REGNUM)
 	    {
-	      gdb_byte to[MAX_REGISTER_SIZE];
+	      gdb_byte to[IA64_FP_REGISTER_SIZE];
 	      convert_typed_floating (value_contents (arg) + argoffset,
 				      float_elt_type, to,
 				      ia64_ext_type (gdbarch));



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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 10:12 Alan Hayward
2017-04-05 10:00 ` Yao Qi
2017-04-11 12:47   ` Alan Hayward
2017-04-11 17:17     ` Yao Qi
2017-04-12 13:41       ` Alan Hayward
2017-04-25 16:08         ` Yao Qi
2017-04-26 10:38           ` Alan Hayward
2017-04-27 10:17             ` Yao Qi
2017-04-27 10:48               ` Alan Hayward [this message]
     [not found]                 ` <79E51549-1B65-4DA8-891A-17EF061E03A3@arm.com>
2017-06-06 10:04                   ` Yao Qi
2017-06-06 12:57                     ` Alan Hayward

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=A24429AE-11F0-41CB-BCBB-A6864C891026@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    --cc=qiyaoltc@gmail.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