This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] fix py-inferior.exp for remote cross-endian testing
- From: Doug Evans <dje at google dot com>
- To: Nathan Froyd <froydnj at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 29 Oct 2010 19:49:44 +0000
- Subject: Re: [PATCH] fix py-inferior.exp for remote cross-endian testing
- References: <1288380039-21997-1-git-send-email-froydnj@codesourcery.com>
On Fri, Oct 29, 2010 at 7:20 PM, Nathan Froyd <froydnj@codesourcery.com> wrote:
> The patch below fixes a problem seen when doing remote testing on a
> target that has a different endianness from the host. ?Python's pack
> function will pack according to host endianness, but the search_memory
> function searches according to target endianness. ?Searching 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. ?Strictly
> 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. ?OK to
> commit?
>
> -Nathan
>
> ? ? ? ?* gdb.python/py-inferior.exp: Pack values in target endianness.
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.]