This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH RFA] Fix x86 floating point vs. thread problem
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 6 Dec 2001 19:01:03 -0500
- Subject: Re: [PATCH RFA] Fix x86 floating point vs. thread problem
- References: <1011206234806.ZM8667@ocotillo.lan>
On Thu, Dec 06, 2001 at 04:48:07PM -0700, Kevin Buettner wrote:
> The patch below fixes the problem reported by David Relson in
>
> http://sources.redhat.com/ml/gdb/2001-12/msg00001.html
>
> An impressive test matrix regarding this bug has been provided by
> Emmanuel Blindauer at
>
> http://manu.agat.net/bug.html
>
> Anyway, the problem is that GDB is computing the fpxregs version of
> the tag value incorrectly. The fpxregs version of the tag value is
> simply a bitmask (of eight bits) which indicate which of the floating
> point registers is in use. i387_fill_fxsave() was incorrectly
> shifting by twice the the number of bits that it should have.
>
> * i387-nat.c (i387_fill_fxsave): Change type of ``val'' from char
> to short so that we don't memcpy() beyond the end of this buffer.
> Also, change shift value used in computing val to account for the
> fact that only eight bits are used.
Out of curiousity, can you explain what I saw when looking at this? I
found that we never set any fp-related register, and yet when the value
of d was written to memory it was incorrect. Was it not actually yet
written to memory, or was I just mistaken?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer