From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18901 invoked by alias); 5 Feb 2004 18:04:26 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18894 invoked from network); 5 Feb 2004 18:04:26 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 5 Feb 2004 18:04:26 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AonrV-0006O5-G5; Thu, 05 Feb 2004 13:04:25 -0500 Date: Thu, 05 Feb 2004 18:04:00 -0000 From: Daniel Jacobowitz To: J K Cc: gdb@sources.redhat.com Subject: Re: gdb print /x always big endian order? Message-ID: <20040205180424.GA24460@nevyn.them.org> Mail-Followup-To: J K , gdb@sources.redhat.com References: <20040205180043.68640.qmail@web13509.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040205180043.68640.qmail@web13509.mail.yahoo.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-02/txt/msg00046.txt.bz2 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