This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix py-inferior.exp for remote cross-endian testing


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.]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]