From: Pedro Alves <palves@redhat.com>
To: Alan Hayward <Alan.Hayward@arm.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
nd <nd@arm.com>
Subject: Re: [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (2/4)
Date: Fri, 26 May 2017 15:49:00 -0000 [thread overview]
Message-ID: <6e87b30d-b3fd-c25c-501e-290abb3bc60c@redhat.com> (raw)
In-Reply-To: <CD9D6D82-3F2F-4883-AE42-2CFC929271CB@arm.com>
On 05/26/2017 04:30 PM, Alan Hayward wrote:
>
>> On 26 May 2017, at 11:26, Pedro Alves <palves@redhat.com> wrote:
>
>
>> Another issue with the test is that by relying on
>> extract_(un)signed_integer, the test can't notice if the
>> zero / sign extension in copy_integer_bytes filled the right
>> number of bytes:
>>
>>> + do_cint_test (0xffffffffffffbeef, 2, 0xbeef, 3);
>>
>> I.e., above, the last test _must_ not write more than
>> two bytes to the destination, so those leading
>> 0xFFs before "beef" are artificial.
>>
>> Passing ULONGEST as destination value avoids that problem, making
>> you write that last test as:
>>
>> do_cint_test (0x000000000000beef, 2, 0xbeef, 3);
>>
>
> To make that work, I also had to make extract use the unsigned
> version. So now all the stores and extracts are working on unsigned data.
Makes sense.
> All the above fixed up.
> After doing this, I noticed it was easier to combine the two test functions
> into one.
Agreed.
>
>
> 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.
I think the unit tests now give us sufficient assurance.
> Ok to commit?
Yes, with nit below addressed.
> +static void
> +copy_integer_to_size_test ()
> +{
> + /* Destination is bigger than the source, which has the signed bit unset. */
> + do_cint_test (0x12345678, 0x12345678, 8, 0x12345678, 4);
> + do_cint_test (0x345678, 0x345678, 8, 0x12345678, 3);
> + do_cint_test (0x5678, 0x5678, 2, 0x12345678, 3);
The third test does not agree with the comment - destination is
smaller than source.
> +
> + /* Destination is bigger than the source, which has the signed bit set. */
> + do_cint_test (0xdeadbeef, 0xffffffffdeadbeef, 8, 0xdeadbeef, 4);
> + do_cint_test (0xadbeef, 0xffffffffffadbeef, 8, 0xdeadbeef, 3);
> + do_cint_test (0xbeef, 0xbeef, 2, 0xdeadbeef, 3);
Ditto.
Re-sort to a separate block, and/or update comments, and this
is good to go.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-05-26 15:49 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 (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
2017-05-05 8:04 ` [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (3/4) Alan Hayward
2017-05-05 21:54 ` 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 [this message]
2017-05-26 16:18 ` Alan Hayward
2017-05-26 16:00 ` John Baldwin
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=6e87b30d-b3fd-c25c-501e-290abb3bc60c@redhat.com \
--to=palves@redhat.com \
--cc=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