From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14578 invoked by alias); 18 Nov 2011 19:41:03 -0000 Received: (qmail 14569 invoked by uid 22791); 18 Nov 2011 19:41:01 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Nov 2011 19:40:47 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F354B2BB327; Fri, 18 Nov 2011 14:40:41 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JnF3bEoeVMmL; Fri, 18 Nov 2011 14:40:41 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C77362BB321; Fri, 18 Nov 2011 14:40:41 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E01AA145615; Fri, 18 Nov 2011 14:40:39 -0500 (EST) Date: Fri, 18 Nov 2011 19:41:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: gdb-patches@sourceware.org, tromey@redhat.com Subject: Re: Checked in: [RFA] read_frame_register_value and big endian arches Message-ID: <20111118194039.GE2703@adacore.com> References: <20111118020121.GA2703@adacore.com> <201111181740.pAIHe4Vc023523@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111181740.pAIHe4Vc023523@d06av02.portsmouth.uk.ibm.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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 X-SW-Source: 2011-11/txt/msg00509.txt.bz2 > This fixes the regressions on SPU for me. Does this work for the > platforms where you were seeing issues as well? Thanks for doing this, Ulrich. I tested the patch on x86_64-linux for kicks, but also on sparc-elf and avr, where the problems where detected, and no regression. > ChangeLog: > > * findvar.c (read_frame_register_value): Respect value_offset > of the register value. Remove big-endian special case. Just one tiny detail: > + struct gdbarch *gdbarch = get_frame_arch (frame); > int offset = 0; > + int reg_offset = value_offset (value); > int regnum = VALUE_REGNUM (value); > const int len = TYPE_LENGTH (check_typedef (value_type (value))); ^^^^^ I had to remove the const, since we are decrementing len each time we read contents from a register... -- Joel