This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: [PATCH RFA] store_floating(), extract_floating() fixes


Kevin Buettner wrote:
> 
> I'd like approval for committing the patch below.  The rationale for
> these fixes may be found in my message from earlier today entitled
> "store_floating() rewrite (was Re: bug in arm_push_arguments())".
> 
> My rewrite of store_floating() was incorrect in that message though.
> It fails to take into account the size of the float when doing the
> memcpy (when the float formats are the same).
> 
> I've tested the following patch on linux/x86 and linux/ppc and saw
> no regressions.
> 
>         * findvar.c (extract_floating, store_floating): Use target
>         floating point type sizes rather host sizes to determine
>         which conversion needs to be done.
> 

Ha! The're dull and booring - you need to live on the edge :-)
Trying a x86(le)->d10v(be) (which can have sizeof(double)==32) I saw no
regressions.

-  if (len == sizeof (float))
+  if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)

The only other question is with ``TARGET_CHAR_BIT'' and len. Looking in
gdbtypes.c, the length was computed using
TARGET_FLAOT_BIT/TARGET_CHAR_BIT so this would be correct.

Approved.

	Andrew

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