From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13544 invoked by alias); 8 Sep 2014 11:51:36 -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 13534 invoked by uid 89); 8 Sep 2014 11:51:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp13.uk.ibm.com Received: from e06smtp13.uk.ibm.com (HELO e06smtp13.uk.ibm.com) (195.75.94.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 08 Sep 2014 11:51:33 +0000 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Sep 2014 12:51:29 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 8 Sep 2014 12:51:27 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 46CF62190041 for ; Mon, 8 Sep 2014 12:51:07 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s88BpQVw33816586 for ; Mon, 8 Sep 2014 11:51:26 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s88BpPoi015432 for ; Mon, 8 Sep 2014 05:51:26 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s88BpOJX015412; Mon, 8 Sep 2014 05:51:24 -0600 Message-Id: <201409081151.s88BpOJX015412@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 08 Sep 2014 13:51:24 +0200 Subject: Re: [PATCH] ppc64le/gdbserver: Fix ppc_collect/supply_ptrace_register() routines To: sergiodj@redhat.com (Sergio Durigan Junior) Date: Mon, 08 Sep 2014 11:51:00 -0000 From: "Ulrich Weigand" Cc: emachado@linux.vnet.ibm.com (Edjunior Barbosa Machado), gdb-patches@sourceware.org In-Reply-To: <87oaut4r0u.fsf@redhat.com> from "Sergio Durigan Junior" at Sep 05, 2014 06:54:41 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14090811-2966-0000-0000-0000010DD2C7 X-SW-Source: 2014-09/txt/msg00179.txt.bz2 Sergio Durigan Junior wrote: > On Friday, September 05 2014, Edjunior Barbosa Machado wrote: > > gdb/gdbserver/ > > 2014-09-05 Edjunior Barbosa Machado > > > > * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take > > endianness into account. > > (ppc_supply_ptrace_register): Likewise. > > + if (__BYTE_ORDER == __LITTLE_ENDIAN) > > Why not use gdbarch_byte_order here? We don't use __BYTE_ORDER anywhere > in the code. Well, this is gdbserver code, so there is no gdbarch ... In gdbserver, we usually check for host properties, so the above check seems fine to me. > Same applies for this chunk. > > Otherwise, looks good (it's not an approval). I agree with the rest of Sergio's comments. However, there is one additional problem: >+ /* Big-endian values sit at the right end of the buffer. In case of >+ registers whose size is smaller than sizeof (long), we must use a >+ padding to access it correctly. */ >+ int padding = (sizeof (long) - register_size (regcache->tdesc, regno)); >+ collect_register (regcache, regno, buf + padding); This will be wrong for registers larger than "long", e.g. vector registers. The old code handled them correctly, but this new code does not. Thanks, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com