From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11940 invoked by alias); 3 Jun 2009 04:03:21 -0000 Received: (qmail 11063 invoked by uid 22791); 3 Jun 2009 04:03:16 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_24,J_CHICKENPOX_25,J_CHICKENPOX_41,J_CHICKENPOX_53 X-Spam-Check-By: sourceware.org Received: from web36204.mail.mud.yahoo.com (HELO web36204.mail.mud.yahoo.com) (209.191.68.230) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 03 Jun 2009 04:03:09 +0000 Received: (qmail 87260 invoked by uid 60001); 3 Jun 2009 04:03:06 -0000 Message-ID: <458171.86578.qm@web36204.mail.mud.yahoo.com> Received: from [123.238.26.185] by web36204.mail.mud.yahoo.com via HTTP; Tue, 02 Jun 2009 21:03:05 PDT Date: Wed, 03 Jun 2009 04:03:00 -0000 From: paawan oza Subject: Re: Submition of i386.record.floating.point.patch To: Hui Zhu Cc: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00030.txt.bz2 Hi Hui, I am not sure,=20 but as I understood you are asking for more example programs ? -> the example program what I have written, includes most of the basic floa= ting point assmebly isns. -> only one thing is ; I have referred d8-df opcode map in appendix-B intel= insn manual, which assures us that I havent missed anything and it should = work for the rest of the insns as well. -> the insn like FRSTOR, FLDENV might not have been tested. -> or may be I can test some more insns, by writing gcc inline assembly as = far as possible. I am not sure how much it can be assured. What do you say ? Regards, Oza. --- On Wed, 6/3/09, Hui Zhu wrote: > From: Hui Zhu > Subject: Re: Submition of i386.record.floating.point.patch > To: "paawan oza" > Cc: gdb-patches@sourceware.org > Date: Wednesday, June 3, 2009, 8:27 AM > On Wed, Jun 3, 2009 at 01:58, paawan > oza > wrote: > > Hi Hui, > > > > I think, you have applied the old patch which I had > sent earlier with in tar format. > > the correct patch was in the email body. > > > > I am attaching correct patch, please find it > attached. > > the patch is tested against the example program which > I have sent. > > >=20 > OK.=A0 It works. > Could you post some example about howto make sure it works > OK? >=20 > > > > > > --- On Tue, 6/2/09, Hui Zhu > wrote: > > > >> From: Hui Zhu > >> Subject: Re: Submition of > i386.record.floating.point.patch > >> To: "paawan oza" > >> Cc: gdb-patches@sourceware.org > >> Date: Tuesday, June 2, 2009, 12:27 PM > >> On Mon, Jun 1, 2009 at 22:54, paawan > >> oza > >> wrote: > >> > > >> > Hi, > >> > > >> > I am sorry for the inconvenience caused last > time, > >> during patch submition. > >> > this time I am trying to post everything in > email > >> body. > >> > > >> > > >> > ****************************************************** > >> > ChangeLog: > >> > > >> > ****************************************************** > >> > Current: gdb-6.8.50.20090531 > >> > 2009-05-31 =A0Oza =A0 > >> > > >> > =A0 =A0 =A0 =A0* i386-tdep.c: Support for > floating point > >> recording. > >> > =A0 =A0 =A0 =A0* i386-tdep.h: floating point > registers > >> enumaration added. > >> > > >> > ------------------------------------------------------- > >> > > >> > > >> > ****************************************************** > >> > README: > >> > > >> > ****************************************************** > >> > Patch description: > >> > > >> > -> Provides floating point support for > i386 > >> =A0(reversible debugging:record-replay) > >> > -> previously gdb was not recording > floating point > >> registers, now all the floating point registers > which are > >> likely to be changed by floating =A0 point > instructions, are > >> recorded and replayed. > >> > -> the patch intends to provide the full > support > >> for all i386 floating point instructions. > >> > > >> > --------------------------------------------------------- > >> > > >> > > >> > > >> > > >> > ****************************************************** > >> > Patch:i386-record-floats.patch > >> > > >> > ****************************************************** > >> > diff -urN gdb.orig/i386-tdep.c > gdb.new/i386-tdep.c > >> > --- gdb.orig/i386-tdep.c =A0 =A0 =A0 > =A02009-05-29 > >> 17:08:40.000000000 -0400 > >> > +++ gdb.new/i386-tdep.c 2009-06-01 > 20:02:23.000000000 > >> -0400 > >> > @@ -543,6 +543,9 @@ > >> > =A0/* The maximum number of saved registers. > =A0This > >> should include all > >> > =A0 =A0registers mentioned above, and %eip. > =A0*/ > >> > =A0#define I386_NUM_SAVED_REGS =A0 > =A0I386_NUM_GREGS > >> > +#define I386_SAVE_FPU_REGS =A0 =A0 =A0 =A0 =A0 =A0 > 0xFFFD > >> > +#define I386_SAVE_FPU_ENV =A0 =A0 =A0 =A0 =A0 =A0 > =A00xFFFE > >> > +#define I386_SAVE_FPU_ENV_REG_STACK =A0 > =A00xFFFF > >> > > >> > =A0struct i386_frame_cache > >> > =A0{ > >> > @@ -2985,6 +2988,54 @@ > >> > =A0 return 0; > >> > =A0} > >> > > >> > +/* Record the value of floating point > registers which > >> will be changed by the current instruction > >> > + =A0 to "record_arch_list". > >> > + =A0 return -1 if something is wrong. */ > >> > + > >> > +static int i386_record_floats(struct > i386_record_s > >> *ir, uint32_t iregnum) > >> > +{ > >> > + =A0int i; > >> > + > >> > + =A0/* Oza : push/pop of fpu stack is going > to happen > >> > + =A0 =A0 currently we store st0-st7 registers, > but we > >> need not store all registers all the time. > >> > + =A0 =A0 using fstatus, we use 11-13 bits > which gives > >> us stack top and hence we optimize our storage. > */ > >> > + =A0if (I386_SAVE_FPU_REGS =3D=3D iregnum) > >> > + =A0 =A0{ > >> > + =A0 =A0 =A0for > >> (i=3DI386_ST0_REGNUM;i<=3DI386_ST7_REGNUM;i++) > >> > + =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0if (record_arch_list_add_reg > >> (ir->regcache,i)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0} > >> > + =A0 =A0} > >> > + =A0else if (I386_SAVE_FPU_ENV =3D=3D iregnum) > >> > + =A0 =A0{ > >> > + =A0 =A0 =A0for > (i=3DI386_FCTRL;i<=3DI386_FOP;i++) > >> > + =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0if (record_arch_list_add_reg > >> (ir->regcache,i)) > >> > + =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0} > >> > + =A0 =A0} > >> > + =A0else if (I386_SAVE_FPU_ENV_REG_STACK =3D=3D > iregnum) > >> > + =A0 =A0{ > >> > + =A0 =A0 =A0for > (i=3DI386_ST0_REGNUM;i<=3DI386_FOP;i++) > >> > + =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0if (record_arch_list_add_reg > >> (ir->regcache,i)) > >> > + =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0} > >> > + =A0 =A0} > >> > + =A0else if (iregnum >=3D I386_ST0_REGNUM > && > >> iregnum <=3D I386_FOP) > >> > + =A0 =A0{ > >> > + =A0 =A0 =A0if (record_arch_list_add_reg > >> (ir->regcache,iregnum)) > >> > + =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0} > >> > + =A0else > >> > + =A0 =A0{ > >> > + =A0 =A0 =A0/* param Error */ > >> > + =A0 =A0 =A0return -1; > >> > + =A0 =A0} > >> > + =A0return 0; > >> > +} > >> > + > >> > =A0/* Parse the current instruction and record > the > >> values of the registers and > >> > =A0 =A0memory that will be changed in current > >> instruction to "record_arch_list". > >> > =A0 =A0Return -1 if something wrong. */ > >> > @@ -4035,7 +4086,6 @@ > >> > =A0 =A0 =A0 break; > >> > > >> > =A0 =A0 =A0 /* floats */ > >> > - =A0 =A0 =A0/* It just record the memory change > of > >> instrcution. */ > >> > =A0 =A0 case 0xd8: > >> > =A0 =A0 case 0xd9: > >> > =A0 =A0 case 0xda: > >> > @@ -4056,39 +4106,49 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > =A0 =A0 =A0 =A0 =A0switch (ir.reg) > >> > =A0 =A0 =A0 =A0 =A0 =A0{ > >> > - =A0 =A0 =A0 =A0 =A0 case 0x00: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x01: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x02: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x03: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x12: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x22: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x32: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 /* for FCOM, FICOM > nothing to do > >> */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0x03: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x13: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x23: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x33: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 /* FCOMP, FICOMP pop FPU > stack, > >> store all */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 case 0x00: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 case 0x01: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x04: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x05: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x06: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x07: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x10: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x11: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x12: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x13: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 case 0x11: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x14: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x15: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x16: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x17: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x20: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x21: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x22: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x23: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x24: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x25: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x26: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x27: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x30: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x31: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x32: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x33: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x34: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x35: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x36: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x37: > >> > - =A0 =A0 =A0 =A0 =A0 =A0 break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 /* FADD, FMUL, FSUB, > FSUBR, FDIV, > >> FDIVR, FIADD, FIMUL, FISUB, FISUBR, FIDIV, FIDIVR > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0ModR/M.reg is an > extension of > >> code, always affects st(0) register */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x08: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x0a: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x0b: > >> > @@ -4096,6 +4156,7 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x19: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x1a: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x1b: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x1d: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x28: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x29: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x2a: > >> > @@ -4103,11 +4164,16 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x38: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x39: > >> > =A0 =A0 =A0 =A0 =A0 =A0case 0x3a: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x3b: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x3b: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x3c: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x3d: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (ir.reg & 7) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0: > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* FLD, FILD */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 1: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (ir.reg > >> 4) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > @@ -4120,6 +4186,7 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 3: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0default: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (record_arch_list_add_mem (addr, 2)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > @@ -4130,15 +4197,42 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (ir.reg > >> 4) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (record_arch_list_add_mem (addr, 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (3 =3D=3D > (ir.reg & > >> 7)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FSTP > m32fp */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 1: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (record_arch_list_add_mem (addr, 4)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((3 =3D=3D > (ir.reg > >> & 7)) || (5 =3D=3D (ir.reg & 7)) || (7 =3D=3D > (ir.reg & > >> 7))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FSTP > */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 2: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (record_arch_list_add_mem (addr, 8)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (3 =3D=3D > (ir.reg & > >> 7)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FSTP > m64fp */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 3: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((3 <=3D > (ir.reg > >> & 7)) && (6 <=3D (ir.reg & 7))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > FISTP, FBLD, > >> FILD, FBSTP */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0default: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (record_arch_list_add_mem (addr, 2)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > @@ -4147,54 +4241,71 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > - =A0 =A0 =A0 =A0 =A0 case 0x0c: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x0d: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x1d: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x2c: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x3c: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x3d: > >> > - =A0 =A0 =A0 =A0 =A0 =A0 break; > >> > - =A0 =A0 =A0 =A0 =A0 case 0x0e: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x0c: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 /* FLDENV */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_ENV_REG_STACK)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 case 0x0d: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FLDCW */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_FCTRL)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 case 0x2c: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FRTSTOR */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_ENV_REG_STACK)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 break; > >> > + =A0 =A0 =A0 =A0 =A0 case 0x0e: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ir.dflag) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 28)) > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 28)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 14)) > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 14)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > - =A0 =A0 =A0 =A0 =A0 case 0x0f: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x2f: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x0f: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x2f: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (record_arch_list_add_mem > >> (addr, 2)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > - =A0 =A0 =A0 =A0 =A0 case 0x1f: > >> > - =A0 =A0 =A0 =A0 =A0 case 0x3e: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x1f: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x3e: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (record_arch_list_add_mem > >> (addr, 10)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FSTP, FBSTP */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > - =A0 =A0 =A0 =A0 =A0 case 0x2e: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x2e: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ir.dflag) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 28)) > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr +=3D 28; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 28)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr +=3D 28; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 14)) > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr +=3D 14; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (record_arch_list_add_mem > >> (addr, 14)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr +=3D 14; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (record_arch_list_add_mem > >> (addr, 80)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0/* FSAVE */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_ENV_REG_STACK)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > - =A0 =A0 =A0 =A0 =A0 case 0x3f: > >> > + =A0 =A0 =A0 =A0 =A0 case 0x3f: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (record_arch_list_add_mem > >> (addr, 8)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* FISTP */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0default: > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0ir.addr -=3D 2; > >> > @@ -4202,9 +4313,180 @@ > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0goto no_support; > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > =A0 =A0 =A0 =A0 =A0 =A0} > >> > - =A0 =A0 =A0 } > >> > + =A0 =A0 =A0 } > >> > + =A0 =A0 =A0 =A0/* opcode is an extension of > modR/M byte > >> */ > >> > + =A0 =A0 =A0 else > >> > + =A0 =A0 =A0 { > >> > + =A0 =A0 =A0 =A0 =A0switch (opcode) > >> > + =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xd8: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if > (i386_record_floats(&ir, > >> I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xd9: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if (0x0c =3D=3D (ir.modrm > >> > >> 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((ir.modrm > & 0x0f) > >> <=3D 7) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* if only > st(0) is > >> changing, then we have already recorded */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((ir.modrm > & > >> 0x0f) - 0x08) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > ((ir.modrm > >> & 0x0f) - 0x08))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch(ir.modrm) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xe0: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xe1: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf0: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf5: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf8: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xfa: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xfc: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xfe: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xff: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf1: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf2: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf3: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf4: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf6: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf7: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xe8: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xe9: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xea: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xeb: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xec: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xed: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xee: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xf9: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xfb: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 0xfd: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST1_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xda: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if (0xe9 =3D=3D ir.modrm) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0else if ((0x0c =3D=3D > ir.modrm > >> >> 4) || (0x0d =3D=3D ir.modrm >> 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (((ir.modrm & > 0x0f) > >> > 0) && ((ir.modrm & 0x0f) <=3D > 7)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > (ir.modrm > >> & 0x0f))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else if ((ir.modrm > & > >> 0x0f) - 0x08) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > ((ir.modrm > >> & 0x0f) - 0x08))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xdb: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if (0xe3 =3D=3D ir.modrm) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > (i386_record_floats(&ir, > >> I386_SAVE_FPU_ENV)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0else if ((0x0c =3D=3D > ir.modrm > >> >> 4) || (0x0d =3D=3D ir.modrm >> 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (((ir.modrm & > 0x0f) > >> > 0) && ((ir.modrm & 0x0f) <=3D > 7)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > (ir.modrm > >> & 0x0f))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else if ((ir.modrm > & > >> 0x0f) - 0x08) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > ((ir.modrm > >> & 0x0f) - 0x08))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xdc: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((0x0c =3D=3D ir.modrm > >> > >> 4) || (0x0d =3D=3D ir.modrm >> 4) || (0x0f =3D=3D > ir.modrm > >> >> 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((ir.modrm & > 0x0f) > >> <=3D 7) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > (ir.modrm > >> & 0x0f))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > ((ir.modrm > >> & 0x0f) - 0x08))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xdd: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if (0x0c =3D=3D ir.modrm > >> > >> 4) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir,I386_FTAG)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0else if ((0x0d =3D=3D > ir.modrm > >> >> 4) || (0x0e =3D=3D ir.modrm >> 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((ir.modrm > & 0x0f) > >> <=3D 7) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_ST0_REGNUM + > (ir.modrm > >> & 0x0f))) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return > -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xde: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((0x0c =3D=3D ir.modrm > >> > >> 4) || (0x0e =3D=3D ir.modrm >> 4) || (0x0f =3D=3D > ir.modrm > >> >> 4) || (0xd9 =3D=3D ir.modrm)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0case 0xdf: > >> > + =A0 =A0 =A0 =A0 =A0 =A0 if (0xe0 =3D=3D ir.modrm) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (record_arch_list_add_reg (ir.regcache, > I386_EAX_REGNUM)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0else if ((0x0f =3D=3D > ir.modrm > >> >> 4) || (0x0e =3D=3D ir.modrm >> 4)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if > >> (i386_record_floats(&ir, I386_SAVE_FPU_REGS)) > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -1; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > >> > + =A0 =A0 =A0 =A0 =A0 =A0} > >> > + =A0 =A0 =A0 =A0} > >> > =A0 =A0 =A0 break; > >> > - > >> > =A0 =A0 =A0 /* string ops */ > >> > =A0 =A0 =A0 /* movsS */ > >> > =A0 =A0 case 0xa4: > >> > @@ -4623,10 +4905,17 @@ > >> > =A0 =A0 =A0 /* fwait */ > >> > =A0 =A0 =A0 /* XXX */ > >> > =A0 =A0 case 0x9b: > >> > - =A0 =A0 =A0printf_unfiltered (_("Process > record doesn't > >> support instruction " > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0"fwait.\n")); > >> > - =A0 =A0 =A0ir.addr -=3D 1; > >> > - =A0 =A0 =A0goto no_support; > >> > + =A0 =A0 =A0if (target_read_memory (ir.addr, > &tmpu8, > >> 1)) > >> > + =A0 =A0 =A0 { > >> > + =A0 =A0 =A0 =A0 if (record_debug) > >> > + =A0 =A0 =A0 =A0 =A0 printf_unfiltered > (_("Process record: > >> error reading memory at " > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0"addr > >> 0x%s len =3D 1.\n"), > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0paddr_nz > >> (ir.addr)); > >> > + =A0 =A0 =A0 =A0 return -1; > >> > + =A0 =A0 =A0 } > >> > + =A0 =A0 =A0opcode =3D (uint32_t) tmpu8; > >> > + =A0 =A0 =A0ir.addr++; > >> > + =A0 =A0 =A0goto reswitch; > >> > =A0 =A0 =A0 break; > >> > > >> > =A0 =A0 =A0 /* int3 */ > >> > diff -urN gdb.orig/i386-tdep.h > gdb.new/i386-tdep.h > >> > --- gdb.orig/i386-tdep.h =A0 =A0 =A0 > =A02009-05-17 > >> 17:56:44.000000000 -0400 > >> > +++ gdb.new/i386-tdep.h 2009-05-31 > 16:33:14.000000000 > >> -0400 > >> > @@ -145,7 +145,22 @@ > >> > =A0 I386_ES_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 =A0/* %es > */ > >> > =A0 I386_FS_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 =A0/* %fs > */ > >> > =A0 I386_GS_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 =A0/* %gs > */ > >> > - =A0I386_ST0_REGNUM =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > %st(0) */ > >> > + =A0I386_ST0_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(0) */ > >> > + =A0I386_ST1_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(1) */ > >> > + =A0I386_ST2_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(2) */ > >> > + =A0I386_ST3_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(3) */ > >> > + =A0I386_ST4_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(4) */ > >> > + =A0I386_ST5_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(5) */ > >> > + =A0I386_ST6_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(6) */ > >> > + =A0I386_ST7_REGNUM, =A0 =A0 =A0 =A0 =A0 =A0 /* > %st(7) */ > >> > + =A0I386_FCTRL, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* > floating > >> point env regs : FCTRL-FOP */ > >> > + =A0I386_FSTAT, > >> > + =A0I386_FTAG, > >> > + =A0I386_FISEG, > >> > + =A0I386_FIOFF, > >> > + =A0I386_FOSEG, > >> > + =A0I386_FOOFF, > >> > + =A0I386_FOP > >> > =A0}; > >> > > >> > >> About this part, I think this is my mistake. =A0I > didn't > >> take fp work > >> for now very clear (Or I am still not clear with > x86 fp). > >> FCTRL, FOP and so on are the fp reg of amd64. > =A0For > >> now, prec is still > >> not support amd64 (I am working on it). > >> And amd64's support are in amd64-tedp.... files. > >> Change i386_regnum > >> is not a good idea. > >> > >> I suggest you divide fp patch to 2 parts. One is > for i386, > >> the other for amd64. > >> For now, just send i386 patch for review. =A0And > send > >> amd64 patch when > >> prec support amd64. > >> >=20 > What do you think about my idea? >=20 >=20 > Thanks, > Hui >=20 >=20 > >> > >> > >> > =A0#define I386_NUM_GREGS 16 > >> > > >> > > >> > > >> > > >> > > >> > ******************************************************* > >> > test-example which does basic verification > for the > >> patch. > >> > > >> > ******************************************************* > >> > > >> > #include > >> > #include > >> > > >> > int main() > >> > { > >> > =A0 =A0 =A0 =A0float > no1,no2,no3,no4,no5,no6,no7; > >> > =A0 =A0 =A0 =A0double x =3D 100.345, y =3D 25.7789; > >> > =A0 =A0 =A0 =A0long double ldx =3D > 88888888888888888888.88, > >> ldy =3D 9999999999999999999.99; > >> > =A0 =A0 =A0 =A0float result,resultd,resultld; > >> > =A0 =A0 =A0 =A0no1 =3D 10.45; > >> > =A0 =A0 =A0 =A0no2 =3D 20.77; > >> > =A0 =A0 =A0 =A0no3 =3D 156.89874646; > >> > =A0 =A0 =A0 =A0no4 =3D 14.56; > >> > =A0 =A0 =A0 =A0no5 =3D 11.11; > >> > =A0 =A0 =A0 =A0no6 =3D 66.77; > >> > =A0 =A0 =A0 =A0no7 =3D 88.88; > >> > > >> > =A0 =A0 =A0 =A0result =3D no1 + no2 + no3 + no4 + > no5 + no6 > >> + no7; > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D fmodf(no2,no1); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0resultd =3D fmod(x,y); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",resultd); > >> > > >> > =A0 =A0 =A0 =A0resultld =3D fmodl(ldy,ldy); > >> > =A0 =A0 =A0 =A0printf("result is > %f\n",resultld); > >> > > >> > =A0 =A0 =A0 =A0result =3D fabsf(no1); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D no3 / no4; > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D no1 * no2 * no3 * no4; > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D sin(30); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D cos(30); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D tan(30); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D atan(30); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D sqrt(no3); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D log10(no3); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D log(no3); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D exp10(no3); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0result =3D exp(no3); > >> > =A0 =A0 =A0 =A0printf("result is %f\n",result); > >> > > >> > =A0 =A0 =A0 =A0ldy =3D 88888888888888888888.88; > >> > =A0 =A0 =A0 =A0if (ldx =3D=3D ldy) > >> > =A0 =A0 =A0 =A0 =A0ldy =3D > 7777777777777777777777777777.777; > >> > =A0 =A0 =A0 =A0else > >> > =A0 =A0 =A0 =A0 =A0ldy =3D > 666666666666666666666666666.666; > >> > > >> > } > >> > >> With this example, what I got is: > >> gdb ./a.out > >> GNU gdb (GDB) 6.8.50.20090602-cvs > >> Copyright (C) 2009 Free Software Foundation, Inc. > >> License GPLv3+: GNU GPL version 3 or later > >> This is free software: you are free to change and > >> redistribute it. > >> There is NO WARRANTY, to the extent permitted by > law. > >> Type "show copying" > >> and "show warranty" for details. > >> This GDB was configured as "i686-pc-linux-gnu". > >> For bug reporting instructions, please see: > >> ... > >> Setting up the environment for debugging gdb. > >> Function "internal_error" not defined. > >> Make breakpoint pending on future shared library > load? (y > >> or [n]) > >> [answered N; input not from terminal] > >> Function "info_command" not defined. > >> Make breakpoint pending on future shared library > load? (y > >> or [n]) > >> [answered N; input not from terminal] > >> /home/teawater/gdb/bgdb/gdb/.gdbinit:8: Error in > sourced > >> command file: > >> No breakpoint number 0. > >> (gdb) start > >> During symbol reading, DW_AT_name missing from > >> DW_TAG_base_type. > >> Temporary breakpoint 1 at 0x8048608: file 1.c, > line 7. > >> Starting program: > /home/teawater/gdb/bgdb/gdb/a.out > >> > >> Temporary breakpoint 1, main () at 1.c:7 > >> 7 =A0 =A0 =A0 =A0 =A0 double > >> x =3D 100.345, y =3D 25.7789; > >> (gdb) record > >> (gdb) c > >> Continuing. > >> result is 369.438751 > >> Process record doesn't support instruction fwait. > >> Process record doesn't support instruction 0x9b at > address > >> 0xb7fa35fa. > >> Process record: failed to record execution log. > >> > >> Program received signal SIGTRAP, Trace/breakpoint > trap. > >> 0xb7fa35fa in ?? () from > /lib/tls/i686/cmov/libm.so.6 > >> (gdb) > >> > >> > >> Thanks, > >> Hui > >> > > > > > > >=20