This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch 2/4] decimal floating point types
- From: Daniel Jacobowitz <drow at false dot org>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 11 Oct 2007 11:57:21 -0400
- Subject: Re: [patch 2/4] decimal floating point types
- References: <20070920215410.062714003@br.ibm.com> <20070920215539.651720008@br.ibm.com>
On Thu, Sep 20, 2007 at 06:54:12PM -0300, Thiago Jung Bauermann wrote:
> + case DW_ATE_decimal_float:
> + if (size == 16)
> + {
> + type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_DECFLOAT, cu);
> + }
> + else if (size == 8)
> + {
> + type = dwarf2_fundamental_type (objfile, FT_EXT_PREC_DECFLOAT, cu);
> + }
> + else
> + type = dwarf2_fundamental_type (objfile, FT_DECFLOAT, cu);
> + return type;
You don't need a bunch of those extra braces.
> + /* The following three are about decimal floating point types, which
> + are 32-bits, 64-bits and 128-bits respectively. */
> + builtin_type->builtin_decfloat =
> + init_type (TYPE_CODE_DECFLOAT, 32 / 8,
> + 0,
> + "decimal float", (struct objfile *) NULL);
I think our convention is to put the equals sign after the line break.
> void
> +print_decimal_floating (const gdb_byte *valaddr, struct type *type,
> + struct ui_file *stream)
> +{
> + char decstr[128];
> + unsigned len = TYPE_LENGTH (type);
> +
> + decimal_to_string (valaddr, len, decstr);
> + fputs_filtered (decstr, stream);
> + return;
> +}
Does the libdecnumber API specify that 128 bytes is enough? If so
this should be a constant in dfp.h.
--
Daniel Jacobowitz
CodeSourcery