Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Luis Machado <luis.machado@linaro.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH,v2] SVE/FPSIMD fixup for big endian
Date: Tue, 8 Dec 2020 11:10:08 -0500	[thread overview]
Message-ID: <4f95c775-677c-8858-6fd7-41b405cd3099@polymtl.ca> (raw)
In-Reply-To: <33b1cca4-0f45-3999-36d3-d68e169e7acc@linaro.org>

On 2020-12-04 9:22 a.m., Luis Machado via Gdb-patches wrote:
> With the AArch64-specific parts approved, do the global maintainers have any comments on the trad-frame changes, or does it look good?

The changes in trad-frame look good to me.  If you feel like it, you could
change the bytes/size parameters in the functions' prototypes to use
gdb::array_view.

While reading your patch, I spotted some cleanups I'd like to see happening
to make the code cleaner/safer (ideas for future patches).  The first one
would be to make the fields private and add getters that assert that the kind
of value you are getting is indeed the one stored, a bit like I did for the
dynamic_prop structure.  That could catch some problems where we set value as
bytes but fetch it as a register number.

The second one is: instead of overloading the realreg field to hold the kind
of value that is stored in the object, and overloading the "addr" field for
both LONGEST values and addresses, it would be much clearer to have a kind
field + a union:

struct trad_frame_saved_reg
{
  trad_frame_saved_reg_kind kind;

  union
    {
      CORE_ADDR addr;
      LONGEST value;
      int regnum;
      gdb_byte *data;
    };
};

It would take less space, too.

Simon

  parent reply	other threads:[~2020-12-08 16:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 18:55 [PATCH][AArch64] " Luis Machado via Gdb-patches
2020-12-01 11:28 ` Alan Hayward via Gdb-patches
2020-12-01 12:19   ` Luis Machado via Gdb-patches
2020-12-01 17:38     ` Alan Hayward via Gdb-patches
2020-12-01 18:40       ` Luis Machado via Gdb-patches
2020-12-02  9:07         ` Alan Hayward via Gdb-patches
2020-12-02 17:57 ` [PATCH,v2] " Luis Machado via Gdb-patches
2020-12-03 17:35   ` Alan Hayward via Gdb-patches
2020-12-03 17:37     ` Luis Machado via Gdb-patches
2020-12-04 14:22   ` Luis Machado via Gdb-patches
2020-12-08 13:39     ` Luis Machado via Gdb-patches
2020-12-08 16:10     ` Simon Marchi via Gdb-patches [this message]
2020-12-08 19:22       ` Luis Machado via Gdb-patches

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=4f95c775-677c-8858-6fd7-41b405cd3099@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=simon.marchi@polymtl.ca \
    /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