This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA]: Fix FP handling for non-multiarched targets


> Hi,
> 
> 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!
Andrew


> Corinna
> 
> 2002-02-08  Andrew Cagney  <ac131313@redhat.com>
> Corinna Vinschen  <vinschen@redhat.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,
>  	       0,
>  	       "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,
>  	       0,
>  	       "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,
>  	       0,
>  	       "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,
>  	       0,
> 
> -- 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]