This is the mail archive of the
mailing list for the GDB project.
Re: [RFA]: Fix FP handling for non-multiarched targets
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches <gdb-patches at sources dot redhat dot com>
- Date: Fri, 08 Feb 2002 12:05:55 -0500
- Subject: Re: [RFA]: Fix FP handling for non-multiarched targets
- References: <20020208163918.Q14241@cygbert.vinschen.de>
> I'd like to propose the following patch.
> While running the testsuite on ARM several FP errors happened,
> which apparently were a result of forcing the wrong FP type
> on `builtin_type_float' and friends. This is a result of
> three lines in gdbtype.c which override the target specific
> types with another one. Thanks to Andrew Cagney for helping
> to track that down.
Sigh. This kind of highlights why non- multi-arch targets need to just
go away. It isn't so much that the code override the target type but
rather that it is correctly setting it. On a multi-arch target this is
fine - everytime the architecture changes, the builtin_type_float's
floatformat is updated. On a non-multi-arch target though, it it is a
disaster. It is never updated leaving builtin_type_float et.al. with
the initial (big-endian?) value.
Corinna, rather than just delete those lines can you wrap them in #if 0
/ #endif and then add a comment explaining the need to disable them.
Can you then also file a bug report (change request) to record the
problem. Once everything is multi-arch, the code can be re-enabled.
Thanks for finding this!
> 2002-02-08 Andrew Cagney <firstname.lastname@example.org>
> Corinna Vinschen <email@example.com>
> * gdbtypes.c (build_gdbtypes): Don't force a specific
> float format on builtin float types.
> Index: gdbtypes.c
> RCS file: /cvs/src/src/gdb/gdbtypes.c,v
> retrieving revision 1.40
> diff -u -p -r1.40 gdbtypes.c
> --- gdbtypes.c 2002/02/03 23:18:11 1.40
> +++ gdbtypes.c 2002/02/08 15:32:20
> @@ -3153,17 +3153,14 @@ build_gdbtypes (void)
> init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
> "float", (struct objfile *) NULL);
> - TYPE_FLOATFORMAT (builtin_type_float) = TARGET_FLOAT_FORMAT;
> builtin_type_double =
> init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
> "double", (struct objfile *) NULL);
> - TYPE_FLOATFORMAT (builtin_type_double) = TARGET_DOUBLE_FORMAT;
> builtin_type_long_double =
> init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
> "long double", (struct objfile *) NULL);
> - TYPE_FLOATFORMAT (builtin_type_long_double) = TARGET_LONG_DOUBLE_FORMAT;
> builtin_type_complex =
> init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,