This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (2/4)
- From: John Baldwin <jhb at freebsd dot org>
- To: gdb-patches at sourceware dot org
- Cc: Alan Hayward <Alan dot Hayward at arm dot com>, Pedro Alves <palves at redhat dot com>, Yao Qi <qiyaoltc at gmail dot com>, nd <nd at arm dot com>
- Date: Fri, 26 May 2017 08:52:29 -0700
- Subject: Re: [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (2/4)
- Authentication-results: sourceware.org; auth=none
- References: <3C00280E-37C9-4C0A-9DA6-F3B9DB1A6E8F@arm.com> <73867a49-889b-171d-db60-d545da68b8dd@redhat.com> <CD9D6D82-3F2F-4883-AE42-2CFC929271CB@arm.com>
On Friday, May 26, 2017 03:30:44 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.
>
> >
> >
> > So in sum:
> >
> > #1 - ULONGEST as destination value, both signed and unsigned tests.
> > #2 - Add unsigned tests with size >4
> > #3 - Add tests src_size == dest_size
> > #4 - Use gdb_byte arrays for temporary buffers, and memset them with 0xaa.
> > #5 - Adjust tests to pass.
> > #6 - Add comments where appropriate.
> >
>
> All the above fixed up.
> After doing this, I noticed it was easier to combine the two test functions
> into one.
>
>
> 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?
The mips-fbsd-tdep.c bits look fine to me. I can run-test them post-commit.
For now I think it's simplest (especially for the current patch) to follow
your current approach of replacing the body of the helper functions in that
file. I may inline the helpers as a future followup, but I think it's
cleaner if those are separate steps anyway. Thanks!
--
John Baldwin