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]

[RFA]: Convert the last FP opcode saved by FSAVE into a full opcode


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)

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