This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb print /x always big endian order?
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: J K <ellips at yahoo dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 5 Feb 2004 13:04:25 -0500
- Subject: Re: gdb print /x always big endian order?
- References: <20040205180043.68640.qmail@web13509.mail.yahoo.com>
On Thu, Feb 05, 2004 at 10:00:42AM -0800, J K wrote:
>
> Hello,
>
> I've used a simple code to examine the storage
> of a short on a big and little endian machine.
>
> It seems in GNU gdb Red Hat Linux (5.1-1) when
> I do a print /x the order is Big Endian regardless
> of the host architecture. Just wondering if this
> is expected, I didn't see anything in the docs.
Yes, this is expected. Consider:
> short short_val = 31415;
What would C do if you said short_val = 0x7ab7?
> on Little Endian machine:
> Short bytes 0xb7 0x7a
Precisely the same thing :)
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer