From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30166 invoked by alias); 18 Aug 2009 13:48:25 -0000 Received: (qmail 30152 invoked by uid 22791); 18 Aug 2009 13:48:22 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21,J_CHICKENPOX_41,J_CHICKENPOX_46,J_CHICKENPOX_53 X-Spam-Check-By: sourceware.org Received: from web112502.mail.gq1.yahoo.com (HELO web112502.mail.gq1.yahoo.com) (98.137.26.78) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 18 Aug 2009 13:48:14 +0000 Received: (qmail 36289 invoked by uid 60001); 18 Aug 2009 13:48:12 -0000 Message-ID: <128654.34357.qm@web112502.mail.gq1.yahoo.com> Received: from [123.238.27.96] by web112502.mail.gq1.yahoo.com via HTTP; Tue, 18 Aug 2009 06:48:11 PDT Date: Tue, 18 Aug 2009 15:22:00 -0000 From: paawan oza Subject: Re: final i386.floating.record.patch To: Michael Snyder , Hui Zhu Cc: "gdb-patches@sourceware.org" , Mark Kettenis MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00276.txt.bz2 Hi, Another analysis and observation is: I used gdb-6.8.50.20090803 and everything seemed okay. Hui used gdb-6.8.50.20090817 and patch was still the same and gdb threw the= se error. was there any thing major changed in gdb ? and gdb throws error in=20 ../../src/gdb/utils.c:1200:=20 which looks like somebody has allocated memory too much or something has go= ne wrong in error checking. the floating-point-patch is still the same, if it works fine with gdb-6.8.5= 0.20090803, it is high unlikely that why should it throw memory allocation = error with gdb-6.8.50.20090817 (unless system is dangerously low in virtual= memory, swap space is full). Regards, Oza. --- On Mon, 8/17/09, paawan oza wrote: > From: paawan oza > Subject: Re: final i386.floating.record.patch > To: "Michael Snyder" , "Hui Zhu" > Cc: "gdb-patches@sourceware.org" , "Mark Kett= enis" > Date: Monday, August 17, 2009, 9:40 PM > Hi Hui, >=20 > I test the same and it seems working fine. Another thing I > observe is, vertual memory is low problem and may be gdb's > virtual address space gets exhausted or any other limit! > highly unlikely though. >=20 > please see the atached log. >=20 > linux-p94d:/home/oza/mk_patch/take_diff/gdb_current/gdb-6.8.50.20090803/g= db > # ./gdb ./test_floats > GNU gdb (GDB) 6.8.50.20090803 > Copyright (C) 2009 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and > redistribute it. > There is NO WARRANTY, to the extent permitted by law.=A0 > Type "show copying" > and "show warranty" for details. > This GDB was configured as "i686-pc-linux-gnu". > For bug reporting instructions, please see: > ... > Setting up the environment for debugging gdb. > Function "internal_error" not defined. > Make breakpoint pending on future shared library load? (y > or [n]) [answered N; input not from terminal] > Function "info_command" not defined. > Make breakpoint pending on future shared library load? (y > or [n]) [answered N; input not from terminal] > /home/oza/mk_patch/take_diff/gdb_current/gdb-6.8.50.20090803/gdb/.gdbinit= :8: > Error in sourced command file: > No breakpoint number 0. > (gdb) start > Temporary breakpoint 1 at 0x8048c94: file ./test_floats.c, > line 196. > Starting program: > /home/oza/mk_patch/take_diff/gdb_current/gdb-6.8.50.20090803/gdb/test_flo= ats >=20 > Temporary breakpoint 1, main () at ./test_floats.c:196 > 196=A0 =A0 =A0 =A0=A0=A0init_floats(); > (gdb) record > (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.=A0 It will > make the program exit.=A0 Do you want to stop the > program?([y] or n) y > Process record: inferior program stopped. >=20 > Program received signal SIGTRAP, Trace/breakpoint trap. > 0xffffe405 in __kernel_vsyscall () > (gdb) >=20 > Regards, > Oza. >=20 >=20 >=20 >=20 > --- On Mon, 8/17/09, Hui Zhu > wrote: >=20 > > From: Hui Zhu > > Subject: Re: final i386.floating.record.patch > > To: "Michael Snyder" > > Cc: "paawan oza" , > "gdb-patches@sourceware.org" > , > "Mark Kettenis" > > Date: Monday, August 17, 2009, 12:06 PM > > Get some error with this patch. > > cat fp.c > > #include > > #include > > #include > >=20 > > /* 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 > > */ > >=20 > > float no1,no2,no3,no4,no5,no6,no7; > > double x =3D 100.345, y =3D 25.7789; > > long double ldx =3D 88888888888888888888.88, ldy =3D > > 9999999999999999999.99; > > float result,resultd,resultld; > > float *float_memory; > >=20 > > /* initialization of floats */ > > void init_floats() > > { > >=A0 no1 =3D 10.45; > >=A0 no2 =3D 20.77; > >=A0 no3 =3D 156.89874646; > >=A0 no4 =3D 14.56; > >=A0 no5 =3D 11.11; > >=A0 no6 =3D 66.77; > >=A0 no7 =3D 88.88; > >=A0 float_memory =3D malloc(sizeof(float) * 4); > >=A0 *float_memory =3D 256.256; > >=A0 *(float_memory + 1) =3D 356.356; > >=A0 *(float_memory + 2) =3D 456.456; > >=A0 *(float_memory + 3) =3D 556.556; > > } > >=20 > > /* marks FPU stack as empty */ > > void empty_fpu_stack() > > { > >=A0 asm ("ffree %st(1) \n\t" > > =A0 =A0 =A0 "ffree %st(2) \n\t" > > =A0 =A0 =A0 "ffree %st(3) \n\t" > > =A0 =A0 =A0 "ffree %st(4) \n\t" > > =A0 =A0 =A0 "ffree %st(5) \n\t" > > =A0 =A0 =A0 "ffree %st(6) \n\t" > > =A0 =A0 =A0 "ffree %st(7)"); > > } > >=20 > > /* tests floating point arithmatic */ > > void test_arith_floats() > > { > >=A0 result =3D no1 + no2 + no3 + no4 + no5 + no6 + > no7; > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D fmodf(no2,no1); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 resultd =3D fmod(x,y); > >=A0 printf("result is %f\n",resultd); > >=20 > >=A0 resultld =3D fmodl(ldy,ldy); > >=A0 printf("result is %f\n",resultld); > >=20 > >=A0 result =3D fabsf(no1); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D no3 / no4; > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D no1 * no2 * no3 * no4; > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D no1 - no2 - no3 - no4; > >=A0 printf("result is %f\n",result); > >=20 > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fchs"); > >=20 > >=A0 /* test for f2xm1 */ > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("f2xm1"); > >=20 > >=A0 asm ("fyl2x"); > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fxtract"); > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fprem1"); > >=20 > >=A0 /* decrement fpu stack pointer only status > register should > > get affected */ > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=20 > >=A0 empty_fpu_stack(); > >=20 > >=A0 asm ("fld1"); > >=A0 asm ("fldl2t"); > >=A0 asm ("fldl2e"); > >=A0 asm ("fldpi"); > >=A0 asm ("fldlg2"); > >=A0 asm ("fldln2"); > >=A0 asm ("fldz"); > >=20 > >=A0 empty_fpu_stack(); > >=A0 /* finishing emptying the stack */ > >=20 > >=A0 result =3D sqrt(no3); > >=A0 printf("result is %f\n",result); > > } > >=20 > > void test_log_exp_floats() > > { > >=A0 result =3D log10(no3); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D log(no3); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D exp10(no3); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D exp(no3); > >=A0 printf("result is %f\n",result); > > } > >=20 > > void test_trigo_floats() > > { > >=A0 result =3D sin(30); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D cos(30); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D tan(30); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 result =3D atan(30); > >=A0 printf("result is %f\n",result); > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fptan"); > >=20 > >=A0 /* changes st1 and popping register stack */ > >=A0 asm ("fpatan"); > >=20 > >=A0 asm("fincstp"); > >=A0 asm ("fld %0" : :"m"(float_memory)); > >=A0 asm ("fsincos"); > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("frndint"); > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fld %0" : :"m"(*(float_memory+1))); > >=A0 asm ("fscale"); > >=20 > >=A0 empty_fpu_stack(); > >=20 > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fsin"); > >=A0 asm ("fcos"); > >=20 > >=A0 /* currently we assume condition likely and > always record > > the registers > >=A0 code could be optimized only if the flag is set > then > > record */ > >=A0 asm ("fld %0" : :"m"(*float_memory)); > >=A0 asm ("fld %0" : :"m"(*(float_memory+1))); > >=A0 asm ("fcmovb %st(1), %st"); > >=A0 asm ("fcmovbe %st(1), %st"); > >=A0 asm ("fcmove %st(1), %st"); > >=A0 asm ("fcmovu %st(1), %st"); > >=A0 asm ("fcmovnb %st(1), %st"); > >=A0 asm ("fcmovnbe %st(1), %st"); > >=20 > >=A0 empty_fpu_stack(); > >=A0 /* finished emtyping the stack */ > > } > >=20 > > void test_compare_floats() > > { > > =A0=A0=A0ldy =3D 88888888888888888888.88; > > =A0=A0=A0if (ldx =3D=3D ldy) > > =A0 =A0=A0=A0ldy =3D > > 7777777777777777777777777777.777; > > =A0=A0=A0else > > =A0 =A0=A0=A0ldy =3D > > 666666666666666666666666666.666; > > } > >=20 > > /* test loading and saving of FPU environment */ > > void test_fpu_env() > > { > >=A0 asm ("fsave %0" : "=3Dm"(*float_memory) : ); > >=A0 asm ("frstor %0" : : "m"(*float_memory)); > >=A0 asm ("fstsw %ax"); > > } > >=20 > > int main() > > { > > =A0=A0=A0init_floats(); > > =A0=A0=A0test_arith_floats(); > > =A0=A0=A0test_log_exp_floats(); > > =A0=A0=A0test_trigo_floats(); > > =A0=A0=A0test_compare_floats(); > > =A0=A0=A0test_fpu_env(); > > } > >=20 > >=20 > >=20 > > ./gdb ./a.out > > GNU gdb (GDB) 6.8.50.20090817-cvs > > Copyright (C) 2009 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later > > This is free software: you are free to change and > > redistribute it. > > There is NO WARRANTY, to the extent permitted by > law.=A0 > > Type "show copying" > > and "show warranty" for details. > > This GDB was configured as "i686-pc-linux-gnu". > > For bug reporting instructions, please see: > > ... > > Setting up the environment for debugging gdb. > > Function "internal_error" not defined. > > Make breakpoint pending on future shared library load? > (y > > or [n]) > > [answered N; input not from terminal] > > Function "info_command" not defined. > > Make breakpoint pending on future shared library load? > (y > > or [n]) > > [answered N; input not from terminal] > > /home/teawater/gdb/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 fp.c, line > 196. > > Starting program: /home/teawater/gdb/bgdbno/gdb/a.out > >=20 > > Temporary breakpoint 1, main () at fp.c:196 > > 196=A0=A0=A0 =A0=A0=A0init_floats(); > > (gdb) record > > (gdb) c > > Continuing. > > ../../src/gdb/utils.c:1200: internal-error: virtual > memory > > exhausted. > > A problem internal to GDB has been detected, > > further debugging may prove unreliable. > > Quit this debugging session? (y or n) n > > ../../src/gdb/utils.c:1200: internal-error: virtual > memory > > exhausted. > > A problem internal to GDB has been detected, > > further debugging may prove unreliable. > > Create a core file of GDB? (y or n) n > >=20 > > Program received signal SIGTRAP, Trace/breakpoint > trap. > > 0xb7eba9bc in memcpy () from > /lib/tls/i686/cmov/libc.so.6 > > (gdb) quit > > A debugging session is active. > >=20 > > =A0=A0=A0 Inferior 1 [process 15657] will be > > killed. > >=20 > > Quit anyway? (y or n) y > >=20 > >=20 > > Thanks, > > Hui > >=20 > > On Mon, Aug 17, 2009 at 05:16, Michael Snyder > > wrote: > > > paawan oza wrote: > > >> > > >> Hi Hui & Michael, > > >> Now we revert status registers also. > > >> please find the patch attached. > > >> I am sorry, if I am not pasting the patch in > > email-body due to tabs&spaces > > >> problem faced by Michael last time. > > >> Regards, > > >> Oza. > > > > > > Looking good! > > > > > > There were some conflicts between your changes > and a > > check-in that > > > happened after your submission =A0-- =A0I've taken > the > > liberty of merging > > > your changes with the cvs head, fixing up the > > conflicts. =A0Hope you > > > don't mind =A0-- =A0merged patch attached. > > > > > > I'll review your tests next. > > > > > > Can you write up a change log entry for this > patch? > > > > > > Hui, Mark, any more comments? > > > > > > Cheers, > > > Michael > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20 >=20