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 3/11] Add MIPS_MAX_REGISTER_SIZE (3/4)
Date: Fri, 05 May 2017 08:04:00 -0000	[thread overview]
Message-ID: <24D77BF6-2348-4289-8BFE-410CA2E61C28@arm.com> (raw)
In-Reply-To: <86y3v7uf9j.fsf@gmail.com>


> On 11 Apr 2017, at 16:37, Yao Qi <qiyaoltc@gmail.com> wrote:
> 
> Alan Hayward <Alan.Hayward@arm.com> writes:
> 
> Hi Alan,
> There are different ways of getting rid of MAX_REGISTER_SIZE, let us try
> some simple approaches first.  Some uses of MAX_REGISTER_SIZE still
> can't be removed, but let us start from easy part.
> 

Patch split into multiple parts.

This part removes an unused and commented out buffer.
This part also replaces a use of deprecated_frame_register_read with
get_frame_register_value.

Tested on a --enable-targets=all build using make check with board files
unix and native-gdbserver.
I do not have a MIPS machine to test on.

Ok to commit?

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

	* mips-tdep.c (mips_o32_return_value): Remove unused buffer.
	(print_gp_register_row): Use get_frame_register_value.


diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index f8e68090cfafbe4339b691ceda085a7ee7ffbc14..2f5a90be46b568826dc44cad7d8935afa1794cd1 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -5759,7 +5759,6 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
       /* A struct that contains one or two floats.  Each value is part
          in the least significant part of their floating point
          register..  */
-      gdb_byte reg[MAX_REGISTER_SIZE];
       int regnum;
       int field;
       for (field = 0, regnum = mips_regnum (gdbarch)->fp0;
@@ -6474,7 +6473,8 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
   /* Do values for GP (int) regs.  */
-  gdb_byte raw_buffer[MAX_REGISTER_SIZE];
+  const gdb_byte *raw_buffer;
+  struct value *value;
   int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8);    /* display cols
 							       per row.  */
   int col, byte;
@@ -6533,9 +6533,12 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
 	break;			/* End row: large register.  */

       /* OK: get the data in raw format.  */
-      if (!deprecated_frame_register_read (frame, regnum, raw_buffer))
+      value = get_frame_register_value (frame, regnum);
+      if (value_optimized_out (value)
+	|| !value_entirely_available (value))
 	error (_("can't read register %d (%s)"),
 	       regnum, gdbarch_register_name (gdbarch, regnum));
+      raw_buffer = value_contents_all (value);
       /* pad small registers */
       for (byte = 0;
 	   byte < (mips_abi_regsize (gdbarch)



  parent reply	other threads:[~2017-05-05  8:04 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 10:12 [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE Alan Hayward
2017-04-04 17:19 ` John Baldwin
2017-04-05 10:27   ` Alan Hayward
2017-04-11 15:37 ` Yao Qi
2017-05-05  8:03   ` [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (1/4) Alan Hayward
2017-05-05 21:44     ` Yao Qi
2017-05-05  8:04   ` [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (2/4) Alan Hayward
2017-05-05 19:51     ` John Baldwin
2017-05-12  8:53     ` Yao Qi
2017-05-16 11:16       ` Alan Hayward
2017-05-22 12:07         ` Yao Qi
2017-05-22 16:05           ` Alan Hayward
2017-05-22 17:15             ` Pedro Alves
2017-05-23 17:49               ` Alan Hayward
2017-05-23 18:30                 ` Pedro Alves
2017-05-24  9:08                   ` Alan Hayward
2017-05-24  9:29                     ` Pedro Alves
     [not found]                     ` <40597975-9458-e9af-8915-9d303bb1ed98@redhat.com>
2017-05-24 10:20                       ` Alan Hayward
     [not found]                         ` <d32041ef-9df3-316a-68ca-3fe2a2797539@redhat.com>
2017-05-24 19:45                           ` Alan Hayward
2017-05-25 10:46                             ` Pedro Alves
2017-05-25 11:43                               ` Yao Qi
2017-05-25 11:48                                 ` Pedro Alves
2017-05-26  8:54                                   ` Alan Hayward
2017-05-26 10:26                                     ` Pedro Alves
2017-05-26 15:30                                       ` Alan Hayward
2017-05-26 15:49                                         ` Pedro Alves
2017-05-26 16:18                                           ` Alan Hayward
2017-05-26 16:00                                         ` John Baldwin
2017-05-05  8:04   ` Alan Hayward [this message]
2017-05-05 21:54     ` [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (3/4) Yao Qi
2017-05-05  8:04   ` [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (4/4) Alan Hayward
     [not found]     ` <434A7317-C19A-4B53-8CB1-C7B4ACEC7D17@arm.com>
2017-06-08 20:27       ` Maciej W. Rozycki
2017-06-09 10:31         ` Alan Hayward
     [not found]           ` <ebebb23e-e61b-5eff-b666-f2632e554322@redhat.com>
2017-06-09 11:48             ` Maciej W. Rozycki
2017-06-09 12:05               ` Pedro Alves
2017-06-09 13:23                 ` Maciej W. Rozycki
2017-06-09 14:29                   ` Pedro Alves
2017-06-12  9:09                     ` Alan Hayward
2017-06-12 18:11                       ` Pedro Alves
2017-06-12 14:29                     ` Maciej W. Rozycki

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=24D77BF6-2348-4289-8BFE-410CA2E61C28@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