* Re: final i386.floating.record.patch
@ 2009-08-04 13:06 paawan oza
2009-08-04 13:58 ` Hui Zhu
0 siblings, 1 reply; 10+ messages in thread
From: paawan oza @ 2009-08-04 13:06 UTC (permalink / raw)
To: Hui Zhu; +Cc: Michael Snyder, gdb-patches
Hi,
As I understand you have tried to run the example test code which I had sent earlier.
please let me know at which c statement (or insn) it is causing this ?
So I can dig into it more.
Thanks & Regards,
Oza.
--- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> wrote:
> From: paawan oza <paawan1982@yahoo.com>
> Subject: Re: final i386.floating.record.patch
> To: "Hui Zhu" <teawater@gmail.com>
> Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
> Date: Tuesday, August 4, 2009, 6:32 PM
> Hi Hui,
> I am not sure which test case (insn) caused this.
> would you please send me the example (.c file) which you
> have tried to run ?
> please also try to let me know at which insn (at which
> point it fails).
> Regards,
> Oza.
>
> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com>
> wrote:
>
> > From: Hui Zhu <teawater@gmail.com>
> > Subject: Re: final i386.floating.record.patch
> > To: "paawan oza" <paawan1982@yahoo.com>
> > Cc: "Michael Snyder" <msnyder@vmware.com>,
> "gdb-patches@sourceware.org"
> <gdb-patches@sourceware.org>
> > Date: Tuesday, August 4, 2009, 8:49 AM
> > Hi Paawan,
> >
> > Thanks for your work.
> >
> > I do a some test works with the test code that you
> sent in
> > before.
> > I get the values of fp reg with command "info
> > all-registers".
> >
> > It looks like some fp reg's values not right in
> replay
> > mode.
> >
> > In record mode they are:
> > fctrl
> > 0x37f 895
> > fstat
> > 0x0 0
> > ftag
> > 0xffff 65535
> > fiseg
> > 0x0 0
> > fioff
> > 0x0 0
> > ---Type <return> to continue, or q
> <return> to
> > quit---
> > foseg
> > 0x0 0
> > fooff
> > 0x0 0
> > fop
> > 0x0 0
> >
> > In replay mode they are:
> > fctrl
> > 0x37f 895
> > fstat
> > 0x6069 24681
> > ftag
> > 0x557f 21887
> > fiseg
> > 0x73 115
> > fioff
> > 0x8048bfd 134515709
> > ---Type <return> to continue, or q
> <return> to
> > quit---
> > foseg
> > 0x7b 123
> > fooff
> > 0x0 0
> > fop
> > 0x2e9 745
> >
> >
> >
> > Thanks,
> > Hui
> >
> >
> > #include <stdio.h>
> > #include <math.h>
> > #include <stdlib.h>
> >
> > /* the test intends to test following insns.
> > flds faddp fstps fstpl fldl fxch fabs fdivrp fmulp
> fsubrp
> > fucomp fnstsw fsqrt
> > fchs f2xm1 fyl2x fxtract fprem1 fld fdecstp fld1
> fldl2t
> > fldl2e FLDPI
> > FLDLG2 FLDLN2
> > FLDZ fincstp ffree fptan fpatan fincstp fsincos
> frndint
> > fscale fsin fcos fcmovb
> > fcmovbe fcmove fcmovu fcmovnb fcmovnbe fsave frstor
> fstsw
> > */
> >
> > float no1,no2,no3,no4,no5,no6,no7;
> > double x = 100.345, y = 25.7789;
> > long double ldx = 88888888888888888888.88, ldy =
> > 9999999999999999999.99;
> > float result,resultd,resultld;
> > float *float_memory;
> >
> > /* initialization of floats */
> > void init_floats()
> > {
> > no1 = 10.45;
> > no2 = 20.77;
> > no3 = 156.89874646;
> > no4 = 14.56;
> > no5 = 11.11;
> > no6 = 66.77;
> > no7 = 88.88;
> > float_memory = malloc(sizeof(float) * 4);
> > *float_memory = 256.256;
> > *(float_memory + 1) = 356.356;
> > *(float_memory + 2) = 456.456;
> > *(float_memory + 3) = 556.556;
> > }
> >
> > /* marks FPU stack as empty */
> > void empty_fpu_stack()
> > {
> > asm ("ffree %st(1) \n\t"
> > "ffree %st(2) \n\t"
> > "ffree %st(3) \n\t"
> > "ffree %st(4) \n\t"
> > "ffree %st(5) \n\t"
> > "ffree %st(6) \n\t"
> > "ffree %st(7)");
> > }
> >
> > /* tests floating point arithmatic */
> > void test_arith_floats()
> > {
> > result = no1 + no2 + no3 + no4 + no5 + no6 +
> no7;
> > printf("result is %f\n",result);
> >
> > result = fmodf(no2,no1);
> > printf("result is %f\n",result);
> >
> > resultd = fmod(x,y);
> > printf("result is %f\n",resultd);
> >
> > resultld = fmodl(ldy,ldy);
> > printf("result is %f\n",resultld);
> >
> > result = fabsf(no1);
> > printf("result is %f\n",result);
> >
> > result = no3 / no4;
> > printf("result is %f\n",result);
> >
> > result = no1 * no2 * no3 * no4;
> > printf("result is %f\n",result);
> >
> > result = no1 - no2 - no3 - no4;
> > printf("result is %f\n",result);
> >
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fchs");
> >
> > /* test for f2xm1 */
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("f2xm1");
> >
> > asm ("fyl2x");
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fxtract");
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fprem1");
> >
> > /* decrement fpu stack pointer only status
> register should
> > get affected */
> > asm ("fld %0" : :"m"(*float_memory));
> >
> > empty_fpu_stack();
> >
> > asm ("fld1");
> > asm ("fldl2t");
> > asm ("fldl2e");
> > asm ("fldpi");
> > asm ("fldlg2");
> > asm ("fldln2");
> > asm ("fldz");
> >
> > empty_fpu_stack();
> > /* finishing emptying the stack */
> >
> > result = sqrt(no3);
> > printf("result is %f\n",result);
> > }
> >
> > void test_log_exp_floats()
> > {
> > result = log10(no3);
> > printf("result is %f\n",result);
> >
> > result = log(no3);
> > printf("result is %f\n",result);
> >
> > result = exp10(no3);
> > printf("result is %f\n",result);
> >
> > result = exp(no3);
> > printf("result is %f\n",result);
> > }
> >
> > void test_trigo_floats()
> > {
> > result = sin(30);
> > printf("result is %f\n",result);
> >
> > result = cos(30);
> > printf("result is %f\n",result);
> >
> > result = tan(30);
> > printf("result is %f\n",result);
> >
> > result = atan(30);
> > printf("result is %f\n",result);
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fptan");
> >
> > /* changes st1 and popping register stack */
> > asm ("fpatan");
> >
> > asm("fincstp");
> > asm ("fld %0" : :"m"(float_memory));
> > asm ("fsincos");
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("frndint");
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fld %0" : :"m"(*(float_memory+1)));
> > asm ("fscale");
> >
> > empty_fpu_stack();
> >
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fsin");
> > asm ("fcos");
> >
> > /* currently we assume condition likely and
> always record
> > the registers
> > code could be optimized only if the flag is set
> then
> > record */
> > asm ("fld %0" : :"m"(*float_memory));
> > asm ("fld %0" : :"m"(*(float_memory+1)));
> > asm ("fcmovb %st(1), %st");
> > asm ("fcmovbe %st(1), %st");
> > asm ("fcmove %st(1), %st");
> > asm ("fcmovu %st(1), %st");
> > asm ("fcmovnb %st(1), %st");
> > asm ("fcmovnbe %st(1), %st");
> >
> > empty_fpu_stack();
> > /* finished emtyping the stack */
> > }
> >
> > void test_compare_floats()
> > {
> > ldy = 88888888888888888888.88;
> > if (ldx == ldy)
> > ldy =
> > 7777777777777777777777777777.777;
> > else
> > ldy =
> > 666666666666666666666666666.666;
> > }
> >
> > /* test loading and saving of FPU environment */
> > void test_fpu_env()
> > {
> > asm ("fsave %0" : "=m"(*float_memory) : );
> > asm ("frstor %0" : : "m"(*float_memory));
> > asm ("fstsw %ax");
> > }
> >
> > int main()
> > {
> > init_floats();
> > test_arith_floats();
> > test_log_exp_floats();
> > test_trigo_floats();
> > test_compare_floats();
> > test_fpu_env();
> > }
> >
> >
> >
> >
> > On Mon, Aug 3, 2009 at 22:56, paawan oza<paawan1982@yahoo.com>
> > wrote:
> > > Hi,
> > >
> > > please find the patch attached. I have attached
> as per
> > your suggestion.
> > > I am attaching it from opera browser.
> > >
> > > Regards,
> > > Oza.
> > >
> > > --- On Thu, 7/30/09, Michael Snyder <msnyder@vmware.com>
> > wrote:
> > >
> > >> From: Michael Snyder <msnyder@vmware.com>
> > >> Subject: Re: final
> i386.floating.record.patch
> > >> To: "paawan oza" <paawan1982@yahoo.com>
> > >> Cc: "gdb-patches@sourceware.org"
> > <gdb-patches@sourceware.org>
> > >> Date: Thursday, July 30, 2009, 11:31 PM
> > >> paawan oza wrote:
> > >> > Hi,
> > >> >
> > >> > please find my answers below.
> > >> >
> > >> > 1) Are you using a Windows machine to
> send
> > your
> > >> > emails? If so,
> > >> > is it possible that there is a
> Unix/Linux
> > >> machine you could
> > >> > try
> > >> > sending from? Your attachments look
> OK
> > for
> > >> me, but
> > >> > some people
> > >> > seem to have had problems with them.
> > >> >
> > >> > Oza : I used to send all from windows
> till
> > now.
> > >> > but this patch I sent it from
> Linux...from
> > opera.
> > >> > 2) And are you using cut-and-paste
> to
> > >> insert the patches
> > >> > into the
> > >> > body of your email? That would
> certainly
> > >> cause
> > >> > problems, because
> > >> > tabs might be changed into spaces
> (which
> > is
> > >> exactly what
> > >> > was
> > >> > causing patch to fail for me today).
> > >> > Oza: yes I am using copy-paste....I
> dont
> > know
> > >> any-other way.
> > >> > because attachmenet are not welcome, so
> I am
> > not sure
> > >> how I could proceed with this.
> > >>
> > >> It's not that attachments are not welcome.
> > >> There are various binary encodings for
> > attachments, and
> > >> some of those binary encodings are not
> welcome.
> > I
> > >> think
> > >> because there's no open-source way of
> decoding
> > them.
> > >>
> > >> If you look at the list, you'll see that
> > attachments are
> > >> used a lot.
> > >>
> > >> Copy-and-paste, though, in general will not
> work,
> > because
> > >> it
> > >> usually changes tabs into spaces, which ruins
> a
> > patch.
> > >>
> > >>
> > >> > I will send you updated patch.....may be
> I
> > might have
> > >> mistaken of old gdb file. sorry for
> incovenience.
> > >>
> > >> I think it was just the tabs-to-spaces
> issue.
> > >> Why don't you try sending an attachment from
> > Opera?
> > >>
> > >>
> > >
> > >
> > >
> >
>
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: final i386.floating.record.patch 2009-08-04 13:06 final i386.floating.record.patch paawan oza @ 2009-08-04 13:58 ` Hui Zhu 2009-08-04 14:18 ` paawan oza 2009-08-04 14:26 ` paawan oza 0 siblings, 2 replies; 10+ messages in thread From: Hui Zhu @ 2009-08-04 13:58 UTC (permalink / raw) To: paawan oza; +Cc: Michael Snyder, gdb-patches I think you can do it with youself. Hui On Tue, Aug 4, 2009 at 21:05, paawan oza<paawan1982@yahoo.com> wrote: > > Hi, > > As I understand you have tried to run the example test code which I had sent earlier. > > please let me know at which c statement (or insn) it is causing this ? > So I can dig into it more. > > Thanks & Regards, > Oza. > > > --- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> wrote: > >> From: paawan oza <paawan1982@yahoo.com> >> Subject: Re: final i386.floating.record.patch >> To: "Hui Zhu" <teawater@gmail.com> >> Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> >> Date: Tuesday, August 4, 2009, 6:32 PM >> Hi Hui, >> I am not sure which test case (insn) caused this. >> would you please send me the example (.c file) which you >> have tried to run ? >> please also try to let me know at which insn (at which >> point it fails). >> Regards, >> Oza. >> >> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> >> wrote: >> >> > From: Hui Zhu <teawater@gmail.com> >> > Subject: Re: final i386.floating.record.patch >> > To: "paawan oza" <paawan1982@yahoo.com> >> > Cc: "Michael Snyder" <msnyder@vmware.com>, >> "gdb-patches@sourceware.org" >> <gdb-patches@sourceware.org> >> > Date: Tuesday, August 4, 2009, 8:49 AM >> > Hi Paawan, >> > >> > Thanks for your work. >> > >> > I do a some test works with the test code that you >> sent in >> > before. >> > I get the values of fp reg with command "info >> > all-registers". >> > >> > It looks like some fp reg's values not right in >> replay >> > mode. >> > >> > In record mode they are: >> > fctrl >> > 0x37f 895 >> > fstat >> > 0x0 0 >> > ftag >> > 0xffff 65535 >> > fiseg >> > 0x0 0 >> > fioff >> > 0x0 0 >> > ---Type <return> to continue, or q >> <return> to >> > quit--- >> > foseg >> > 0x0 0 >> > fooff >> > 0x0 0 >> > fop >> > 0x0 0 >> > >> > In replay mode they are: >> > fctrl >> > 0x37f 895 >> > fstat >> > 0x6069 24681 >> > ftag >> > 0x557f 21887 >> > fiseg >> > 0x73 115 >> > fioff >> > 0x8048bfd 134515709 >> > ---Type <return> to continue, or q >> <return> to >> > quit--- >> > foseg >> > 0x7b 123 >> > fooff >> > 0x0 0 >> > fop >> > 0x2e9 745 >> > >> > >> > >> > Thanks, >> > Hui >> > >> > >> > #include <stdio.h> >> > #include <math.h> >> > #include <stdlib.h> >> > >> > /* the test intends to test following insns. >> > flds faddp fstps fstpl fldl fxch fabs fdivrp fmulp >> fsubrp >> > fucomp fnstsw fsqrt >> > fchs f2xm1 fyl2x fxtract fprem1 fld fdecstp fld1 >> fldl2t >> > fldl2e FLDPI >> > FLDLG2 FLDLN2 >> > FLDZ fincstp ffree fptan fpatan fincstp fsincos >> frndint >> > fscale fsin fcos fcmovb >> > fcmovbe fcmove fcmovu fcmovnb fcmovnbe fsave frstor >> fstsw >> > */ >> > >> > float no1,no2,no3,no4,no5,no6,no7; >> > double x = 100.345, y = 25.7789; >> > long double ldx = 88888888888888888888.88, ldy = >> > 9999999999999999999.99; >> > float result,resultd,resultld; >> > float *float_memory; >> > >> > /* initialization of floats */ >> > void init_floats() >> > { >> > no1 = 10.45; >> > no2 = 20.77; >> > no3 = 156.89874646; >> > no4 = 14.56; >> > no5 = 11.11; >> > no6 = 66.77; >> > no7 = 88.88; >> > float_memory = malloc(sizeof(float) * 4); >> > *float_memory = 256.256; >> > *(float_memory + 1) = 356.356; >> > *(float_memory + 2) = 456.456; >> > *(float_memory + 3) = 556.556; >> > } >> > >> > /* marks FPU stack as empty */ >> > void empty_fpu_stack() >> > { >> > asm ("ffree %st(1) \n\t" >> > "ffree %st(2) \n\t" >> > "ffree %st(3) \n\t" >> > "ffree %st(4) \n\t" >> > "ffree %st(5) \n\t" >> > "ffree %st(6) \n\t" >> > "ffree %st(7)"); >> > } >> > >> > /* tests floating point arithmatic */ >> > void test_arith_floats() >> > { >> > result = no1 + no2 + no3 + no4 + no5 + no6 + >> no7; >> > printf("result is %f\n",result); >> > >> > result = fmodf(no2,no1); >> > printf("result is %f\n",result); >> > >> > resultd = fmod(x,y); >> > printf("result is %f\n",resultd); >> > >> > resultld = fmodl(ldy,ldy); >> > printf("result is %f\n",resultld); >> > >> > result = fabsf(no1); >> > printf("result is %f\n",result); >> > >> > result = no3 / no4; >> > printf("result is %f\n",result); >> > >> > result = no1 * no2 * no3 * no4; >> > printf("result is %f\n",result); >> > >> > result = no1 - no2 - no3 - no4; >> > printf("result is %f\n",result); >> > >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fchs"); >> > >> > /* test for f2xm1 */ >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("f2xm1"); >> > >> > asm ("fyl2x"); >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fxtract"); >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fprem1"); >> > >> > /* decrement fpu stack pointer only status >> register should >> > get affected */ >> > asm ("fld %0" : :"m"(*float_memory)); >> > >> > empty_fpu_stack(); >> > >> > asm ("fld1"); >> > asm ("fldl2t"); >> > asm ("fldl2e"); >> > asm ("fldpi"); >> > asm ("fldlg2"); >> > asm ("fldln2"); >> > asm ("fldz"); >> > >> > empty_fpu_stack(); >> > /* finishing emptying the stack */ >> > >> > result = sqrt(no3); >> > printf("result is %f\n",result); >> > } >> > >> > void test_log_exp_floats() >> > { >> > result = log10(no3); >> > printf("result is %f\n",result); >> > >> > result = log(no3); >> > printf("result is %f\n",result); >> > >> > result = exp10(no3); >> > printf("result is %f\n",result); >> > >> > result = exp(no3); >> > printf("result is %f\n",result); >> > } >> > >> > void test_trigo_floats() >> > { >> > result = sin(30); >> > printf("result is %f\n",result); >> > >> > result = cos(30); >> > printf("result is %f\n",result); >> > >> > result = tan(30); >> > printf("result is %f\n",result); >> > >> > result = atan(30); >> > printf("result is %f\n",result); >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fptan"); >> > >> > /* changes st1 and popping register stack */ >> > asm ("fpatan"); >> > >> > asm("fincstp"); >> > asm ("fld %0" : :"m"(float_memory)); >> > asm ("fsincos"); >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("frndint"); >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fld %0" : :"m"(*(float_memory+1))); >> > asm ("fscale"); >> > >> > empty_fpu_stack(); >> > >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fsin"); >> > asm ("fcos"); >> > >> > /* currently we assume condition likely and >> always record >> > the registers >> > code could be optimized only if the flag is set >> then >> > record */ >> > asm ("fld %0" : :"m"(*float_memory)); >> > asm ("fld %0" : :"m"(*(float_memory+1))); >> > asm ("fcmovb %st(1), %st"); >> > asm ("fcmovbe %st(1), %st"); >> > asm ("fcmove %st(1), %st"); >> > asm ("fcmovu %st(1), %st"); >> > asm ("fcmovnb %st(1), %st"); >> > asm ("fcmovnbe %st(1), %st"); >> > >> > empty_fpu_stack(); >> > /* finished emtyping the stack */ >> > } >> > >> > void test_compare_floats() >> > { >> > ldy = 88888888888888888888.88; >> > if (ldx == ldy) >> > ldy = >> > 7777777777777777777777777777.777; >> > else >> > ldy = >> > 666666666666666666666666666.666; >> > } >> > >> > /* test loading and saving of FPU environment */ >> > void test_fpu_env() >> > { >> > asm ("fsave %0" : "=m"(*float_memory) : ); >> > asm ("frstor %0" : : "m"(*float_memory)); >> > asm ("fstsw %ax"); >> > } >> > >> > int main() >> > { >> > init_floats(); >> > test_arith_floats(); >> > test_log_exp_floats(); >> > test_trigo_floats(); >> > test_compare_floats(); >> > test_fpu_env(); >> > } >> > >> > >> > >> > >> > On Mon, Aug 3, 2009 at 22:56, paawan oza<paawan1982@yahoo.com> >> > wrote: >> > > Hi, >> > > >> > > please find the patch attached. I have attached >> as per >> > your suggestion. >> > > I am attaching it from opera browser. >> > > >> > > Regards, >> > > Oza. >> > > >> > > --- On Thu, 7/30/09, Michael Snyder <msnyder@vmware.com> >> > wrote: >> > > >> > >> From: Michael Snyder <msnyder@vmware.com> >> > >> Subject: Re: final >> i386.floating.record.patch >> > >> To: "paawan oza" <paawan1982@yahoo.com> >> > >> Cc: "gdb-patches@sourceware.org" >> > <gdb-patches@sourceware.org> >> > >> Date: Thursday, July 30, 2009, 11:31 PM >> > >> paawan oza wrote: >> > >> > Hi, >> > >> > >> > >> > please find my answers below. >> > >> > >> > >> > 1) Are you using a Windows machine to >> send >> > your >> > >> > emails? If so, >> > >> > is it possible that there is a >> Unix/Linux >> > >> machine you could >> > >> > try >> > >> > sending from? Your attachments look >> OK >> > for >> > >> me, but >> > >> > some people >> > >> > seem to have had problems with them. >> > >> > >> > >> > Oza : I used to send all from windows >> till >> > now. >> > >> > but this patch I sent it from >> Linux...from >> > opera. >> > >> > 2) And are you using cut-and-paste >> to >> > >> insert the patches >> > >> > into the >> > >> > body of your email? That would >> certainly >> > >> cause >> > >> > problems, because >> > >> > tabs might be changed into spaces >> (which >> > is >> > >> exactly what >> > >> > was >> > >> > causing patch to fail for me today). >> > >> > Oza: yes I am using copy-paste....I >> dont >> > know >> > >> any-other way. >> > >> > because attachmenet are not welcome, so >> I am >> > not sure >> > >> how I could proceed with this. >> > >> >> > >> It's not that attachments are not welcome. >> > >> There are various binary encodings for >> > attachments, and >> > >> some of those binary encodings are not >> welcome. >> > I >> > >> think >> > >> because there's no open-source way of >> decoding >> > them. >> > >> >> > >> If you look at the list, you'll see that >> > attachments are >> > >> used a lot. >> > >> >> > >> Copy-and-paste, though, in general will not >> work, >> > because >> > >> it >> > >> usually changes tabs into spaces, which ruins >> a >> > patch. >> > >> >> > >> >> > >> > I will send you updated patch.....may be >> I >> > might have >> > >> mistaken of old gdb file. sorry for >> incovenience. >> > >> >> > >> I think it was just the tabs-to-spaces >> issue. >> > >> Why don't you try sending an attachment from >> > Opera? >> > >> >> > >> >> > > >> > > >> > > >> > >> >> >> >> > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-04 13:58 ` Hui Zhu @ 2009-08-04 14:18 ` paawan oza 2009-08-04 14:26 ` paawan oza 1 sibling, 0 replies; 10+ messages in thread From: paawan oza @ 2009-08-04 14:18 UTC (permalink / raw) To: Hui Zhu; +Cc: Michael Snyder, gdb-patches Hi Hui, I am trying, but am unable to reproduce it. I am enabling the 'record' mode from begning....and trying 'reverse-next'. It seems to be working. please let me know if I need to do anything more to reproduce. Regards, Oza. --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> wrote: > From: Hui Zhu <teawater@gmail.com> > Subject: Re: final i386.floating.record.patch > To: "paawan oza" <paawan1982@yahoo.com> > Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> > Date: Tuesday, August 4, 2009, 7:28 PM > I think you can do it with youself. > > Hui > > On Tue, Aug 4, 2009 at 21:05, paawan oza<paawan1982@yahoo.com> > wrote: > > > > Hi, > > > > As I understand you have tried to run the example test > code which I had sent earlier. > > > > please let me know at which c statement (or insn) it > is causing this ? > > So I can dig into it more. > > > > Thanks & Regards, > > Oza. > > > > > > --- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> > wrote: > > > >> From: paawan oza <paawan1982@yahoo.com> > >> Subject: Re: final i386.floating.record.patch > >> To: "Hui Zhu" <teawater@gmail.com> > >> Cc: "Michael Snyder" <msnyder@vmware.com>, > "gdb-patches@sourceware.org" > <gdb-patches@sourceware.org> > >> Date: Tuesday, August 4, 2009, 6:32 PM > >> Hi Hui, > >> I am not sure which test case (insn) caused > this. > >> would you please send me the example (.c file) > which you > >> have tried to run ? > >> please also try to let me know at which insn (at > which > >> point it fails). > >> Regards, > >> Oza. > >> > >> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> > >> wrote: > >> > >> > From: Hui Zhu <teawater@gmail.com> > >> > Subject: Re: final > i386.floating.record.patch > >> > To: "paawan oza" <paawan1982@yahoo.com> > >> > Cc: "Michael Snyder" <msnyder@vmware.com>, > >> "gdb-patches@sourceware.org" > >> <gdb-patches@sourceware.org> > >> > Date: Tuesday, August 4, 2009, 8:49 AM > >> > Hi Paawan, > >> > > >> > Thanks for your work. > >> > > >> > I do a some test works with the test code > that you > >> sent in > >> > before. > >> > I get the values of fp reg with command > "info > >> > all-registers". > >> > > >> > It looks like some fp reg's values not right > in > >> replay > >> > mode. > >> > > >> > In record mode they are: > >> > fctrl > >> > 0x37f 895 > >> > fstat > >> > 0x0 0 > >> > ftag > >> > 0xffff 65535 > >> > fiseg > >> > 0x0 0 > >> > fioff > >> > 0x0 0 > >> > ---Type <return> to continue, or q > >> <return> to > >> > quit--- > >> > foseg > >> > 0x0 0 > >> > fooff > >> > 0x0 0 > >> > fop > >> > 0x0 0 > >> > > >> > In replay mode they are: > >> > fctrl > >> > 0x37f 895 > >> > fstat > >> > 0x6069 24681 > >> > ftag > >> > 0x557f 21887 > >> > fiseg > >> > 0x73 115 > >> > fioff > >> > 0x8048bfd 134515709 > >> > ---Type <return> to continue, or q > >> <return> to > >> > quit--- > >> > foseg > >> > 0x7b 123 > >> > fooff > >> > 0x0 0 > >> > fop > >> > 0x2e9 745 > >> > > >> > > >> > > >> > Thanks, > >> > Hui > >> > > >> > > >> > #include <stdio.h> > >> > #include <math.h> > >> > #include <stdlib.h> > >> > > >> > /* the test intends to test following insns. > >> > flds faddp fstps fstpl fldl fxch fabs fdivrp > fmulp > >> fsubrp > >> > fucomp fnstsw fsqrt > >> > fchs f2xm1 fyl2x fxtract fprem1 fld fdecstp > fld1 > >> fldl2t > >> > fldl2e FLDPI > >> > FLDLG2 FLDLN2 > >> > FLDZ fincstp ffree fptan fpatan fincstp > fsincos > >> frndint > >> > fscale fsin fcos fcmovb > >> > fcmovbe fcmove fcmovu fcmovnb fcmovnbe fsave > frstor > >> fstsw > >> > */ > >> > > >> > float no1,no2,no3,no4,no5,no6,no7; > >> > double x = 100.345, y = 25.7789; > >> > long double ldx = 88888888888888888888.88, > ldy = > >> > 9999999999999999999.99; > >> > float result,resultd,resultld; > >> > float *float_memory; > >> > > >> > /* initialization of floats */ > >> > void init_floats() > >> > { > >> > no1 = 10.45; > >> > no2 = 20.77; > >> > no3 = 156.89874646; > >> > no4 = 14.56; > >> > no5 = 11.11; > >> > no6 = 66.77; > >> > no7 = 88.88; > >> > float_memory = malloc(sizeof(float) * 4); > >> > *float_memory = 256.256; > >> > *(float_memory + 1) = 356.356; > >> > *(float_memory + 2) = 456.456; > >> > *(float_memory + 3) = 556.556; > >> > } > >> > > >> > /* marks FPU stack as empty */ > >> > void empty_fpu_stack() > >> > { > >> > asm ("ffree %st(1) \n\t" > >> > "ffree %st(2) \n\t" > >> > "ffree %st(3) \n\t" > >> > "ffree %st(4) \n\t" > >> > "ffree %st(5) \n\t" > >> > "ffree %st(6) \n\t" > >> > "ffree %st(7)"); > >> > } > >> > > >> > /* tests floating point arithmatic */ > >> > void test_arith_floats() > >> > { > >> > result = no1 + no2 + no3 + no4 + no5 + no6 > + > >> no7; > >> > printf("result is %f\n",result); > >> > > >> > result = fmodf(no2,no1); > >> > printf("result is %f\n",result); > >> > > >> > resultd = fmod(x,y); > >> > printf("result is %f\n",resultd); > >> > > >> > resultld = fmodl(ldy,ldy); > >> > printf("result is %f\n",resultld); > >> > > >> > result = fabsf(no1); > >> > printf("result is %f\n",result); > >> > > >> > result = no3 / no4; > >> > printf("result is %f\n",result); > >> > > >> > result = no1 * no2 * no3 * no4; > >> > printf("result is %f\n",result); > >> > > >> > result = no1 - no2 - no3 - no4; > >> > printf("result is %f\n",result); > >> > > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fchs"); > >> > > >> > /* test for f2xm1 */ > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("f2xm1"); > >> > > >> > asm ("fyl2x"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fxtract"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fprem1"); > >> > > >> > /* decrement fpu stack pointer only status > >> register should > >> > get affected */ > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > > >> > empty_fpu_stack(); > >> > > >> > asm ("fld1"); > >> > asm ("fldl2t"); > >> > asm ("fldl2e"); > >> > asm ("fldpi"); > >> > asm ("fldlg2"); > >> > asm ("fldln2"); > >> > asm ("fldz"); > >> > > >> > empty_fpu_stack(); > >> > /* finishing emptying the stack */ > >> > > >> > result = sqrt(no3); > >> > printf("result is %f\n",result); > >> > } > >> > > >> > void test_log_exp_floats() > >> > { > >> > result = log10(no3); > >> > printf("result is %f\n",result); > >> > > >> > result = log(no3); > >> > printf("result is %f\n",result); > >> > > >> > result = exp10(no3); > >> > printf("result is %f\n",result); > >> > > >> > result = exp(no3); > >> > printf("result is %f\n",result); > >> > } > >> > > >> > void test_trigo_floats() > >> > { > >> > result = sin(30); > >> > printf("result is %f\n",result); > >> > > >> > result = cos(30); > >> > printf("result is %f\n",result); > >> > > >> > result = tan(30); > >> > printf("result is %f\n",result); > >> > > >> > result = atan(30); > >> > printf("result is %f\n",result); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fptan"); > >> > > >> > /* changes st1 and popping register stack > */ > >> > asm ("fpatan"); > >> > > >> > asm("fincstp"); > >> > asm ("fld %0" : :"m"(float_memory)); > >> > asm ("fsincos"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("frndint"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fld %0" : :"m"(*(float_memory+1))); > >> > asm ("fscale"); > >> > > >> > empty_fpu_stack(); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fsin"); > >> > asm ("fcos"); > >> > > >> > /* currently we assume condition likely > and > >> always record > >> > the registers > >> > code could be optimized only if the flag is > set > >> then > >> > record */ > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fld %0" : :"m"(*(float_memory+1))); > >> > asm ("fcmovb %st(1), %st"); > >> > asm ("fcmovbe %st(1), %st"); > >> > asm ("fcmove %st(1), %st"); > >> > asm ("fcmovu %st(1), %st"); > >> > asm ("fcmovnb %st(1), %st"); > >> > asm ("fcmovnbe %st(1), %st"); > >> > > >> > empty_fpu_stack(); > >> > /* finished emtyping the stack */ > >> > } > >> > > >> > void test_compare_floats() > >> > { > >> > ldy = 88888888888888888888.88; > >> > if (ldx == ldy) > >> > ldy = > >> > 7777777777777777777777777777.777; > >> > else > >> > ldy = > >> > 666666666666666666666666666.666; > >> > } > >> > > >> > /* test loading and saving of FPU environment > */ > >> > void test_fpu_env() > >> > { > >> > asm ("fsave %0" : "=m"(*float_memory) : ); > >> > asm ("frstor %0" : : "m"(*float_memory)); > >> > asm ("fstsw %ax"); > >> > } > >> > > >> > int main() > >> > { > >> > init_floats(); > >> > test_arith_floats(); > >> > test_log_exp_floats(); > >> > test_trigo_floats(); > >> > test_compare_floats(); > >> > test_fpu_env(); > >> > } > >> > > >> > > >> > > >> > > >> > On Mon, Aug 3, 2009 at 22:56, paawan > oza<paawan1982@yahoo.com> > >> > wrote: > >> > > Hi, > >> > > > >> > > please find the patch attached. I have > attached > >> as per > >> > your suggestion. > >> > > I am attaching it from opera browser. > >> > > > >> > > Regards, > >> > > Oza. > >> > > > >> > > --- On Thu, 7/30/09, Michael Snyder > <msnyder@vmware.com> > >> > wrote: > >> > > > >> > >> From: Michael Snyder <msnyder@vmware.com> > >> > >> Subject: Re: final > >> i386.floating.record.patch > >> > >> To: "paawan oza" <paawan1982@yahoo.com> > >> > >> Cc: "gdb-patches@sourceware.org" > >> > <gdb-patches@sourceware.org> > >> > >> Date: Thursday, July 30, 2009, 11:31 > PM > >> > >> paawan oza wrote: > >> > >> > Hi, > >> > >> > > >> > >> > please find my answers below. > >> > >> > > >> > >> > 1) Are you using a Windows > machine to > >> send > >> > your > >> > >> > emails? If so, > >> > >> > is it possible that there is > a > >> Unix/Linux > >> > >> machine you could > >> > >> > try > >> > >> > sending from? Your > attachments look > >> OK > >> > for > >> > >> me, but > >> > >> > some people > >> > >> > seem to have had problems > with them. > >> > >> > > >> > >> > Oza : I used to send all from > windows > >> till > >> > now. > >> > >> > but this patch I sent it from > >> Linux...from > >> > opera. > >> > >> > 2) And are you using > cut-and-paste > >> to > >> > >> insert the patches > >> > >> > into the > >> > >> > body of your email? That > would > >> certainly > >> > >> cause > >> > >> > problems, because > >> > >> > tabs might be changed into > spaces > >> (which > >> > is > >> > >> exactly what > >> > >> > was > >> > >> > causing patch to fail for me > today). > >> > >> > Oza: yes I am using > copy-paste....I > >> dont > >> > know > >> > >> any-other way. > >> > >> > because attachmenet are not > welcome, so > >> I am > >> > not sure > >> > >> how I could proceed with this. > >> > >> > >> > >> It's not that attachments are not > welcome. > >> > >> There are various binary encodings > for > >> > attachments, and > >> > >> some of those binary encodings are > not > >> welcome. > >> > I > >> > >> think > >> > >> because there's no open-source way > of > >> decoding > >> > them. > >> > >> > >> > >> If you look at the list, you'll see > that > >> > attachments are > >> > >> used a lot. > >> > >> > >> > >> Copy-and-paste, though, in general > will not > >> work, > >> > because > >> > >> it > >> > >> usually changes tabs into spaces, > which ruins > >> a > >> > patch. > >> > >> > >> > >> > >> > >> > I will send you updated > patch.....may be > >> I > >> > might have > >> > >> mistaken of old gdb file. sorry for > >> incovenience. > >> > >> > >> > >> I think it was just the > tabs-to-spaces > >> issue. > >> > >> Why don't you try sending an > attachment from > >> > Opera? > >> > >> > >> > >> > >> > > > >> > > > >> > > > >> > > >> > >> > >> > >> > > > > > > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-04 13:58 ` Hui Zhu 2009-08-04 14:18 ` paawan oza @ 2009-08-04 14:26 ` paawan oza 2009-08-04 14:43 ` Hui Zhu 1 sibling, 1 reply; 10+ messages in thread From: paawan oza @ 2009-08-04 14:26 UTC (permalink / raw) To: Hui Zhu; +Cc: Michael Snyder, gdb-patches Hi Hui, tested following line. line 54: result = fmodf(no2,no1); please see the log below. all registers are same. ****************************************************************** (gdb) n 52 printf("result is %f\n",result); (gdb) n result is 369.438751 54 result = fmodf(no2,no1); (gdb) info all-registers st0 0 (raw 0x00000000000000000000) st1 0 (raw 0x00000000000000000000) st2 0 (raw 0x00000000000000000000) st3 0 (raw 0x00000000000000000000) st4 0 (raw 0x00000000000000000000) st5 0 (raw 0x00000000000000000000) st6 88.87999725341796875 (raw 0x4005b1c28f0000000000) st7 369.438751220703125 (raw 0x4007b8b8290000000000) fctrl 0x37f 895 fstat 0x20 32 ftag 0xffff 65535 fiseg 0x73 115 fioff 0xb7eccd27 -1209217753 foseg 0x7b 123 fooff 0xbfffc0d4 -1073757996 fop 0x0 0 (gdb) n 55 printf("result is %f\n",result); (gdb) result is 10.320001 57 resultd = fmod(x,y); (gdb) reverse-next 55 printf("result is %f\n",result); (gdb) 54 result = fmodf(no2,no1); (gdb) 52 printf("result is %f\n",result); (gdb) info all-registers st0 0 (raw 0x00000000000000000000) st1 0 (raw 0x00000000000000000000) st2 0 (raw 0x00000000000000000000) st3 0 (raw 0x00000000000000000000) st4 0 (raw 0x00000000000000000000) st5 0 (raw 0x00000000000000000000) st6 88.87999725341796875 (raw 0x4005b1c28f0000000000) st7 369.43873691558837890625 (raw 0x4007b8b8288800000000) fctrl 0x37f 895 fstat 0x20 32 ftag 0xffff 65535 fiseg 0x73 115 fioff 0xb7eccd27 -1209217753 foseg 0x7b 123 fooff 0xbfffc0d4 -1073757996 fop 0x0 0 (gdb) ****************************************************************** --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> wrote: > From: Hui Zhu <teawater@gmail.com> > Subject: Re: final i386.floating.record.patch > To: "paawan oza" <paawan1982@yahoo.com> > Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> > Date: Tuesday, August 4, 2009, 7:28 PM > I think you can do it with youself. > > Hui > > On Tue, Aug 4, 2009 at 21:05, paawan oza<paawan1982@yahoo.com> > wrote: > > > > Hi, > > > > As I understand you have tried to run the example test > code which I had sent earlier. > > > > please let me know at which c statement (or insn) it > is causing this ? > > So I can dig into it more. > > > > Thanks & Regards, > > Oza. > > > > > > --- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> > wrote: > > > >> From: paawan oza <paawan1982@yahoo.com> > >> Subject: Re: final i386.floating.record.patch > >> To: "Hui Zhu" <teawater@gmail.com> > >> Cc: "Michael Snyder" <msnyder@vmware.com>, > "gdb-patches@sourceware.org" > <gdb-patches@sourceware.org> > >> Date: Tuesday, August 4, 2009, 6:32 PM > >> Hi Hui, > >> I am not sure which test case (insn) caused > this. > >> would you please send me the example (.c file) > which you > >> have tried to run ? > >> please also try to let me know at which insn (at > which > >> point it fails). > >> Regards, > >> Oza. > >> > >> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> > >> wrote: > >> > >> > From: Hui Zhu <teawater@gmail.com> > >> > Subject: Re: final > i386.floating.record.patch > >> > To: "paawan oza" <paawan1982@yahoo.com> > >> > Cc: "Michael Snyder" <msnyder@vmware.com>, > >> "gdb-patches@sourceware.org" > >> <gdb-patches@sourceware.org> > >> > Date: Tuesday, August 4, 2009, 8:49 AM > >> > Hi Paawan, > >> > > >> > Thanks for your work. > >> > > >> > I do a some test works with the test code > that you > >> sent in > >> > before. > >> > I get the values of fp reg with command > "info > >> > all-registers". > >> > > >> > It looks like some fp reg's values not right > in > >> replay > >> > mode. > >> > > >> > In record mode they are: > >> > fctrl > >> > 0x37f 895 > >> > fstat > >> > 0x0 0 > >> > ftag > >> > 0xffff 65535 > >> > fiseg > >> > 0x0 0 > >> > fioff > >> > 0x0 0 > >> > ---Type <return> to continue, or q > >> <return> to > >> > quit--- > >> > foseg > >> > 0x0 0 > >> > fooff > >> > 0x0 0 > >> > fop > >> > 0x0 0 > >> > > >> > In replay mode they are: > >> > fctrl > >> > 0x37f 895 > >> > fstat > >> > 0x6069 24681 > >> > ftag > >> > 0x557f 21887 > >> > fiseg > >> > 0x73 115 > >> > fioff > >> > 0x8048bfd 134515709 > >> > ---Type <return> to continue, or q > >> <return> to > >> > quit--- > >> > foseg > >> > 0x7b 123 > >> > fooff > >> > 0x0 0 > >> > fop > >> > 0x2e9 745 > >> > > >> > > >> > > >> > Thanks, > >> > Hui > >> > > >> > > >> > #include <stdio.h> > >> > #include <math.h> > >> > #include <stdlib.h> > >> > > >> > /* the test intends to test following insns. > >> > flds faddp fstps fstpl fldl fxch fabs fdivrp > fmulp > >> fsubrp > >> > fucomp fnstsw fsqrt > >> > fchs f2xm1 fyl2x fxtract fprem1 fld fdecstp > fld1 > >> fldl2t > >> > fldl2e FLDPI > >> > FLDLG2 FLDLN2 > >> > FLDZ fincstp ffree fptan fpatan fincstp > fsincos > >> frndint > >> > fscale fsin fcos fcmovb > >> > fcmovbe fcmove fcmovu fcmovnb fcmovnbe fsave > frstor > >> fstsw > >> > */ > >> > > >> > float no1,no2,no3,no4,no5,no6,no7; > >> > double x = 100.345, y = 25.7789; > >> > long double ldx = 88888888888888888888.88, > ldy = > >> > 9999999999999999999.99; > >> > float result,resultd,resultld; > >> > float *float_memory; > >> > > >> > /* initialization of floats */ > >> > void init_floats() > >> > { > >> > no1 = 10.45; > >> > no2 = 20.77; > >> > no3 = 156.89874646; > >> > no4 = 14.56; > >> > no5 = 11.11; > >> > no6 = 66.77; > >> > no7 = 88.88; > >> > float_memory = malloc(sizeof(float) * 4); > >> > *float_memory = 256.256; > >> > *(float_memory + 1) = 356.356; > >> > *(float_memory + 2) = 456.456; > >> > *(float_memory + 3) = 556.556; > >> > } > >> > > >> > /* marks FPU stack as empty */ > >> > void empty_fpu_stack() > >> > { > >> > asm ("ffree %st(1) \n\t" > >> > "ffree %st(2) \n\t" > >> > "ffree %st(3) \n\t" > >> > "ffree %st(4) \n\t" > >> > "ffree %st(5) \n\t" > >> > "ffree %st(6) \n\t" > >> > "ffree %st(7)"); > >> > } > >> > > >> > /* tests floating point arithmatic */ > >> > void test_arith_floats() > >> > { > >> > result = no1 + no2 + no3 + no4 + no5 + no6 > + > >> no7; > >> > printf("result is %f\n",result); > >> > > >> > result = fmodf(no2,no1); > >> > printf("result is %f\n",result); > >> > > >> > resultd = fmod(x,y); > >> > printf("result is %f\n",resultd); > >> > > >> > resultld = fmodl(ldy,ldy); > >> > printf("result is %f\n",resultld); > >> > > >> > result = fabsf(no1); > >> > printf("result is %f\n",result); > >> > > >> > result = no3 / no4; > >> > printf("result is %f\n",result); > >> > > >> > result = no1 * no2 * no3 * no4; > >> > printf("result is %f\n",result); > >> > > >> > result = no1 - no2 - no3 - no4; > >> > printf("result is %f\n",result); > >> > > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fchs"); > >> > > >> > /* test for f2xm1 */ > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("f2xm1"); > >> > > >> > asm ("fyl2x"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fxtract"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fprem1"); > >> > > >> > /* decrement fpu stack pointer only status > >> register should > >> > get affected */ > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > > >> > empty_fpu_stack(); > >> > > >> > asm ("fld1"); > >> > asm ("fldl2t"); > >> > asm ("fldl2e"); > >> > asm ("fldpi"); > >> > asm ("fldlg2"); > >> > asm ("fldln2"); > >> > asm ("fldz"); > >> > > >> > empty_fpu_stack(); > >> > /* finishing emptying the stack */ > >> > > >> > result = sqrt(no3); > >> > printf("result is %f\n",result); > >> > } > >> > > >> > void test_log_exp_floats() > >> > { > >> > result = log10(no3); > >> > printf("result is %f\n",result); > >> > > >> > result = log(no3); > >> > printf("result is %f\n",result); > >> > > >> > result = exp10(no3); > >> > printf("result is %f\n",result); > >> > > >> > result = exp(no3); > >> > printf("result is %f\n",result); > >> > } > >> > > >> > void test_trigo_floats() > >> > { > >> > result = sin(30); > >> > printf("result is %f\n",result); > >> > > >> > result = cos(30); > >> > printf("result is %f\n",result); > >> > > >> > result = tan(30); > >> > printf("result is %f\n",result); > >> > > >> > result = atan(30); > >> > printf("result is %f\n",result); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fptan"); > >> > > >> > /* changes st1 and popping register stack > */ > >> > asm ("fpatan"); > >> > > >> > asm("fincstp"); > >> > asm ("fld %0" : :"m"(float_memory)); > >> > asm ("fsincos"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("frndint"); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fld %0" : :"m"(*(float_memory+1))); > >> > asm ("fscale"); > >> > > >> > empty_fpu_stack(); > >> > > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fsin"); > >> > asm ("fcos"); > >> > > >> > /* currently we assume condition likely > and > >> always record > >> > the registers > >> > code could be optimized only if the flag is > set > >> then > >> > record */ > >> > asm ("fld %0" : :"m"(*float_memory)); > >> > asm ("fld %0" : :"m"(*(float_memory+1))); > >> > asm ("fcmovb %st(1), %st"); > >> > asm ("fcmovbe %st(1), %st"); > >> > asm ("fcmove %st(1), %st"); > >> > asm ("fcmovu %st(1), %st"); > >> > asm ("fcmovnb %st(1), %st"); > >> > asm ("fcmovnbe %st(1), %st"); > >> > > >> > empty_fpu_stack(); > >> > /* finished emtyping the stack */ > >> > } > >> > > >> > void test_compare_floats() > >> > { > >> > ldy = 88888888888888888888.88; > >> > if (ldx == ldy) > >> > ldy = > >> > 7777777777777777777777777777.777; > >> > else > >> > ldy = > >> > 666666666666666666666666666.666; > >> > } > >> > > >> > /* test loading and saving of FPU environment > */ > >> > void test_fpu_env() > >> > { > >> > asm ("fsave %0" : "=m"(*float_memory) : ); > >> > asm ("frstor %0" : : "m"(*float_memory)); > >> > asm ("fstsw %ax"); > >> > } > >> > > >> > int main() > >> > { > >> > init_floats(); > >> > test_arith_floats(); > >> > test_log_exp_floats(); > >> > test_trigo_floats(); > >> > test_compare_floats(); > >> > test_fpu_env(); > >> > } > >> > > >> > > >> > > >> > > >> > On Mon, Aug 3, 2009 at 22:56, paawan > oza<paawan1982@yahoo.com> > >> > wrote: > >> > > Hi, > >> > > > >> > > please find the patch attached. I have > attached > >> as per > >> > your suggestion. > >> > > I am attaching it from opera browser. > >> > > > >> > > Regards, > >> > > Oza. > >> > > > >> > > --- On Thu, 7/30/09, Michael Snyder > <msnyder@vmware.com> > >> > wrote: > >> > > > >> > >> From: Michael Snyder <msnyder@vmware.com> > >> > >> Subject: Re: final > >> i386.floating.record.patch > >> > >> To: "paawan oza" <paawan1982@yahoo.com> > >> > >> Cc: "gdb-patches@sourceware.org" > >> > <gdb-patches@sourceware.org> > >> > >> Date: Thursday, July 30, 2009, 11:31 > PM > >> > >> paawan oza wrote: > >> > >> > Hi, > >> > >> > > >> > >> > please find my answers below. > >> > >> > > >> > >> > 1) Are you using a Windows > machine to > >> send > >> > your > >> > >> > emails? If so, > >> > >> > is it possible that there is > a > >> Unix/Linux > >> > >> machine you could > >> > >> > try > >> > >> > sending from? Your > attachments look > >> OK > >> > for > >> > >> me, but > >> > >> > some people > >> > >> > seem to have had problems > with them. > >> > >> > > >> > >> > Oza : I used to send all from > windows > >> till > >> > now. > >> > >> > but this patch I sent it from > >> Linux...from > >> > opera. > >> > >> > 2) And are you using > cut-and-paste > >> to > >> > >> insert the patches > >> > >> > into the > >> > >> > body of your email? That > would > >> certainly > >> > >> cause > >> > >> > problems, because > >> > >> > tabs might be changed into > spaces > >> (which > >> > is > >> > >> exactly what > >> > >> > was > >> > >> > causing patch to fail for me > today). > >> > >> > Oza: yes I am using > copy-paste....I > >> dont > >> > know > >> > >> any-other way. > >> > >> > because attachmenet are not > welcome, so > >> I am > >> > not sure > >> > >> how I could proceed with this. > >> > >> > >> > >> It's not that attachments are not > welcome. > >> > >> There are various binary encodings > for > >> > attachments, and > >> > >> some of those binary encodings are > not > >> welcome. > >> > I > >> > >> think > >> > >> because there's no open-source way > of > >> decoding > >> > them. > >> > >> > >> > >> If you look at the list, you'll see > that > >> > attachments are > >> > >> used a lot. > >> > >> > >> > >> Copy-and-paste, though, in general > will not > >> work, > >> > because > >> > >> it > >> > >> usually changes tabs into spaces, > which ruins > >> a > >> > patch. > >> > >> > >> > >> > >> > >> > I will send you updated > patch.....may be > >> I > >> > might have > >> > >> mistaken of old gdb file. sorry for > >> incovenience. > >> > >> > >> > >> I think it was just the > tabs-to-spaces > >> issue. > >> > >> Why don't you try sending an > attachment from > >> > Opera? > >> > >> > >> > >> > >> > > > >> > > > >> > > > >> > > >> > >> > >> > >> > > > > > > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-04 14:26 ` paawan oza @ 2009-08-04 14:43 ` Hui Zhu 2009-08-04 17:59 ` paawan oza 0 siblings, 1 reply; 10+ messages in thread From: Hui Zhu @ 2009-08-04 14:43 UTC (permalink / raw) To: paawan oza; +Cc: Michael Snyder, gdb-patches ./gdb ./a.out GNU gdb (GDB) 6.8.50.20090804-cvs Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 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: <http://www.gnu.org/software/gdb/bugs/>... 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/rec/bgdbno/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 0x8048c74: file 1.c, line 197. Starting program: /home/teawater/gdb/rec/bgdbno/gdb/a.out Temporary breakpoint 1, main () at 1.c:197 197 init_floats(); (gdb) record (gdb) info all-registers eax 0x1 1 ecx 0xbffff780 -1073744000 edx 0xbffff7a0 -1073743968 ebx 0xb7f9eff4 -1208356876 esp 0xbffff760 0xbffff760 ebp 0xbffff768 0xbffff768 esi 0xb7ffece0 -1207964448 edi 0x0 0 eip 0x8048c74 0x8048c74 <main+17> eflags 0x200286 [ PF SF IF ID ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 st0 0 (raw 0x00000000000000000000) st1 0 (raw 0x00000000000000000000) st2 0 (raw 0x00000000000000000000) st3 0 (raw 0x00000000000000000000) st4 0 (raw 0x00000000000000000000) st5 0 (raw 0x00000000000000000000) st6 0 (raw 0x00000000000000000000) st7 0 (raw 0x00000000000000000000) fctrl 0x37f 895 fstat 0x0 0 ftag 0xffff 65535 fiseg 0x0 0 fioff 0x0 0 foseg 0x0 0 fooff 0x0 0 fop 0x0 0 xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, ---Type <return> to continue, or q <return> to quit--- 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} mxcsr 0x1f80 [ IM DM ZM OM UM PM ] mm0 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm1 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm2 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm3 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm4 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm5 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm6 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm7 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} (gdb) (gdb) c Continuing. result is 369.438751 result is 10.320001 result is 23.008301 result is 0.000000 result is 10.450000 result is 10.776012 result is 495830.968750 result is -181.778748 result is 12.525923 result is 2.195619 result is 5.055601 result is inf result is inf result is -0.988032 result is 0.154251 result is -6.405331 result is 1.537475 The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?([y] or n) Process record: inferior program stopped. Program received signal SIGTRAP, Trace/breakpoint trap. 0xb7fe3405 in __kernel_vsyscall () (gdb) rc Continuing. No more reverse-execution history. main () at 1.c:197 197 init_floats(); (gdb) info all-registers eax 0x1 1 ecx 0xbffff780 -1073744000 edx 0xbffff7a0 -1073743968 ebx 0xb7f9eff4 -1208356876 esp 0xbffff760 0xbffff760 ebp 0xbffff768 0xbffff768 esi 0xb7ffece0 -1207964448 edi 0x0 0 eip 0x8048c74 0x8048c74 <main+17> eflags 0x200286 [ PF SF IF ID ] cs 0x73 115 ss 0x7b 123 ds 0x7b 123 es 0x7b 123 fs 0x0 0 gs 0x33 51 st0 0 (raw 0x00000000000000000000) st1 0 (raw 0x00000000000000000000) st2 0 (raw 0x00000000000000000000) st3 0 (raw 0x00000000000000000000) st4 0 (raw 0x00000000000000000000) st5 0 (raw 0x00000000000000000000) st6 0 (raw 0x00000000000000000000) st7 0 (raw 0x00000000000000000000) fctrl 0x37f 895 fstat 0x6069 24681 ftag 0x13f 319 fiseg 0x73 115 fioff 0x8048bfd 134515709 foseg 0x7b 123 fooff 0x0 0 fop 0x2e9 745 xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, ---Type <return> to continue, or q <return> to quit--- 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000} mxcsr 0x1f80 [ IM DM ZM OM UM PM ] mm0 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm1 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm2 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm3 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm4 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm5 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm6 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} mm7 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}} (gdb) On Tue, Aug 4, 2009 at 22:25, paawan oza<paawan1982@yahoo.com> wrote: > > Hi Hui, > > tested following line. > line 54: > result = fmodf(no2,no1); > > please see the log below. all registers are same. > > ****************************************************************** > (gdb) n > 52 printf("result is %f\n",result); > (gdb) n > result is 369.438751 > 54 result = fmodf(no2,no1); > (gdb) info all-registers > st0 0 (raw 0x00000000000000000000) > st1 0 (raw 0x00000000000000000000) > st2 0 (raw 0x00000000000000000000) > st3 0 (raw 0x00000000000000000000) > st4 0 (raw 0x00000000000000000000) > st5 0 (raw 0x00000000000000000000) > st6 88.87999725341796875 (raw 0x4005b1c28f0000000000) > st7 369.438751220703125 (raw 0x4007b8b8290000000000) > fctrl 0x37f 895 > fstat 0x20 32 > ftag 0xffff 65535 > fiseg 0x73 115 > fioff 0xb7eccd27 -1209217753 > foseg 0x7b 123 > fooff 0xbfffc0d4 -1073757996 > fop 0x0 0 > (gdb) n > 55 printf("result is %f\n",result); > (gdb) > result is 10.320001 > 57 resultd = fmod(x,y); > (gdb) reverse-next > 55 printf("result is %f\n",result); > (gdb) > 54 result = fmodf(no2,no1); > (gdb) > 52 printf("result is %f\n",result); > (gdb) info all-registers > st0 0 (raw 0x00000000000000000000) > st1 0 (raw 0x00000000000000000000) > st2 0 (raw 0x00000000000000000000) > st3 0 (raw 0x00000000000000000000) > st4 0 (raw 0x00000000000000000000) > st5 0 (raw 0x00000000000000000000) > st6 88.87999725341796875 (raw 0x4005b1c28f0000000000) > st7 369.43873691558837890625 (raw 0x4007b8b8288800000000) > fctrl 0x37f 895 > fstat 0x20 32 > ftag 0xffff 65535 > fiseg 0x73 115 > fioff 0xb7eccd27 -1209217753 > foseg 0x7b 123 > fooff 0xbfffc0d4 -1073757996 > fop 0x0 0 > (gdb) > ****************************************************************** > > --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> wrote: > >> From: Hui Zhu <teawater@gmail.com> >> Subject: Re: final i386.floating.record.patch >> To: "paawan oza" <paawan1982@yahoo.com> >> Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> >> Date: Tuesday, August 4, 2009, 7:28 PM >> I think you can do it with youself. >> >> Hui >> >> On Tue, Aug 4, 2009 at 21:05, paawan oza<paawan1982@yahoo.com> >> wrote: >> > >> > Hi, >> > >> > As I understand you have tried to run the example test >> code which I had sent earlier. >> > >> > please let me know at which c statement (or insn) it >> is causing this ? >> > So I can dig into it more. >> > >> > Thanks & Regards, >> > Oza. >> > >> > >> > --- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> >> wrote: >> > >> >> From: paawan oza <paawan1982@yahoo.com> >> >> Subject: Re: final i386.floating.record.patch >> >> To: "Hui Zhu" <teawater@gmail.com> >> >> Cc: "Michael Snyder" <msnyder@vmware.com>, >> "gdb-patches@sourceware.org" >> <gdb-patches@sourceware.org> >> >> Date: Tuesday, August 4, 2009, 6:32 PM >> >> Hi Hui, >> >> I am not sure which test case (insn) caused >> this. >> >> would you please send me the example (.c file) >> which you >> >> have tried to run ? >> >> please also try to let me know at which insn (at >> which >> >> point it fails). >> >> Regards, >> >> Oza. >> >> >> >> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> >> >> wrote: >> >> >> >> > From: Hui Zhu <teawater@gmail.com> >> >> > Subject: Re: final >> i386.floating.record.patch >> >> > To: "paawan oza" <paawan1982@yahoo.com> >> >> > Cc: "Michael Snyder" <msnyder@vmware.com>, >> >> "gdb-patches@sourceware.org" >> >> <gdb-patches@sourceware.org> >> >> > Date: Tuesday, August 4, 2009, 8:49 AM >> >> > Hi Paawan, >> >> > >> >> > Thanks for your work. >> >> > >> >> > I do a some test works with the test code >> that you >> >> sent in >> >> > before. >> >> > I get the values of fp reg with command >> "info >> >> > all-registers". >> >> > >> >> > It looks like some fp reg's values not right >> in >> >> replay >> >> > mode. >> >> > >> >> > In record mode they are: >> >> > fctrl >> >> > 0x37f 895 >> >> > fstat >> >> > 0x0 0 >> >> > ftag >> >> > 0xffff 65535 >> >> > fiseg >> >> > 0x0 0 >> >> > fioff >> >> > 0x0 0 >> >> > ---Type <return> to continue, or q >> >> <return> to >> >> > quit--- >> >> > foseg >> >> > 0x0 0 >> >> > fooff >> >> > 0x0 0 >> >> > fop >> >> > 0x0 0 >> >> > >> >> > In replay mode they are: >> >> > fctrl >> >> > 0x37f 895 >> >> > fstat >> >> > 0x6069 24681 >> >> > ftag >> >> > 0x557f 21887 >> >> > fiseg >> >> > 0x73 115 >> >> > fioff >> >> > 0x8048bfd 134515709 >> >> > ---Type <return> to continue, or q >> >> <return> to >> >> > quit--- >> >> > foseg >> >> > 0x7b 123 >> >> > fooff >> >> > 0x0 0 >> >> > fop >> >> > 0x2e9 745 >> >> > >> >> > >> >> > >> >> > Thanks, >> >> > Hui >> >> > >> >> > >> >> > #include <stdio.h> >> >> > #include <math.h> >> >> > #include <stdlib.h> >> >> > >> >> > /* the test intends to test following insns. >> >> > flds faddp fstps fstpl fldl fxch fabs fdivrp >> fmulp >> >> fsubrp >> >> > fucomp fnstsw fsqrt >> >> > fchs f2xm1 fyl2x fxtract fprem1 fld fdecstp >> fld1 >> >> fldl2t >> >> > fldl2e FLDPI >> >> > FLDLG2 FLDLN2 >> >> > FLDZ fincstp ffree fptan fpatan fincstp >> fsincos >> >> frndint >> >> > fscale fsin fcos fcmovb >> >> > fcmovbe fcmove fcmovu fcmovnb fcmovnbe fsave >> frstor >> >> fstsw >> >> > */ >> >> > >> >> > float no1,no2,no3,no4,no5,no6,no7; >> >> > double x = 100.345, y = 25.7789; >> >> > long double ldx = 88888888888888888888.88, >> ldy = >> >> > 9999999999999999999.99; >> >> > float result,resultd,resultld; >> >> > float *float_memory; >> >> > >> >> > /* initialization of floats */ >> >> > void init_floats() >> >> > { >> >> > no1 = 10.45; >> >> > no2 = 20.77; >> >> > no3 = 156.89874646; >> >> > no4 = 14.56; >> >> > no5 = 11.11; >> >> > no6 = 66.77; >> >> > no7 = 88.88; >> >> > float_memory = malloc(sizeof(float) * 4); >> >> > *float_memory = 256.256; >> >> > *(float_memory + 1) = 356.356; >> >> > *(float_memory + 2) = 456.456; >> >> > *(float_memory + 3) = 556.556; >> >> > } >> >> > >> >> > /* marks FPU stack as empty */ >> >> > void empty_fpu_stack() >> >> > { >> >> > asm ("ffree %st(1) \n\t" >> >> > "ffree %st(2) \n\t" >> >> > "ffree %st(3) \n\t" >> >> > "ffree %st(4) \n\t" >> >> > "ffree %st(5) \n\t" >> >> > "ffree %st(6) \n\t" >> >> > "ffree %st(7)"); >> >> > } >> >> > >> >> > /* tests floating point arithmatic */ >> >> > void test_arith_floats() >> >> > { >> >> > result = no1 + no2 + no3 + no4 + no5 + no6 >> + >> >> no7; >> >> > printf("result is %f\n",result); >> >> > >> >> > result = fmodf(no2,no1); >> >> > printf("result is %f\n",result); >> >> > >> >> > resultd = fmod(x,y); >> >> > printf("result is %f\n",resultd); >> >> > >> >> > resultld = fmodl(ldy,ldy); >> >> > printf("result is %f\n",resultld); >> >> > >> >> > result = fabsf(no1); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = no3 / no4; >> >> > printf("result is %f\n",result); >> >> > >> >> > result = no1 * no2 * no3 * no4; >> >> > printf("result is %f\n",result); >> >> > >> >> > result = no1 - no2 - no3 - no4; >> >> > printf("result is %f\n",result); >> >> > >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fchs"); >> >> > >> >> > /* test for f2xm1 */ >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("f2xm1"); >> >> > >> >> > asm ("fyl2x"); >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fxtract"); >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fprem1"); >> >> > >> >> > /* decrement fpu stack pointer only status >> >> register should >> >> > get affected */ >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > >> >> > empty_fpu_stack(); >> >> > >> >> > asm ("fld1"); >> >> > asm ("fldl2t"); >> >> > asm ("fldl2e"); >> >> > asm ("fldpi"); >> >> > asm ("fldlg2"); >> >> > asm ("fldln2"); >> >> > asm ("fldz"); >> >> > >> >> > empty_fpu_stack(); >> >> > /* finishing emptying the stack */ >> >> > >> >> > result = sqrt(no3); >> >> > printf("result is %f\n",result); >> >> > } >> >> > >> >> > void test_log_exp_floats() >> >> > { >> >> > result = log10(no3); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = log(no3); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = exp10(no3); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = exp(no3); >> >> > printf("result is %f\n",result); >> >> > } >> >> > >> >> > void test_trigo_floats() >> >> > { >> >> > result = sin(30); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = cos(30); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = tan(30); >> >> > printf("result is %f\n",result); >> >> > >> >> > result = atan(30); >> >> > printf("result is %f\n",result); >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fptan"); >> >> > >> >> > /* changes st1 and popping register stack >> */ >> >> > asm ("fpatan"); >> >> > >> >> > asm("fincstp"); >> >> > asm ("fld %0" : :"m"(float_memory)); >> >> > asm ("fsincos"); >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("frndint"); >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fld %0" : :"m"(*(float_memory+1))); >> >> > asm ("fscale"); >> >> > >> >> > empty_fpu_stack(); >> >> > >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fsin"); >> >> > asm ("fcos"); >> >> > >> >> > /* currently we assume condition likely >> and >> >> always record >> >> > the registers >> >> > code could be optimized only if the flag is >> set >> >> then >> >> > record */ >> >> > asm ("fld %0" : :"m"(*float_memory)); >> >> > asm ("fld %0" : :"m"(*(float_memory+1))); >> >> > asm ("fcmovb %st(1), %st"); >> >> > asm ("fcmovbe %st(1), %st"); >> >> > asm ("fcmove %st(1), %st"); >> >> > asm ("fcmovu %st(1), %st"); >> >> > asm ("fcmovnb %st(1), %st"); >> >> > asm ("fcmovnbe %st(1), %st"); >> >> > >> >> > empty_fpu_stack(); >> >> > /* finished emtyping the stack */ >> >> > } >> >> > >> >> > void test_compare_floats() >> >> > { >> >> > ldy = 88888888888888888888.88; >> >> > if (ldx == ldy) >> >> > ldy = >> >> > 7777777777777777777777777777.777; >> >> > else >> >> > ldy = >> >> > 666666666666666666666666666.666; >> >> > } >> >> > >> >> > /* test loading and saving of FPU environment >> */ >> >> > void test_fpu_env() >> >> > { >> >> > asm ("fsave %0" : "=m"(*float_memory) : ); >> >> > asm ("frstor %0" : : "m"(*float_memory)); >> >> > asm ("fstsw %ax"); >> >> > } >> >> > >> >> > int main() >> >> > { >> >> > init_floats(); >> >> > test_arith_floats(); >> >> > test_log_exp_floats(); >> >> > test_trigo_floats(); >> >> > test_compare_floats(); >> >> > test_fpu_env(); >> >> > } >> >> > >> >> > >> >> > >> >> > >> >> > On Mon, Aug 3, 2009 at 22:56, paawan >> oza<paawan1982@yahoo.com> >> >> > wrote: >> >> > > Hi, >> >> > > >> >> > > please find the patch attached. I have >> attached >> >> as per >> >> > your suggestion. >> >> > > I am attaching it from opera browser. >> >> > > >> >> > > Regards, >> >> > > Oza. >> >> > > >> >> > > --- On Thu, 7/30/09, Michael Snyder >> <msnyder@vmware.com> >> >> > wrote: >> >> > > >> >> > >> From: Michael Snyder <msnyder@vmware.com> >> >> > >> Subject: Re: final >> >> i386.floating.record.patch >> >> > >> To: "paawan oza" <paawan1982@yahoo.com> >> >> > >> Cc: "gdb-patches@sourceware.org" >> >> > <gdb-patches@sourceware.org> >> >> > >> Date: Thursday, July 30, 2009, 11:31 >> PM >> >> > >> paawan oza wrote: >> >> > >> > Hi, >> >> > >> > >> >> > >> > please find my answers below. >> >> > >> > >> >> > >> > 1) Are you using a Windows >> machine to >> >> send >> >> > your >> >> > >> > emails? If so, >> >> > >> > is it possible that there is >> a >> >> Unix/Linux >> >> > >> machine you could >> >> > >> > try >> >> > >> > sending from? Your >> attachments look >> >> OK >> >> > for >> >> > >> me, but >> >> > >> > some people >> >> > >> > seem to have had problems >> with them. >> >> > >> > >> >> > >> > Oza : I used to send all from >> windows >> >> till >> >> > now. >> >> > >> > but this patch I sent it from >> >> Linux...from >> >> > opera. >> >> > >> > 2) And are you using >> cut-and-paste >> >> to >> >> > >> insert the patches >> >> > >> > into the >> >> > >> > body of your email? That >> would >> >> certainly >> >> > >> cause >> >> > >> > problems, because >> >> > >> > tabs might be changed into >> spaces >> >> (which >> >> > is >> >> > >> exactly what >> >> > >> > was >> >> > >> > causing patch to fail for me >> today). >> >> > >> > Oza: yes I am using >> copy-paste....I >> >> dont >> >> > know >> >> > >> any-other way. >> >> > >> > because attachmenet are not >> welcome, so >> >> I am >> >> > not sure >> >> > >> how I could proceed with this. >> >> > >> >> >> > >> It's not that attachments are not >> welcome. >> >> > >> There are various binary encodings >> for >> >> > attachments, and >> >> > >> some of those binary encodings are >> not >> >> welcome. >> >> > I >> >> > >> think >> >> > >> because there's no open-source way >> of >> >> decoding >> >> > them. >> >> > >> >> >> > >> If you look at the list, you'll see >> that >> >> > attachments are >> >> > >> used a lot. >> >> > >> >> >> > >> Copy-and-paste, though, in general >> will not >> >> work, >> >> > because >> >> > >> it >> >> > >> usually changes tabs into spaces, >> which ruins >> >> a >> >> > patch. >> >> > >> >> >> > >> >> >> > >> > I will send you updated >> patch.....may be >> >> I >> >> > might have >> >> > >> mistaken of old gdb file. sorry for >> >> incovenience. >> >> > >> >> >> > >> I think it was just the >> tabs-to-spaces >> >> issue. >> >> > >> Why don't you try sending an >> attachment from >> >> > Opera? >> >> > >> >> >> > >> >> >> > > >> >> > > >> >> > > >> >> > >> >> >> >> >> >> >> >> >> > >> > >> > >> > >> > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-04 14:43 ` Hui Zhu @ 2009-08-04 17:59 ` paawan oza 2009-08-05 1:29 ` Hui Zhu 2009-08-05 1:34 ` final i386.floating.record.patch Michael Snyder 0 siblings, 2 replies; 10+ messages in thread From: paawan oza @ 2009-08-04 17:59 UTC (permalink / raw) To: Hui Zhu; +Cc: Michael Snyder, gdb-patches Hi Hui, please find my analysis as follows. following are the registers which you may find it different. fstat ftag fiseg fioff foseg fooff fop In my opinion, we do not need to record all these registers. because these registers are purly depends on instruction's execution status in FPU unit. for e.g. fop register stores te last opcode executed by x87 FPU unit. fstat register may contain c0, c1, c2, c3 flag status... why we dont need to record, because even if we reply the recod... Anyway these register are going to be change by FPU HW unit based on any fp insn's nature and its execution. (next insn which FPU is going to execute) so it doesnt make much sense to store it, because even if we restore it, FPU unit doesnt use them directly, but FPU HW sets them after executing current fp insn. so anyway they are going to reset as soon as FPU executes next insn. but still if you feel that we must record those registers because user might want to observe those registers, then I can do that. please let me know you opinion about it. Regards, Oza. --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> wrote: > From: Hui Zhu <teawater@gmail.com> > Subject: Re: final i386.floating.record.patch > To: "paawan oza" <paawan1982@yahoo.com> > Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> > Date: Tuesday, August 4, 2009, 8:13 PM > ./gdb ./a.out > GNU gdb (GDB) 6.8.50.20090804-cvs > Copyright (C) 2009 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> > 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: > <http://www.gnu.org/software/gdb/bugs/>... > 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/rec/bgdbno/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 0x8048c74: file 1.c, line 197. > Starting program: /home/teawater/gdb/rec/bgdbno/gdb/a.out > > Temporary breakpoint 1, main () at 1.c:197 > 197 init_floats(); > (gdb) record > (gdb) info all-registers > eax > 0x1 1 > ecx > 0xbffff780 -1073744000 > edx > 0xbffff7a0 -1073743968 > ebx > 0xb7f9eff4 -1208356876 > esp > 0xbffff760 0xbffff760 > ebp > 0xbffff768 0xbffff768 > esi > 0xb7ffece0 -1207964448 > edi > 0x0 0 > eip > 0x8048c74 0x8048c74 <main+17> > eflags > 0x200286 [ PF SF IF ID > ] > cs > 0x73 115 > ss > 0x7b 123 > ds > 0x7b 123 > es > 0x7b 123 > fs > 0x0 0 > gs > 0x33 51 > st0 > 0 (raw 0x00000000000000000000) > st1 > 0 (raw 0x00000000000000000000) > st2 > 0 (raw 0x00000000000000000000) > st3 > 0 (raw 0x00000000000000000000) > st4 > 0 (raw 0x00000000000000000000) > st5 > 0 (raw 0x00000000000000000000) > st6 > 0 (raw 0x00000000000000000000) > st7 > 0 (raw 0x00000000000000000000) > fctrl > 0x37f 895 > fstat > 0x0 0 > ftag > 0xffff 65535 > fiseg > 0x0 0 > fioff > 0x0 0 > foseg > 0x0 0 > fooff > 0x0 0 > fop > 0x0 0 > xmm0 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm1 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > ---Type <return> to continue, or q <return> to > quit--- > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm2 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm3 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm4 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm5 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm6 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm7 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > mxcsr > 0x1f80 [ IM DM ZM OM UM PM ] > mm0 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm1 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm2 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm3 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm4 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm5 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm6 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm7 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > (gdb) > (gdb) c > Continuing. > result is 369.438751 > result is 10.320001 > result is 23.008301 > result is 0.000000 > result is 10.450000 > result is 10.776012 > result is 495830.968750 > result is -181.778748 > result is 12.525923 > result is 2.195619 > result is 5.055601 > result is inf > result is inf > result is -0.988032 > result is 0.154251 > result is -6.405331 > result is 1.537475 > The next instruction is syscall exit_group. It will > make the program > exit. Do you want to stop the program?([y] or n) > Process record: inferior program stopped. > > Program received signal SIGTRAP, Trace/breakpoint trap. > 0xb7fe3405 in __kernel_vsyscall () > (gdb) rc > Continuing. > > No more reverse-execution history. > main () at 1.c:197 > 197 init_floats(); > (gdb) info all-registers > eax > 0x1 1 > ecx > 0xbffff780 -1073744000 > edx > 0xbffff7a0 -1073743968 > ebx > 0xb7f9eff4 -1208356876 > esp > 0xbffff760 0xbffff760 > ebp > 0xbffff768 0xbffff768 > esi > 0xb7ffece0 -1207964448 > edi > 0x0 0 > eip > 0x8048c74 0x8048c74 <main+17> > eflags > 0x200286 [ PF SF IF ID > ] > cs > 0x73 115 > ss > 0x7b 123 > ds > 0x7b 123 > es > 0x7b 123 > fs > 0x0 0 > gs > 0x33 51 > st0 > 0 (raw 0x00000000000000000000) > st1 > 0 (raw 0x00000000000000000000) > st2 > 0 (raw 0x00000000000000000000) > st3 > 0 (raw 0x00000000000000000000) > st4 > 0 (raw 0x00000000000000000000) > st5 > 0 (raw 0x00000000000000000000) > st6 > 0 (raw 0x00000000000000000000) > st7 > 0 (raw 0x00000000000000000000) > fctrl > 0x37f 895 > fstat > 0x6069 24681 > ftag > 0x13f 319 > fiseg > 0x73 115 > fioff > 0x8048bfd 134515709 > foseg > 0x7b 123 > fooff > 0x0 0 > fop > 0x2e9 745 > xmm0 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm1 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > ---Type <return> to continue, or q <return> to > quit--- > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm2 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm3 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm4 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm5 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm6 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > xmm7 {v4_float > = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, > 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = > {0x0, 0x0, 0x0, > 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, > 0x0, 0x0, 0x0}, > v2_int64 = {0x0, 0x0}, uint128 = > 0x00000000000000000000000000000000} > mxcsr > 0x1f80 [ IM DM ZM OM UM PM ] > mm0 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm1 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm2 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm3 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm4 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm5 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm6 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > mm7 {uint64 = 0x0, > v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, > 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, > 0x0, 0x0}} > (gdb) > > > On Tue, Aug 4, 2009 at 22:25, paawan oza<paawan1982@yahoo.com> > wrote: > > > > Hi Hui, > > > > tested following line. > > line 54: > > result = fmodf(no2,no1); > > > > please see the log below. all registers are same. > > > > > ****************************************************************** > > (gdb) n > > 52 printf("result is %f\n",result); > > (gdb) n > > result is 369.438751 > > 54 result = fmodf(no2,no1); > > (gdb) info all-registers > > st0 0 (raw > 0x00000000000000000000) > > st1 0 (raw > 0x00000000000000000000) > > st2 0 (raw > 0x00000000000000000000) > > st3 0 (raw > 0x00000000000000000000) > > st4 0 (raw > 0x00000000000000000000) > > st5 0 (raw > 0x00000000000000000000) > > st6 88.87999725341796875 (raw > 0x4005b1c28f0000000000) > > st7 369.438751220703125 (raw > 0x4007b8b8290000000000) > > fctrl 0x37f 895 > > fstat 0x20 32 > > ftag 0xffff 65535 > > fiseg 0x73 115 > > fioff 0xb7eccd27 -1209217753 > > foseg 0x7b 123 > > fooff 0xbfffc0d4 -1073757996 > > fop 0x0 0 > > (gdb) n > > 55 printf("result is %f\n",result); > > (gdb) > > result is 10.320001 > > 57 resultd = fmod(x,y); > > (gdb) reverse-next > > 55 printf("result is %f\n",result); > > (gdb) > > 54 result = fmodf(no2,no1); > > (gdb) > > 52 printf("result is %f\n",result); > > (gdb) info all-registers > > st0 0 (raw > 0x00000000000000000000) > > st1 0 (raw > 0x00000000000000000000) > > st2 0 (raw > 0x00000000000000000000) > > st3 0 (raw > 0x00000000000000000000) > > st4 0 (raw > 0x00000000000000000000) > > st5 0 (raw > 0x00000000000000000000) > > st6 88.87999725341796875 (raw > 0x4005b1c28f0000000000) > > st7 369.43873691558837890625 (raw > 0x4007b8b8288800000000) > > fctrl 0x37f 895 > > fstat 0x20 32 > > ftag 0xffff 65535 > > fiseg 0x73 115 > > fioff 0xb7eccd27 -1209217753 > > foseg 0x7b 123 > > fooff 0xbfffc0d4 -1073757996 > > fop 0x0 0 > > (gdb) > > > ****************************************************************** > > > > --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> > wrote: > > > >> From: Hui Zhu <teawater@gmail.com> > >> Subject: Re: final i386.floating.record.patch > >> To: "paawan oza" <paawan1982@yahoo.com> > >> Cc: "Michael Snyder" <msnyder@vmware.com>, > "gdb-patches@sourceware.org" > <gdb-patches@sourceware.org> > >> Date: Tuesday, August 4, 2009, 7:28 PM > >> I think you can do it with youself. > >> > >> Hui > >> > >> On Tue, Aug 4, 2009 at 21:05, paawan oza<paawan1982@yahoo.com> > >> wrote: > >> > > >> > Hi, > >> > > >> > As I understand you have tried to run the > example test > >> code which I had sent earlier. > >> > > >> > please let me know at which c statement (or > insn) it > >> is causing this ? > >> > So I can dig into it more. > >> > > >> > Thanks & Regards, > >> > Oza. > >> > > >> > > >> > --- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> > >> wrote: > >> > > >> >> From: paawan oza <paawan1982@yahoo.com> > >> >> Subject: Re: final > i386.floating.record.patch > >> >> To: "Hui Zhu" <teawater@gmail.com> > >> >> Cc: "Michael Snyder" <msnyder@vmware.com>, > >> "gdb-patches@sourceware.org" > >> <gdb-patches@sourceware.org> > >> >> Date: Tuesday, August 4, 2009, 6:32 PM > >> >> Hi Hui, > >> >> I am not sure which test case (insn) > caused > >> this. > >> >> would you please send me the example (.c > file) > >> which you > >> >> have tried to run ? > >> >> please also try to let me know at which > insn (at > >> which > >> >> point it fails). > >> >> Regards, > >> >> Oza. > >> >> > >> >> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> > >> >> wrote: > >> >> > >> >> > From: Hui Zhu <teawater@gmail.com> > >> >> > Subject: Re: final > >> i386.floating.record.patch > >> >> > To: "paawan oza" <paawan1982@yahoo.com> > >> >> > Cc: "Michael Snyder" <msnyder@vmware.com>, > >> >> "gdb-patches@sourceware.org" > >> >> <gdb-patches@sourceware.org> > >> >> > Date: Tuesday, August 4, 2009, 8:49 > AM > >> >> > Hi Paawan, > >> >> > > >> >> > Thanks for your work. > >> >> > > >> >> > I do a some test works with the test > code > >> that you > >> >> sent in > >> >> > before. > >> >> > I get the values of fp reg with > command > >> "info > >> >> > all-registers". > >> >> > > >> >> > It looks like some fp reg's values > not right > >> in > >> >> replay > >> >> > mode. > >> >> > > >> >> > In record mode they are: > >> >> > fctrl > >> >> > 0x37f 895 > >> >> > fstat > >> >> > 0x0 0 > >> >> > ftag > >> >> > 0xffff 65535 > >> >> > fiseg > >> >> > 0x0 0 > >> >> > fioff > >> >> > 0x0 0 > >> >> > ---Type <return> to continue, > or q > >> >> <return> to > >> >> > quit--- > >> >> > foseg > >> >> > 0x0 0 > >> >> > fooff > >> >> > 0x0 0 > >> >> > fop > >> >> > 0x0 0 > >> >> > > >> >> > In replay mode they are: > >> >> > fctrl > >> >> > 0x37f 895 > >> >> > fstat > >> >> > 0x6069 24681 > >> >> > ftag > >> >> > 0x557f 21887 > >> >> > fiseg > >> >> > 0x73 115 > >> >> > fioff > >> >> > 0x8048bfd 134515709 > >> >> > ---Type <return> to continue, > or q > >> >> <return> to > >> >> > quit--- > >> >> > foseg > >> >> > 0x7b 123 > >> >> > fooff > >> >> > 0x0 0 > >> >> > fop > >> >> > 0x2e9 745 > >> >> > > >> >> > > >> >> > > >> >> > Thanks, > >> >> > Hui > >> >> > > >> >> > > >> >> > #include <stdio.h> > >> >> > #include <math.h> > >> >> > #include <stdlib.h> > >> >> > > >> >> > /* the test intends to test > following insns. > >> >> > flds faddp fstps fstpl fldl fxch > fabs fdivrp > >> fmulp > >> >> fsubrp > >> >> > fucomp fnstsw fsqrt > >> >> > fchs f2xm1 fyl2x fxtract fprem1 fld > fdecstp > >> fld1 > >> >> fldl2t > >> >> > fldl2e FLDPI > >> >> > FLDLG2 FLDLN2 > >> >> > FLDZ fincstp ffree fptan fpatan > fincstp > >> fsincos > >> >> frndint > >> >> > fscale fsin fcos fcmovb > >> >> > fcmovbe fcmove fcmovu fcmovnb > fcmovnbe fsave > >> frstor > >> >> fstsw > >> >> > */ > >> >> > > >> >> > float no1,no2,no3,no4,no5,no6,no7; > >> >> > double x = 100.345, y = 25.7789; > >> >> > long double ldx = > 88888888888888888888.88, > >> ldy = > >> >> > 9999999999999999999.99; > >> >> > float result,resultd,resultld; > >> >> > float *float_memory; > >> >> > > >> >> > /* initialization of floats */ > >> >> > void init_floats() > >> >> > { > >> >> > no1 = 10.45; > >> >> > no2 = 20.77; > >> >> > no3 = 156.89874646; > >> >> > no4 = 14.56; > >> >> > no5 = 11.11; > >> >> > no6 = 66.77; > >> >> > no7 = 88.88; > >> >> > float_memory = > malloc(sizeof(float) * 4); > >> >> > *float_memory = 256.256; > >> >> > *(float_memory + 1) = 356.356; > >> >> > *(float_memory + 2) = 456.456; > >> >> > *(float_memory + 3) = 556.556; > >> >> > } > >> >> > > >> >> > /* marks FPU stack as empty */ > >> >> > void empty_fpu_stack() > >> >> > { > >> >> > asm ("ffree %st(1) \n\t" > >> >> > "ffree %st(2) \n\t" > >> >> > "ffree %st(3) \n\t" > >> >> > "ffree %st(4) \n\t" > >> >> > "ffree %st(5) \n\t" > >> >> > "ffree %st(6) \n\t" > >> >> > "ffree %st(7)"); > >> >> > } > >> >> > > >> >> > /* tests floating point arithmatic > */ > >> >> > void test_arith_floats() > >> >> > { > >> >> > result = no1 + no2 + no3 + no4 + > no5 + no6 > >> + > >> >> no7; > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = fmodf(no2,no1); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > resultd = fmod(x,y); > >> >> > printf("result is %f\n",resultd); > >> >> > > >> >> > resultld = fmodl(ldy,ldy); > >> >> > printf("result is > %f\n",resultld); > >> >> > > >> >> > result = fabsf(no1); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = no3 / no4; > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = no1 * no2 * no3 * no4; > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = no1 - no2 - no3 - no4; > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fchs"); > >> >> > > >> >> > /* test for f2xm1 */ > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("f2xm1"); > >> >> > > >> >> > asm ("fyl2x"); > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fxtract"); > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fprem1"); > >> >> > > >> >> > /* decrement fpu stack pointer > only status > >> >> register should > >> >> > get affected */ > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > > >> >> > empty_fpu_stack(); > >> >> > > >> >> > asm ("fld1"); > >> >> > asm ("fldl2t"); > >> >> > asm ("fldl2e"); > >> >> > asm ("fldpi"); > >> >> > asm ("fldlg2"); > >> >> > asm ("fldln2"); > >> >> > asm ("fldz"); > >> >> > > >> >> > empty_fpu_stack(); > >> >> > /* finishing emptying the stack > */ > >> >> > > >> >> > result = sqrt(no3); > >> >> > printf("result is %f\n",result); > >> >> > } > >> >> > > >> >> > void test_log_exp_floats() > >> >> > { > >> >> > result = log10(no3); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = log(no3); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = exp10(no3); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = exp(no3); > >> >> > printf("result is %f\n",result); > >> >> > } > >> >> > > >> >> > void test_trigo_floats() > >> >> > { > >> >> > result = sin(30); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = cos(30); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = tan(30); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > result = atan(30); > >> >> > printf("result is %f\n",result); > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fptan"); > >> >> > > >> >> > /* changes st1 and popping > register stack > >> */ > >> >> > asm ("fpatan"); > >> >> > > >> >> > asm("fincstp"); > >> >> > asm ("fld %0" : > :"m"(float_memory)); > >> >> > asm ("fsincos"); > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("frndint"); > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fld %0" : > :"m"(*(float_memory+1))); > >> >> > asm ("fscale"); > >> >> > > >> >> > empty_fpu_stack(); > >> >> > > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fsin"); > >> >> > asm ("fcos"); > >> >> > > >> >> > /* currently we assume condition > likely > >> and > >> >> always record > >> >> > the registers > >> >> > code could be optimized only if > the flag is > >> set > >> >> then > >> >> > record */ > >> >> > asm ("fld %0" : > :"m"(*float_memory)); > >> >> > asm ("fld %0" : > :"m"(*(float_memory+1))); > >> >> > asm ("fcmovb %st(1), %st"); > >> >> > asm ("fcmovbe %st(1), %st"); > >> >> > asm ("fcmove %st(1), %st"); > >> >> > asm ("fcmovu %st(1), %st"); > >> >> > asm ("fcmovnb %st(1), %st"); > >> >> > asm ("fcmovnbe %st(1), %st"); > >> >> > > >> >> > empty_fpu_stack(); > >> >> > /* finished emtyping the stack */ > >> >> > } > >> >> > > >> >> > void test_compare_floats() > >> >> > { > >> >> > ldy = > 88888888888888888888.88; > >> >> > if (ldx == ldy) > >> >> > ldy = > >> >> > 7777777777777777777777777777.777; > >> >> > else > >> >> > ldy = > >> >> > 666666666666666666666666666.666; > >> >> > } > >> >> > > >> >> > /* test loading and saving of FPU > environment > >> */ > >> >> > void test_fpu_env() > >> >> > { > >> >> > asm ("fsave %0" : > "=m"(*float_memory) : ); > >> >> > asm ("frstor %0" : : > "m"(*float_memory)); > >> >> > asm ("fstsw %ax"); > >> >> > } > >> >> > > >> >> > int main() > >> >> > { > >> >> > init_floats(); > >> >> > test_arith_floats(); > >> >> > test_log_exp_floats(); > >> >> > test_trigo_floats(); > >> >> > test_compare_floats(); > >> >> > test_fpu_env(); > >> >> > } > >> >> > > >> >> > > >> >> > > >> >> > > >> >> > On Mon, Aug 3, 2009 at 22:56, > paawan > >> oza<paawan1982@yahoo.com> > >> >> > wrote: > >> >> > > Hi, > >> >> > > > >> >> > > please find the patch attached. > I have > >> attached > >> >> as per > >> >> > your suggestion. > >> >> > > I am attaching it from opera > browser. > >> >> > > > >> >> > > Regards, > >> >> > > Oza. > >> >> > > > >> >> > > --- On Thu, 7/30/09, Michael > Snyder > >> <msnyder@vmware.com> > >> >> > wrote: > >> >> > > > >> >> > >> From: Michael Snyder <msnyder@vmware.com> > >> >> > >> Subject: Re: final > >> >> i386.floating.record.patch > >> >> > >> To: "paawan oza" <paawan1982@yahoo.com> > >> >> > >> Cc: "gdb-patches@sourceware.org" > >> >> > <gdb-patches@sourceware.org> > >> >> > >> Date: Thursday, July 30, > 2009, 11:31 > >> PM > >> >> > >> paawan oza wrote: > >> >> > >> > Hi, > >> >> > >> > > >> >> > >> > please find my answers > below. > >> >> > >> > > >> >> > >> > 1) Are you using a > Windows > >> machine to > >> >> send > >> >> > your > >> >> > >> > emails? If so, > >> >> > >> > is it possible that > there is > >> a > >> >> Unix/Linux > >> >> > >> machine you could > >> >> > >> > try > >> >> > >> > sending from? > Your > >> attachments look > >> >> OK > >> >> > for > >> >> > >> me, but > >> >> > >> > some people > >> >> > >> > seem to have had > problems > >> with them. > >> >> > >> > > >> >> > >> > Oza : I used to send > all from > >> windows > >> >> till > >> >> > now. > >> >> > >> > but this patch I sent > it from > >> >> Linux...from > >> >> > opera. > >> >> > >> > 2) And are you > using > >> cut-and-paste > >> >> to > >> >> > >> insert the patches > >> >> > >> > into the > >> >> > >> > body of your > email? That > >> would > >> >> certainly > >> >> > >> cause > >> >> > >> > problems, because > >> >> > >> > tabs might be > changed into > >> spaces > >> >> (which > >> >> > is > >> >> > >> exactly what > >> >> > >> > was > >> >> > >> > causing patch to > fail for me > >> today). > >> >> > >> > Oza: yes I am using > >> copy-paste....I > >> >> dont > >> >> > know > >> >> > >> any-other way. > >> >> > >> > because attachmenet > are not > >> welcome, so > >> >> I am > >> >> > not sure > >> >> > >> how I could proceed with > this. > >> >> > >> > >> >> > >> It's not that attachments > are not > >> welcome. > >> >> > >> There are various binary > encodings > >> for > >> >> > attachments, and > >> >> > >> some of those binary > encodings are > >> not > >> >> welcome. > >> >> > I > >> >> > >> think > >> >> > >> because there's no > open-source way > >> of > >> >> decoding > >> >> > them. > >> >> > >> > >> >> > >> If you look at the list, > you'll see > >> that > >> >> > attachments are > >> >> > >> used a lot. > >> >> > >> > >> >> > >> Copy-and-paste, though, in > general > >> will not > >> >> work, > >> >> > because > >> >> > >> it > >> >> > >> usually changes tabs into > spaces, > >> which ruins > >> >> a > >> >> > patch. > >> >> > >> > >> >> > >> > >> >> > >> > I will send you > updated > >> patch.....may be > >> >> I > >> >> > might have > >> >> > >> mistaken of old gdb file. > sorry for > >> >> incovenience. > >> >> > >> > >> >> > >> I think it was just the > >> tabs-to-spaces > >> >> issue. > >> >> > >> Why don't you try sending > an > >> attachment from > >> >> > Opera? > >> >> > >> > >> >> > >> > >> >> > > > >> >> > > > >> >> > > > >> >> > > >> >> > >> >> > >> >> > >> >> > >> > > >> > > >> > > >> > > >> > > > > > > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-04 17:59 ` paawan oza @ 2009-08-05 1:29 ` Hui Zhu 2009-08-07 8:39 ` regarding recording of registers paawan oza 2009-08-05 1:34 ` final i386.floating.record.patch Michael Snyder 1 sibling, 1 reply; 10+ messages in thread From: Hui Zhu @ 2009-08-05 1:29 UTC (permalink / raw) To: paawan oza; +Cc: Michael Snyder, gdb-patches I think replay all register is better. Thanks, Hui On Wed, Aug 5, 2009 at 01:59, paawan oza<paawan1982@yahoo.com> wrote: > > Hi Hui, > > please find my analysis as follows. > > following are the registers which you may find it different. > > fstat > ftag > fiseg > fioff > foseg > fooff > fop > > In my opinion, we do not need to record all these registers. because these registers are purly depends on instruction's execution status in FPU unit. > > > for e.g. > fop register stores te last opcode executed by x87 FPU unit. > fstat register may contain c0, c1, c2, c3 flag status... > > why we dont need to record, because even if we reply the recod... > Anyway these register are going to be change by FPU HW unit based on any fp insn's nature and its execution. (next insn which FPU is going to execute) > > so it doesnt make much sense to store it, because even if we restore it, FPU unit doesnt use them directly, but FPU HW sets them after executing current fp insn. so anyway they are going to reset as soon as FPU executes next insn. > > but still if you feel that we must record those registers because user might want to observe those registers, then I can do that. > > please let me know you opinion about it. > > Regards, > Oza. > > --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> wrote: > >> From: Hui Zhu <teawater@gmail.com> >> Subject: Re: final i386.floating.record.patch >> To: "paawan oza" <paawan1982@yahoo.com> >> Cc: "Michael Snyder" <msnyder@vmware.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> >> Date: Tuesday, August 4, 2009, 8:13 PM >> ./gdb ./a.out >> GNU gdb (GDB) 6.8.50.20090804-cvs >> Copyright (C) 2009 Free Software Foundation, Inc. >> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> >> 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: >> <http://www.gnu.org/software/gdb/bugs/>... >> 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/rec/bgdbno/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 0x8048c74: file 1.c, line 197. >> Starting program: /home/teawater/gdb/rec/bgdbno/gdb/a.out >> >> Temporary breakpoint 1, main () at 1.c:197 >> 197 init_floats(); >> (gdb) record >> (gdb) info all-registers >> eax >> 0x1 1 >> ecx >> 0xbffff780 -1073744000 >> edx >> 0xbffff7a0 -1073743968 >> ebx >> 0xb7f9eff4 -1208356876 >> esp >> 0xbffff760 0xbffff760 >> ebp >> 0xbffff768 0xbffff768 >> esi >> 0xb7ffece0 -1207964448 >> edi >> 0x0 0 >> eip >> 0x8048c74 0x8048c74 <main+17> >> eflags >> 0x200286 [ PF SF IF ID >> ] >> cs >> 0x73 115 >> ss >> 0x7b 123 >> ds >> 0x7b 123 >> es >> 0x7b 123 >> fs >> 0x0 0 >> gs >> 0x33 51 >> st0 >> 0 (raw 0x00000000000000000000) >> st1 >> 0 (raw 0x00000000000000000000) >> st2 >> 0 (raw 0x00000000000000000000) >> st3 >> 0 (raw 0x00000000000000000000) >> st4 >> 0 (raw 0x00000000000000000000) >> st5 >> 0 (raw 0x00000000000000000000) >> st6 >> 0 (raw 0x00000000000000000000) >> st7 >> 0 (raw 0x00000000000000000000) >> fctrl >> 0x37f 895 >> fstat >> 0x0 0 >> ftag >> 0xffff 65535 >> fiseg >> 0x0 0 >> fioff >> 0x0 0 >> foseg >> 0x0 0 >> fooff >> 0x0 0 >> fop >> 0x0 0 >> xmm0 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm1 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> ---Type <return> to continue, or q <return> to >> quit--- >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm2 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm3 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm4 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm5 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm6 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm7 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> mxcsr >> 0x1f80 [ IM DM ZM OM UM PM ] >> mm0 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm1 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm2 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm3 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm4 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm5 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm6 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm7 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> (gdb) >> (gdb) c >> Continuing. >> result is 369.438751 >> result is 10.320001 >> result is 23.008301 >> result is 0.000000 >> result is 10.450000 >> result is 10.776012 >> result is 495830.968750 >> result is -181.778748 >> result is 12.525923 >> result is 2.195619 >> result is 5.055601 >> result is inf >> result is inf >> result is -0.988032 >> result is 0.154251 >> result is -6.405331 >> result is 1.537475 >> The next instruction is syscall exit_group. It will >> make the program >> exit. Do you want to stop the program?([y] or n) >> Process record: inferior program stopped. >> >> Program received signal SIGTRAP, Trace/breakpoint trap. >> 0xb7fe3405 in __kernel_vsyscall () >> (gdb) rc >> Continuing. >> >> No more reverse-execution history. >> main () at 1.c:197 >> 197 init_floats(); >> (gdb) info all-registers >> eax >> 0x1 1 >> ecx >> 0xbffff780 -1073744000 >> edx >> 0xbffff7a0 -1073743968 >> ebx >> 0xb7f9eff4 -1208356876 >> esp >> 0xbffff760 0xbffff760 >> ebp >> 0xbffff768 0xbffff768 >> esi >> 0xb7ffece0 -1207964448 >> edi >> 0x0 0 >> eip >> 0x8048c74 0x8048c74 <main+17> >> eflags >> 0x200286 [ PF SF IF ID >> ] >> cs >> 0x73 115 >> ss >> 0x7b 123 >> ds >> 0x7b 123 >> es >> 0x7b 123 >> fs >> 0x0 0 >> gs >> 0x33 51 >> st0 >> 0 (raw 0x00000000000000000000) >> st1 >> 0 (raw 0x00000000000000000000) >> st2 >> 0 (raw 0x00000000000000000000) >> st3 >> 0 (raw 0x00000000000000000000) >> st4 >> 0 (raw 0x00000000000000000000) >> st5 >> 0 (raw 0x00000000000000000000) >> st6 >> 0 (raw 0x00000000000000000000) >> st7 >> 0 (raw 0x00000000000000000000) >> fctrl >> 0x37f 895 >> fstat >> 0x6069 24681 >> ftag >> 0x13f 319 >> fiseg >> 0x73 115 >> fioff >> 0x8048bfd 134515709 >> foseg >> 0x7b 123 >> fooff >> 0x0 0 >> fop >> 0x2e9 745 >> xmm0 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm1 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> ---Type <return> to continue, or q <return> to >> quit--- >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm2 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm3 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm4 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm5 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm6 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> xmm7 {v4_float >> = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, >> 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = >> {0x0, 0x0, 0x0, >> 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, >> 0x0, 0x0, 0x0}, >> v2_int64 = {0x0, 0x0}, uint128 = >> 0x00000000000000000000000000000000} >> mxcsr >> 0x1f80 [ IM DM ZM OM UM PM ] >> mm0 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm1 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm2 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm3 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm4 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm5 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm6 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> mm7 {uint64 = 0x0, >> v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, >> 0x0, 0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, >> 0x0, 0x0}} >> (gdb) >> >> >> On Tue, Aug 4, 2009 at 22:25, paawan oza<paawan1982@yahoo.com> >> wrote: >> > >> > Hi Hui, >> > >> > tested following line. >> > line 54: >> > result = fmodf(no2,no1); >> > >> > please see the log below. all registers are same. >> > >> > >> ****************************************************************** >> > (gdb) n >> > 52 printf("result is %f\n",result); >> > (gdb) n >> > result is 369.438751 >> > 54 result = fmodf(no2,no1); >> > (gdb) info all-registers >> > st0 0 (raw >> 0x00000000000000000000) >> > st1 0 (raw >> 0x00000000000000000000) >> > st2 0 (raw >> 0x00000000000000000000) >> > st3 0 (raw >> 0x00000000000000000000) >> > st4 0 (raw >> 0x00000000000000000000) >> > st5 0 (raw >> 0x00000000000000000000) >> > st6 88.87999725341796875 (raw >> 0x4005b1c28f0000000000) >> > st7 369.438751220703125 (raw >> 0x4007b8b8290000000000) >> > fctrl 0x37f 895 >> > fstat 0x20 32 >> > ftag 0xffff 65535 >> > fiseg 0x73 115 >> > fioff 0xb7eccd27 -1209217753 >> > foseg 0x7b 123 >> > fooff 0xbfffc0d4 -1073757996 >> > fop 0x0 0 >> > (gdb) n >> > 55 printf("result is %f\n",result); >> > (gdb) >> > result is 10.320001 >> > 57 resultd = fmod(x,y); >> > (gdb) reverse-next >> > 55 printf("result is %f\n",result); >> > (gdb) >> > 54 result = fmodf(no2,no1); >> > (gdb) >> > 52 printf("result is %f\n",result); >> > (gdb) info all-registers >> > st0 0 (raw >> 0x00000000000000000000) >> > st1 0 (raw >> 0x00000000000000000000) >> > st2 0 (raw >> 0x00000000000000000000) >> > st3 0 (raw >> 0x00000000000000000000) >> > st4 0 (raw >> 0x00000000000000000000) >> > st5 0 (raw >> 0x00000000000000000000) >> > st6 88.87999725341796875 (raw >> 0x4005b1c28f0000000000) >> > st7 369.43873691558837890625 (raw >> 0x4007b8b8288800000000) >> > fctrl 0x37f 895 >> > fstat 0x20 32 >> > ftag 0xffff 65535 >> > fiseg 0x73 115 >> > fioff 0xb7eccd27 -1209217753 >> > foseg 0x7b 123 >> > fooff 0xbfffc0d4 -1073757996 >> > fop 0x0 0 >> > (gdb) >> > >> ****************************************************************** >> > >> > --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> >> wrote: >> > >> >> From: Hui Zhu <teawater@gmail.com> >> >> Subject: Re: final i386.floating.record.patch >> >> To: "paawan oza" <paawan1982@yahoo.com> >> >> Cc: "Michael Snyder" <msnyder@vmware.com>, >> "gdb-patches@sourceware.org" >> <gdb-patches@sourceware.org> >> >> Date: Tuesday, August 4, 2009, 7:28 PM >> >> I think you can do it with youself. >> >> >> >> Hui >> >> >> >> On Tue, Aug 4, 2009 at 21:05, paawan oza<paawan1982@yahoo.com> >> >> wrote: >> >> > >> >> > Hi, >> >> > >> >> > As I understand you have tried to run the >> example test >> >> code which I had sent earlier. >> >> > >> >> > please let me know at which c statement (or >> insn) it >> >> is causing this ? >> >> > So I can dig into it more. >> >> > >> >> > Thanks & Regards, >> >> > Oza. >> >> > >> >> > >> >> > --- On Tue, 8/4/09, paawan oza <paawan1982@yahoo.com> >> >> wrote: >> >> > >> >> >> From: paawan oza <paawan1982@yahoo.com> >> >> >> Subject: Re: final >> i386.floating.record.patch >> >> >> To: "Hui Zhu" <teawater@gmail.com> >> >> >> Cc: "Michael Snyder" <msnyder@vmware.com>, >> >> "gdb-patches@sourceware.org" >> >> <gdb-patches@sourceware.org> >> >> >> Date: Tuesday, August 4, 2009, 6:32 PM >> >> >> Hi Hui, >> >> >> I am not sure which test case (insn) >> caused >> >> this. >> >> >> would you please send me the example (.c >> file) >> >> which you >> >> >> have tried to run ? >> >> >> please also try to let me know at which >> insn (at >> >> which >> >> >> point it fails). >> >> >> Regards, >> >> >> Oza. >> >> >> >> >> >> --- On Tue, 8/4/09, Hui Zhu <teawater@gmail.com> >> >> >> wrote: >> >> >> >> >> >> > From: Hui Zhu <teawater@gmail.com> >> >> >> > Subject: Re: final >> >> i386.floating.record.patch >> >> >> > To: "paawan oza" <paawan1982@yahoo.com> >> >> >> > Cc: "Michael Snyder" <msnyder@vmware.com>, >> >> >> "gdb-patches@sourceware.org" >> >> >> <gdb-patches@sourceware.org> >> >> >> > Date: Tuesday, August 4, 2009, 8:49 >> AM >> >> >> > Hi Paawan, >> >> >> > >> >> >> > Thanks for your work. >> >> >> > >> >> >> > I do a some test works with the test >> code >> >> that you >> >> >> sent in >> >> >> > before. >> >> >> > I get the values of fp reg with >> command >> >> "info >> >> >> > all-registers". >> >> >> > >> >> >> > It looks like some fp reg's values >> not right >> >> in >> >> >> replay >> >> >> > mode. >> >> >> > >> >> >> > In record mode they are: >> >> >> > fctrl >> >> >> > 0x37f 895 >> >> >> > fstat >> >> >> > 0x0 0 >> >> >> > ftag >> >> >> > 0xffff 65535 >> >> >> > fiseg >> >> >> > 0x0 0 >> >> >> > fioff >> >> >> > 0x0 0 >> >> >> > ---Type <return> to continue, >> or q >> >> >> <return> to >> >> >> > quit--- >> >> >> > foseg >> >> >> > 0x0 0 >> >> >> > fooff >> >> >> > 0x0 0 >> >> >> > fop >> >> >> > 0x0 0 >> >> >> > >> >> >> > In replay mode they are: >> >> >> > fctrl >> >> >> > 0x37f 895 >> >> >> > fstat >> >> >> > 0x6069 24681 >> >> >> > ftag >> >> >> > 0x557f 21887 >> >> >> > fiseg >> >> >> > 0x73 115 >> >> >> > fioff >> >> >> > 0x8048bfd 134515709 >> >> >> > ---Type <return> to continue, >> or q >> >> >> <return> to >> >> >> > quit--- >> >> >> > foseg >> >> >> > 0x7b 123 >> >> >> > fooff >> >> >> > 0x0 0 >> >> >> > fop >> >> >> > 0x2e9 745 >> >> >> > >> >> >> > >> >> >> > >> >> >> > Thanks, >> >> >> > Hui >> >> >> > >> >> >> > >> >> >> > #include <stdio.h> >> >> >> > #include <math.h> >> >> >> > #include <stdlib.h> >> >> >> > >> >> >> > /* the test intends to test >> following insns. >> >> >> > flds faddp fstps fstpl fldl fxch >> fabs fdivrp >> >> fmulp >> >> >> fsubrp >> >> >> > fucomp fnstsw fsqrt >> >> >> > fchs f2xm1 fyl2x fxtract fprem1 fld >> fdecstp >> >> fld1 >> >> >> fldl2t >> >> >> > fldl2e FLDPI >> >> >> > FLDLG2 FLDLN2 >> >> >> > FLDZ fincstp ffree fptan fpatan >> fincstp >> >> fsincos >> >> >> frndint >> >> >> > fscale fsin fcos fcmovb >> >> >> > fcmovbe fcmove fcmovu fcmovnb >> fcmovnbe fsave >> >> frstor >> >> >> fstsw >> >> >> > */ >> >> >> > >> >> >> > float no1,no2,no3,no4,no5,no6,no7; >> >> >> > double x = 100.345, y = 25.7789; >> >> >> > long double ldx = >> 88888888888888888888.88, >> >> ldy = >> >> >> > 9999999999999999999.99; >> >> >> > float result,resultd,resultld; >> >> >> > float *float_memory; >> >> >> > >> >> >> > /* initialization of floats */ >> >> >> > void init_floats() >> >> >> > { >> >> >> > no1 = 10.45; >> >> >> > no2 = 20.77; >> >> >> > no3 = 156.89874646; >> >> >> > no4 = 14.56; >> >> >> > no5 = 11.11; >> >> >> > no6 = 66.77; >> >> >> > no7 = 88.88; >> >> >> > float_memory = >> malloc(sizeof(float) * 4); >> >> >> > *float_memory = 256.256; >> >> >> > *(float_memory + 1) = 356.356; >> >> >> > *(float_memory + 2) = 456.456; >> >> >> > *(float_memory + 3) = 556.556; >> >> >> > } >> >> >> > >> >> >> > /* marks FPU stack as empty */ >> >> >> > void empty_fpu_stack() >> >> >> > { >> >> >> > asm ("ffree %st(1) \n\t" >> >> >> > "ffree %st(2) \n\t" >> >> >> > "ffree %st(3) \n\t" >> >> >> > "ffree %st(4) \n\t" >> >> >> > "ffree %st(5) \n\t" >> >> >> > "ffree %st(6) \n\t" >> >> >> > "ffree %st(7)"); >> >> >> > } >> >> >> > >> >> >> > /* tests floating point arithmatic >> */ >> >> >> > void test_arith_floats() >> >> >> > { >> >> >> > result = no1 + no2 + no3 + no4 + >> no5 + no6 >> >> + >> >> >> no7; >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = fmodf(no2,no1); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > resultd = fmod(x,y); >> >> >> > printf("result is %f\n",resultd); >> >> >> > >> >> >> > resultld = fmodl(ldy,ldy); >> >> >> > printf("result is >> %f\n",resultld); >> >> >> > >> >> >> > result = fabsf(no1); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = no3 / no4; >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = no1 * no2 * no3 * no4; >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = no1 - no2 - no3 - no4; >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fchs"); >> >> >> > >> >> >> > /* test for f2xm1 */ >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("f2xm1"); >> >> >> > >> >> >> > asm ("fyl2x"); >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fxtract"); >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fprem1"); >> >> >> > >> >> >> > /* decrement fpu stack pointer >> only status >> >> >> register should >> >> >> > get affected */ >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > >> >> >> > empty_fpu_stack(); >> >> >> > >> >> >> > asm ("fld1"); >> >> >> > asm ("fldl2t"); >> >> >> > asm ("fldl2e"); >> >> >> > asm ("fldpi"); >> >> >> > asm ("fldlg2"); >> >> >> > asm ("fldln2"); >> >> >> > asm ("fldz"); >> >> >> > >> >> >> > empty_fpu_stack(); >> >> >> > /* finishing emptying the stack >> */ >> >> >> > >> >> >> > result = sqrt(no3); >> >> >> > printf("result is %f\n",result); >> >> >> > } >> >> >> > >> >> >> > void test_log_exp_floats() >> >> >> > { >> >> >> > result = log10(no3); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = log(no3); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = exp10(no3); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = exp(no3); >> >> >> > printf("result is %f\n",result); >> >> >> > } >> >> >> > >> >> >> > void test_trigo_floats() >> >> >> > { >> >> >> > result = sin(30); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = cos(30); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = tan(30); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > result = atan(30); >> >> >> > printf("result is %f\n",result); >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fptan"); >> >> >> > >> >> >> > /* changes st1 and popping >> register stack >> >> */ >> >> >> > asm ("fpatan"); >> >> >> > >> >> >> > asm("fincstp"); >> >> >> > asm ("fld %0" : >> :"m"(float_memory)); >> >> >> > asm ("fsincos"); >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("frndint"); >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fld %0" : >> :"m"(*(float_memory+1))); >> >> >> > asm ("fscale"); >> >> >> > >> >> >> > empty_fpu_stack(); >> >> >> > >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fsin"); >> >> >> > asm ("fcos"); >> >> >> > >> >> >> > /* currently we assume condition >> likely >> >> and >> >> >> always record >> >> >> > the registers >> >> >> > code could be optimized only if >> the flag is >> >> set >> >> >> then >> >> >> > record */ >> >> >> > asm ("fld %0" : >> :"m"(*float_memory)); >> >> >> > asm ("fld %0" : >> :"m"(*(float_memory+1))); >> >> >> > asm ("fcmovb %st(1), %st"); >> >> >> > asm ("fcmovbe %st(1), %st"); >> >> >> > asm ("fcmove %st(1), %st"); >> >> >> > asm ("fcmovu %st(1), %st"); >> >> >> > asm ("fcmovnb %st(1), %st"); >> >> >> > asm ("fcmovnbe %st(1), %st"); >> >> >> > >> >> >> > empty_fpu_stack(); >> >> >> > /* finished emtyping the stack */ >> >> >> > } >> >> >> > >> >> >> > void test_compare_floats() >> >> >> > { >> >> >> > ldy = >> 88888888888888888888.88; >> >> >> > if (ldx == ldy) >> >> >> > ldy = >> >> >> > 7777777777777777777777777777.777; >> >> >> > else >> >> >> > ldy = >> >> >> > 666666666666666666666666666.666; >> >> >> > } >> >> >> > >> >> >> > /* test loading and saving of FPU >> environment >> >> */ >> >> >> > void test_fpu_env() >> >> >> > { >> >> >> > asm ("fsave %0" : >> "=m"(*float_memory) : ); >> >> >> > asm ("frstor %0" : : >> "m"(*float_memory)); >> >> >> > asm ("fstsw %ax"); >> >> >> > } >> >> >> > >> >> >> > int main() >> >> >> > { >> >> >> > init_floats(); >> >> >> > test_arith_floats(); >> >> >> > test_log_exp_floats(); >> >> >> > test_trigo_floats(); >> >> >> > test_compare_floats(); >> >> >> > test_fpu_env(); >> >> >> > } >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> > On Mon, Aug 3, 2009 at 22:56, >> paawan >> >> oza<paawan1982@yahoo.com> >> >> >> > wrote: >> >> >> > > Hi, >> >> >> > > >> >> >> > > please find the patch attached. >> I have >> >> attached >> >> >> as per >> >> >> > your suggestion. >> >> >> > > I am attaching it from opera >> browser. >> >> >> > > >> >> >> > > Regards, >> >> >> > > Oza. >> >> >> > > >> >> >> > > --- On Thu, 7/30/09, Michael >> Snyder >> >> <msnyder@vmware.com> >> >> >> > wrote: >> >> >> > > >> >> >> > >> From: Michael Snyder <msnyder@vmware.com> >> >> >> > >> Subject: Re: final >> >> >> i386.floating.record.patch >> >> >> > >> To: "paawan oza" <paawan1982@yahoo.com> >> >> >> > >> Cc: "gdb-patches@sourceware.org" >> >> >> > <gdb-patches@sourceware.org> >> >> >> > >> Date: Thursday, July 30, >> 2009, 11:31 >> >> PM >> >> >> > >> paawan oza wrote: >> >> >> > >> > Hi, >> >> >> > >> > >> >> >> > >> > please find my answers >> below. >> >> >> > >> > >> >> >> > >> > 1) Are you using a >> Windows >> >> machine to >> >> >> send >> >> >> > your >> >> >> > >> > emails? If so, >> >> >> > >> > is it possible that >> there is >> >> a >> >> >> Unix/Linux >> >> >> > >> machine you could >> >> >> > >> > try >> >> >> > >> > sending from? >> Your >> >> attachments look >> >> >> OK >> >> >> > for >> >> >> > >> me, but >> >> >> > >> > some people >> >> >> > >> > seem to have had >> problems >> >> with them. >> >> >> > >> > >> >> >> > >> > Oza : I used to send >> all from >> >> windows >> >> >> till >> >> >> > now. >> >> >> > >> > but this patch I sent >> it from >> >> >> Linux...from >> >> >> > opera. >> >> >> > >> > 2) And are you >> using >> >> cut-and-paste >> >> >> to >> >> >> > >> insert the patches >> >> >> > >> > into the >> >> >> > >> > body of your >> email? That >> >> would >> >> >> certainly >> >> >> > >> cause >> >> >> > >> > problems, because >> >> >> > >> > tabs might be >> changed into >> >> spaces >> >> >> (which >> >> >> > is >> >> >> > >> exactly what >> >> >> > >> > was >> >> >> > >> > causing patch to >> fail for me >> >> today). >> >> >> > >> > Oza: yes I am using >> >> copy-paste....I >> >> >> dont >> >> >> > know >> >> >> > >> any-other way. >> >> >> > >> > because attachmenet >> are not >> >> welcome, so >> >> >> I am >> >> >> > not sure >> >> >> > >> how I could proceed with >> this. >> >> >> > >> >> >> >> > >> It's not that attachments >> are not >> >> welcome. >> >> >> > >> There are various binary >> encodings >> >> for >> >> >> > attachments, and >> >> >> > >> some of those binary >> encodings are >> >> not >> >> >> welcome. >> >> >> > I >> >> >> > >> think >> >> >> > >> because there's no >> open-source way >> >> of >> >> >> decoding >> >> >> > them. >> >> >> > >> >> >> >> > >> If you look at the list, >> you'll see >> >> that >> >> >> > attachments are >> >> >> > >> used a lot. >> >> >> > >> >> >> >> > >> Copy-and-paste, though, in >> general >> >> will not >> >> >> work, >> >> >> > because >> >> >> > >> it >> >> >> > >> usually changes tabs into >> spaces, >> >> which ruins >> >> >> a >> >> >> > patch. >> >> >> > >> >> >> >> > >> >> >> >> > >> > I will send you >> updated >> >> patch.....may be >> >> >> I >> >> >> > might have >> >> >> > >> mistaken of old gdb file. >> sorry for >> >> >> incovenience. >> >> >> > >> >> >> >> > >> I think it was just the >> >> tabs-to-spaces >> >> >> issue. >> >> >> > >> Why don't you try sending >> an >> >> attachment from >> >> >> > Opera? >> >> >> > >> >> >> >> > >> >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> > >> >> >> > >> > >> > >> > >> > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* regarding recording of registers.... 2009-08-05 1:29 ` Hui Zhu @ 2009-08-07 8:39 ` paawan oza 0 siblings, 0 replies; 10+ messages in thread From: paawan oza @ 2009-08-07 8:39 UTC (permalink / raw) To: Hui Zhu, Michael Snyder; +Cc: gdb-patches Hi Hui & Michael, There has been one thing I have been thinking. May be I will need your opinions. there are many registers we save and sometimes we may not be 100% sure, for e.g. some staus registers like eflags, or any status, control, opcode registers whose change depedns purely on the current state of the syetem and more precisely current instruction's execution. so how about implementing a cache mechinism (or it may be already there), which has a state of all registers all the time, and we record only those registers which are actauylly changed.as and wehn it is changed we update cache. this has intension to save record memory. of course this is only applicable when we are in record mode. I would be looking forward to having some inputs whether this is a good idea to do ! Regards, Oza. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-04 17:59 ` paawan oza 2009-08-05 1:29 ` Hui Zhu @ 2009-08-05 1:34 ` Michael Snyder 2009-08-05 13:48 ` paawan oza 1 sibling, 1 reply; 10+ messages in thread From: Michael Snyder @ 2009-08-05 1:34 UTC (permalink / raw) To: paawan oza; +Cc: Hui Zhu, gdb-patches paawan oza wrote: > Hi Hui, > > please find my analysis as follows. > > following are the registers which you may find it different. > > fstat > ftag > fiseg > fioff > foseg > fooff > fop > > In my opinion, we do not need to record all these registers. because these registers are purly depends on instruction's execution status in FPU unit. > > > for e.g. > fop register stores te last opcode executed by x87 FPU unit. > fstat register may contain c0, c1, c2, c3 flag status... > > why we dont need to record, because even if we reply the recod... > Anyway these register are going to be change by FPU HW unit based on any fp insn's nature and its execution. (next insn which FPU is going to execute) > > so it doesnt make much sense to store it, because even if we restore it, FPU unit doesnt use them directly, but FPU HW sets them after executing current fp insn. so anyway they are going to reset as soon as FPU executes next insn. > > but still if you feel that we must record those registers because user might want to observe those registers, then I can do that. > > please let me know you opinion about it. It may be that saving the registers is not purely necessary, but we are not just a simulator -- we are a debugger. The user might be confused if he steps backward and sees that the register did not change. So I think we should preserve it and revert it. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: final i386.floating.record.patch 2009-08-05 1:34 ` final i386.floating.record.patch Michael Snyder @ 2009-08-05 13:48 ` paawan oza 0 siblings, 0 replies; 10+ messages in thread From: paawan oza @ 2009-08-05 13:48 UTC (permalink / raw) To: Michael Snyder; +Cc: Hui Zhu, gdb-patches Hi Hui and Michael, Sure, I will preserve it. I modify the code and preserve it. I will send you the updated patch soon. this modification does not affect the core functionality, but as you suggested, we are debugger, and should revert all register back. thank you for your inputs. Regards, Oza. --- On Wed, 8/5/09, Michael Snyder <msnyder@vmware.com> wrote: > From: Michael Snyder <msnyder@vmware.com> > Subject: Re: final i386.floating.record.patch > To: "paawan oza" <paawan1982@yahoo.com> > Cc: "Hui Zhu" <teawater@gmail.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> > Date: Wednesday, August 5, 2009, 7:03 AM > paawan oza wrote: > > Hi Hui, > > > > please find my analysis as follows. > > > > following are the registers which you may find it > different. > > > > fstat > > ftag > > fiseg > > fioff > > foseg > > fooff > > fop > > > > In my opinion, we do not need to record all these > registers. because these registers are purly depends on > instruction's execution status in FPU unit. > > > > > > for e.g. > > fop register stores te last opcode executed by x87 FPU > unit. > > fstat register may contain c0, c1, c2, c3 flag > status... > > > > why we dont need to record, because even if we reply > the recod... > > Anyway these register are going to be change by FPU HW > unit based on any fp insn's nature and its execution. (next > insn which FPU is going to execute) > > > > so it doesnt make much sense to store it, because even > if we restore it, FPU unit doesnt use them directly, but FPU > HW sets them after executing current fp insn. so anyway they > are going to reset as soon as FPU executes next insn. > > > > but still if you feel that we must record those > registers because user might want to observe those > registers, then I can do that. > > > > please let me know you opinion about it. > > It may be that saving the registers is not purely > necessary, but > we are not just a simulator -- we are a debugger. The > user might > be confused if he steps backward and sees that the register > did not > change. > > So I think we should preserve it and revert it. > > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-08-07 7:25 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-08-04 13:06 final i386.floating.record.patch paawan oza 2009-08-04 13:58 ` Hui Zhu 2009-08-04 14:18 ` paawan oza 2009-08-04 14:26 ` paawan oza 2009-08-04 14:43 ` Hui Zhu 2009-08-04 17:59 ` paawan oza 2009-08-05 1:29 ` Hui Zhu 2009-08-07 8:39 ` regarding recording of registers paawan oza 2009-08-05 1:34 ` final i386.floating.record.patch Michael Snyder 2009-08-05 13:48 ` paawan oza
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox