From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7418 invoked by alias); 21 Aug 2006 16:08:43 -0000 Received: (qmail 7410 invoked by uid 22791); 21 Aug 2006 16:08:43 -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; Mon, 21 Aug 2006 16:08:37 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GFCKI-0005mz-UV; Mon, 21 Aug 2006 12:08:35 -0400 Date: Tue, 22 Aug 2006 01:31: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: <20060821160834.GA22192@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb-patches@sourceware.org References: <20060821070736.tr378yu70gk8s8cc@imap.linux.ibm.com> <20060821125031.GA16703@nevyn.them.org> <44E9D816.9070809@cn.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44E9D816.9070809@cn.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/msg00148.txt.bz2 On Mon, Aug 21, 2006 at 11:58:14PM +0800, Wu Zhou wrote: > But as far as I know, the endianess of struct "value" in the target memory > is architecture depedent. To name a example, in value_from_decfloat, we > need to set the raw content of val to the dfp constant user inputed, I am > using this: > memcpy (value_contents_raw (val), decbytes, len); > > decbytes is big-endian on all both x86 and ppc64 platforms. But the > value_contents_raw (val) is little endian on x86 / x86_64 system, and big > endian on ppc64. So exchange_dfp is needed. No, that's not right. The format of the byte buffer in struct value is supposed to match the target representation of the object being described. If this is always big endian on the target, it should be big endian in GDB too. You can think of it like this: struct A { char a, b, c, d, e, f, g, h; }; The first byte in the value buffer is supposed to match "char a", no matter what the target endianness is. Does that help, or am I not understanding the problem? -- Daniel Jacobowitz CodeSourcery