This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (2/4)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]