This is the mail archive of the gdb@sources.redhat.com 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: gdb print /x always big endian order?


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


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