gdb print /x always big endian order?
Daniel Jacobowitz
drow@mvista.com
Thu Feb 5 18:04:00 GMT 2004
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
More information about the Gdb
mailing list