From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20456 invoked by alias); 29 Oct 2010 19:49:53 -0000 Received: (qmail 20446 invoked by uid 22791); 29 Oct 2010 19:49:52 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 Oct 2010 19:49:47 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id o9TJnjZ3032301 for ; Fri, 29 Oct 2010 12:49:45 -0700 Received: from ywa6 (ywa6.prod.google.com [10.192.1.6]) by wpaz37.hot.corp.google.com with ESMTP id o9TJmiXu006895 for ; Fri, 29 Oct 2010 12:49:44 -0700 Received: by ywa6 with SMTP id 6so3250365ywa.40 for ; Fri, 29 Oct 2010 12:49:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.183.200 with SMTP id ch8mr10061349icb.245.1288381784545; Fri, 29 Oct 2010 12:49:44 -0700 (PDT) Received: by 10.220.176.74 with HTTP; Fri, 29 Oct 2010 12:49:44 -0700 (PDT) In-Reply-To: <1288380039-21997-1-git-send-email-froydnj@codesourcery.com> References: <1288380039-21997-1-git-send-email-froydnj@codesourcery.com> Date: Fri, 29 Oct 2010 19:49:00 -0000 Message-ID: Subject: Re: [PATCH] fix py-inferior.exp for remote cross-endian testing From: Doug Evans To: Nathan Froyd Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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: 2010-10/txt/msg00392.txt.bz2 On Fri, Oct 29, 2010 at 7:20 PM, Nathan Froyd wr= ote: > The patch below fixes a problem seen when doing remote testing on a > target that has a different endianness from the host. =A0Python's pack > function will pack according to host endianness, but the search_memory > function searches according to target endianness. =A0Searching for a value > from the former with the latter, then, does not work correctly. > > The solution taken is to discover the target endianness early on using > 'show endian' (the Python interface ought to have a method for this...) > and then use that knowledge to explicitly indicate what endianness > Python's pack function should use for multi-byte values. =A0Strictly > speaking, the change in the final hunk is unnecessary (endianness will > always match in native testing), but is done for completeness. > > Tested with cross to powerpc-linux-gnu from i686-pc-linux-gnu. =A0OK to > commit? > > -Nathan > > =A0 =A0 =A0 =A0* gdb.python/py-inferior.exp: Pack values in target endian= ness. Hi. This patch is ok with me. [btw, one could get the value of endianness from python with gdb.parameter("endian"). Or at least should. On my machine it returns "". We probably want to fix that. Your patch is fine with me as is though.]