This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA]: Convert the last FP opcode saved by FSAVE into a full opcode
- To: gdb-patches at sources dot redhat dot com
- Subject: [RFA]: Convert the last FP opcode saved by FSAVE into a full opcode
- From: Eli Zaretskii <eliz at delorie dot com>
- Date: Thu, 8 Feb 2001 13:28:14 -0500 (EST)
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
This patch restores the 5 bits of the last FP opcode which are not
delivered by FSAVE/FXSAVE. This shows the full opcode in "info
float", and may be used to display the opcode as a mnemonic, or look
it up in a list of instructions.
The DJGPP port was doing this for quite some time. Now I'm converting
go32-nat.c to using i387-nat.c, and I'd hate to lose the feature.
Okay?
2001-02-07 Eli Zaretskii <eliz@is.elta.co.il>
* i387-nat.c (i387_supply_fsave): Restore the 5 bits of the FPU's
opcode that are not provided by FSAVE/FNSAVE.
(i387_supply_fxsave): Likewise.
--- gdb/i387-nat.c~0 Thu Aug 10 17:54:50 2000
+++ gdb/i387-nat.c Wed Feb 7 20:40:02 2001
@@ -76,6 +76,12 @@ i387_supply_fsave (char *fsave)
if (i == FOP_REGNUM)
{
val &= ((1 << 11) - 1);
+ /* Feature: restore the 5 bits of the opcode that are
+ missing in the data supplied by FSAVE/FNSAVE. This
+ shows the opcode in its full glory, in case someone
+ wants to produce a mnemonic from it. */
+ if (val)
+ val |= 0xd800;
supply_register (i, (char *) &val);
}
else
@@ -185,6 +191,12 @@ i387_supply_fxsave (char *fxsave)
if (i == FOP_REGNUM)
{
val &= ((1 << 11) - 1);
+ /* Feature: restore the 5 bits of the opcode that are
+ missing in the data supplied by FSAVE/FNSAVE. This
+ shows the opcode in its full glory, in case someone
+ wants to produce a mnemonic from it. */
+ if (val)
+ val |= 0xd800;
supply_register (i, (char *) &val);
}
else if (i== FTAG_REGNUM)