This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Problems with i386_register_convert_to_virtual
- To: robert dot hoehne at gmx dot net
- Subject: Re: Problems with i386_register_convert_to_virtual
- From: Eli Zaretskii <eliz at delorie dot com>
- Date: Sun, 6 Aug 2000 03:23:47 -0400 (EDT)
- CC: gdb-patches at sourceware dot cygnus dot com
- References: <200008052252.AAA22962@robby.dittmannsdorf.de>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> 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.