From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 799 invoked by alias); 10 Sep 2018 13:01:51 -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 126581 invoked by uid 89); 10 Sep 2018 13:01:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:D*suse.com, invest X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Sep 2018 13:01:45 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w8AD1d2I018591 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 10 Sep 2018 09:01:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 1244C1E75F; Mon, 10 Sep 2018 09:01:39 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 666891E16B; Mon, 10 Sep 2018 09:01:37 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 10 Sep 2018 13:01:00 -0000 From: Simon Marchi To: Jan Beulich Cc: simon.marchi@ericsson.com, tim.wiederhake@intel.com, gdb-patches@sourceware.org Subject: Re: [PATCH] x86-64: fix ZMM register state tracking In-Reply-To: <5B960E3D020000780013C85E@prv1-mh.provo.novell.com> References: <5B8FD8B302000078001E5940@prv1-mh.provo.novell.com> <369f9b84-77e3-3fa4-f363-a89ee503cff4@ericsson.com> <5B960E3D020000780013C85E@prv1-mh.provo.novell.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00260.txt.bz2 On 2018-09-10 07:25, Jan Beulich wrote: >>>> Simon Marchi 09/08/18 1:13 AM >>> >> Would it be possible to update or create a test to exercise that? >> arch-specific tests are in testsuite/gdb.arch. > > I'm sure it would be possible, but while I was happy to invest the time > to > fix the actual bug (because it affects work I'm doing), I'm afraid I > don't have > the time to learn how gdb test cases are to be constructed (I'm > familiar > only with the binutils / gas side of things). I understand. If you can provide: - a minimal source file (C + assembly in this case, I suppose) - GDB commands to reproduce the bug - actual and expected output I can take care of turning it in a GDB test case. >> On 2018-09-05 02:22 PM, Jan Beulich wrote: >>> --- a/gdb/i387-tdep.c >>> +++ b/gdb/i387-tdep.c >>> @@ -923,7 +923,8 @@ i387_supply_xsave (struct regcache *regc >>> enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); >>> struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); >>> const gdb_byte *regs = (const gdb_byte *) xsave; >>> - int i; >>> + int i, zmm_endlo_regnum = I387_ZMM0H_REGNUM (tdep) >>> + + std::min (tdep->num_zmm_regs, 16); >> >> The GNU standard requires to parenthesis when breaking lines: >> >> int i, zmm_endlo_regnum = (I387_ZMM0H_REGNUM (tdep) >> + std::min (tdep->num_zmm_regs, 16)); > > This is easy enough to fix (perhaps even without the need to send a v2, > but just before/while committing?); I don't think this is a rule being > enforced on the binutils side, so I simply wasn't aware. Yeah, no problem, I can do it. It's suggested in the GNU coding standards, so I think it would apply to binutils too: https://www.gnu.org/prep/standards/html_node/Formatting.html Search for "Adding a set of parentheses". Simon