From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126678 invoked by alias); 26 May 2017 16:00:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 114142 invoked by uid 89); 26 May 2017 16:00:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=sum X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 May 2017 16:00:06 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id EFCC010AFA3; Fri, 26 May 2017 12:00:05 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Cc: Alan Hayward , Pedro Alves , Yao Qi , nd Subject: Re: [PATCH 3/11] Add MIPS_MAX_REGISTER_SIZE (2/4) Date: Fri, 26 May 2017 16:00:00 -0000 Message-ID: <2477275.zuBCpXCHfi@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <3C00280E-37C9-4C0A-9DA6-F3B9DB1A6E8F@arm.com> <73867a49-889b-171d-db60-d545da68b8dd@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00567.txt.bz2 On Friday, May 26, 2017 03:30:44 PM Alan Hayward wrote: > > > On 26 May 2017, at 11:26, Pedro Alves 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