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]

Re: Problems with i386_register_convert_to_virtual


> From: Robert Hoehne <robert.hoehne@gmx.net>
> Date: Sun, 6 Aug 2000 00:54:05 +0200
> 
> void
> i386_register_convert_to_virtual (int regnum, struct type *type,
> 				  char *from, char *to)
> {
>   /* Copy straight over, but take care of the padding.  */
>   memcpy (to, from, FPU_REG_RAW_SIZE);
>   memset (to + FPU_REG_RAW_SIZE, 0, TYPE_LENGTH (type) - FPU_REG_RAW_SIZE);
> }
> 
> -- snip --
> 
> When I see correct, this function assumes only to be called
> for long double types.

Yes.

> But since this function is called using the
> REGISTER_CONVERT_TO_VIRTUAL macro, it can get be called for any
> (register) type.

Do we have any other registers that have different virtual and raw
representations?  I thought that FP registers were the only ones.

I agree that it would be good to have some protection against invalid
use of REGISTER_CONVERT_TO_VIRTUAL, but the case you are describing
looks like a call to the wrong function, which valid code should not
do.

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