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: Wed, 12 Jul 2006 20:39:00 -0000 [thread overview]
Message-ID: <20060712203912.GR24622@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0606220711110.2734@localhost.localdomain>
On Thu, Jun 22, 2006 at 07:36:17AM +0800, Wu Zhou wrote:
>
> Appended is the patch. I had tested it with the latest gcc-4.2 cvs tree
> on x86, with option "--enable-decimal-float". All the 121 tests passed.
> Please review and comment. Thanks a lot.
Sometimes you use DECDBL and sometimes you use DECDOUBLE and sometimes
you use DECFLOAT and sometimes you use DECFLT. Let's pick one or the
other and use it everywhere. This makes it easier to search for
code that knows about decimal float. "decfloat" might be more
readable?
Why is reverse_dfp necessary? It says GDB uses the opposite endianness
from decNumber, but I don't see why. This might be a related problem,
but are you accomodating target endianness when you read values from
the target? If not, a cross debugger will do the wrong thing.
> Index: expression.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/expression.h,v
> retrieving revision 1.18
> diff -u -r1.18 expression.h
> --- expression.h 17 Dec 2005 22:33:59 -0000 1.18
> +++ expression.h 21 Jun 2006 23:08:51 -0000
> @@ -327,6 +327,11 @@
> /* A F90 array range operator (for "exp:exp", "exp:", ":exp" and ":"). */
> OP_F90_RANGE,
>
> + /* OP_DECDOUBLE is followed by a type pointer in the next exp_element
> + and a dec long constant value in the following exp_element.
> + Then comes another OP_DECDOUBLE. */
> + OP_DECDOUBLE,
> +
A comment on the format of the data would be nice here. Is it in
target byte order?
> Index: c-valprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-valprint.c,v
> retrieving revision 1.39
> diff -u -r1.39 c-valprint.c
> --- c-valprint.c 18 Jan 2006 21:24:19 -0000 1.39
> +++ c-valprint.c 21 Jun 2006 23:08:52 -0000
> @@ -442,6 +442,17 @@
> }
> break;
>
> + case TYPE_CODE_DECFLT:
> + if (format)
> + {
> + print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
> + }
> + else
> + {
> + print_decimal_floating (valaddr + embedded_offset, type, stream);
> + }
> + break;
> +
> case TYPE_CODE_METHOD:
> {
> struct value *v = value_at (type, address);
You don't need the braces in this; please omit them when you don't need
to. It saves a level of indentation, which generally makes them easier
to read.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-07-12 20:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2006-06-22 20:25 ` [RFC] decimal float point patch based on libdecnumber: testcase Daniel Jacobowitz
2006-06-22 23:27 ` Wu Zhou
2006-06-23 2:38 ` Daniel Jacobowitz
2006-06-23 18:39 ` Wu Zhou
2006-06-23 18:49 ` Daniel Jacobowitz
2006-06-23 19:25 ` Wu Zhou
2006-06-23 19:51 ` Daniel Jacobowitz
2006-07-23 5:48 [RFC] decimal float point patch based on libdecnumber: gdb patch Wu Zhou
2006-07-23 14:02 ` Daniel Jacobowitz
2006-08-01 9:55 Wu Zhou
2006-08-01 10:51 ` Wu Zhou
2006-08-08 18:16 ` Daniel Jacobowitz
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
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=20060712203912.GR24622@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