From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8237 invoked by alias); 8 Aug 2006 18:16:45 -0000 Received: (qmail 8226 invoked by uid 22791); 8 Aug 2006 18:16:44 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 08 Aug 2006 18:16:43 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GAW88-0006l6-BG; Tue, 08 Aug 2006 14:16:40 -0400 Date: Tue, 08 Aug 2006 18:16:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb-patches@sourceware.org Subject: Re: [RFC] decimal float point patch based on libdecnumber: gdb patch Message-ID: <20060808181640.GD24779@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb-patches@sourceware.org References: <20060801055455.9dx55us8vkscw80g@imap.linux.ibm.com> <20060801065125.z43qw6ro74cwwg0w@imap.linux.ibm.com> <20060801055455.9dx55us8vkscw80g@imap.linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060801065125.z43qw6ro74cwwg0w@imap.linux.ibm.com> <20060801055455.9dx55us8vkscw80g@imap.linux.ibm.com> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00049.txt.bz2 On Tue, Aug 01, 2006 at 05:54:55AM -0400, Wu Zhou wrote: > The order of these bytes are now big-endian, i.e. the first byte is > the most significant one. But it is maken to be the same as the > endianess of the target through routine exchange_dfp (in dfp.c). If > the target is big-endian, no reversion is needed; if it is > little-endian, reversion is needed. This is done through the checking > of gdbarch_byte_order (current_gdbarch): This is what confuses me. Why is it always big-endian in GDB, if it is target-endian in the target? I would have expected it to be host-endian in GDB and target-endian in the target. i386 target ppc64 target i386 host no byteswap need byteswap ppc64 host need byteswap no byteswap Or is it always big-endian? I looked through libdecnumber and I couldn't see any reason for i386 to use little endian ordering in the decimal128 type. > static void > exchange_dfp (const gdb_byte *valaddr, int len, gdb_byte *dec_val) > { > int index; > > if (gdbarch_byte_order (current_gdbarch) == 1) The 1 should be BFD_ENDIAN_LITTLE. > Maybe this can't support cross-debugging (I am not sure though). But > I am planning to take this into consideration. I have one question > first: which data structure is used to describe the host's byte-order > information? Anyone is kind to tell me? There isn't one in GDB right now. We can add one using autoconf if it's really necessary. Let's straighten this out first, and then I'll take a look at the actual patch. -- Daniel Jacobowitz CodeSourcery