Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Wu Zhou <woodzltc@cn.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] decimal float point patch based on libdecnumber: gdb  	patch
Date: Tue, 08 Aug 2006 18:16:00 -0000	[thread overview]
Message-ID: <20060808181640.GD24779@nevyn.them.org> (raw)
In-Reply-To: <20060801065125.z43qw6ro74cwwg0w@imap.linux.ibm.com> <20060801055455.9dx55us8vkscw80g@imap.linux.ibm.com>

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


  reply	other threads:[~2006-08-08 18:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-01  9:55 Wu Zhou
2006-08-01 10:51 ` Wu Zhou
2006-08-08 18:16   ` Daniel Jacobowitz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-08-21 16:08 Wu Zhou
2006-08-21 18:30 ` Daniel Jacobowitz
2006-08-21 18:34   ` Wu Zhou
2006-08-22  1:31     ` Daniel Jacobowitz
2006-09-03  8:53       ` Wu Zhou
2006-09-03 16:44         ` Daniel Jacobowitz
2006-09-05  2:34           ` Wu Zhou
2006-07-23  5:48 Wu Zhou
2006-07-23 14:02 ` Daniel Jacobowitz
2006-06-21 21:03 [RFC] decimal float point patch based on libdecnumber: testcase Wu Zhou
2006-06-21 23:36 ` [RFC] decimal float point patch based on libdecnumber: gdb patch Wu Zhou
2006-06-22  3:27   ` Eli Zaretskii
2006-06-22 14:18     ` Wu Zhou
2006-07-12 20:39   ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060808181640.GD24779@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=woodzltc@cn.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox