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 6/11] Add ALPHA_MAX_REGISTER_SIZE
Date: Mon, 05 Jun 2017 16:25:00 -0000 [thread overview]
Message-ID: <D67714E2-1EDC-4CBF-9C79-964140C47671@arm.com> (raw)
In-Reply-To: <EED29198-B67C-4BD6-B4A8-12D75CD7A11B@arm.com>
> On 12 Apr 2017, at 09:25, Alan Hayward <Alan.Hayward@arm.com> wrote:
>
>>
>> On 11 Apr 2017, at 10:16, Yao Qi <qiyaoltc@gmail.com> wrote:
>>
>> Alan Hayward <Alan.Hayward@arm.com> writes:
>>
I’ve rebased this patch due to Yao’s unit test changes.
Added two asserts a well.
I don't have a ALPHA machine to test on.
Tested on a --enable-targets=all and --enable-libsanitizer build using
make check with board files unix and native-gdbserver.
Ok to commit?
Alan.
2017-05-30 Alan Hayward <alan.hayward@arm.com>
* alpha-tdep.c (alpha_register_to_value): Use get_frame_register_value.
(alpha_value_to_register): Use ALPHA_REGISTER_SIZE.
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d7cc0f4974362af89c2b42f4d5934fa8cd5d8a39..06ee90cbc7785d8277e773bdb6b98065e2e19568 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -244,17 +244,26 @@ alpha_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];
+ struct value *value = get_frame_register_value (frame, regnum);
- /* Convert to TYPE. */
- if (!get_frame_register_bytes (frame, regnum, 0,
- register_size (gdbarch, regnum),
- in, optimizedp, unavailablep))
- return 0;
+ gdb_assert (value != NULL);
+ *optimizedp = value_optimized_out (value);
+ *unavailablep = !value_entirely_available (value);
+
+ if (*optimizedp || *unavailablep)
+ {
+ release_value (value);
+ value_free (value);
+ return 0;
+ }
+
+ /* Convert to VALTYPE. */
gdb_assert (TYPE_LENGTH (valtype) == 4);
- alpha_sts (gdbarch, out, in);
- *optimizedp = *unavailablep = 0;
+ alpha_sts (gdbarch, out, value_contents_all (value));
+
+ release_value (value);
+ value_free (value);
return 1;
}
@@ -262,9 +271,11 @@ static void
alpha_value_to_register (struct frame_info *frame, int regnum,
struct type *valtype, const gdb_byte *in)
{
- gdb_byte out[MAX_REGISTER_SIZE];
+ gdb_byte out[ALPHA_REGISTER_SIZE];
gdb_assert (TYPE_LENGTH (valtype) == 4);
+ gdb_assert (register_size (get_frame_arch (frame), regnum)
+ <= ALPHA_REGISTER_SIZE);
alpha_lds (get_frame_arch (frame), out, in);
put_frame_register (frame, regnum, out);
next prev parent reply other threads:[~2017-06-05 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 10:14 Alan Hayward
2017-04-11 9:16 ` Yao Qi
[not found] ` <EED29198-B67C-4BD6-B4A8-12D75CD7A11B@arm.com>
2017-06-05 16:25 ` Alan Hayward [this message]
2017-06-06 14:02 ` Yao Qi
2017-06-06 14:47 ` 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=D67714E2-1EDC-4CBF-9C79-964140C47671@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