From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30757 invoked by alias); 18 Jul 2009 18:02:09 -0000 Received: (qmail 29978 invoked by uid 22791); 18 Jul 2009 18:02:07 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from web112507.mail.gq1.yahoo.com (HELO web112507.mail.gq1.yahoo.com) (98.137.26.146) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 18 Jul 2009 18:02:01 +0000 Received: (qmail 26389 invoked by uid 60001); 18 Jul 2009 18:01:59 -0000 Message-ID: <644077.26210.qm@web112507.mail.gq1.yahoo.com> Received: from [123.237.142.153] by web112507.mail.gq1.yahoo.com via HTTP; Sat, 18 Jul 2009 11:01:59 PDT Date: Sun, 19 Jul 2009 03:27:00 -0000 From: paawan oza Subject: Re: i386.record.floating.point.patch : with more testing and assurity To: Michael Snyder , Hui Zhu Cc: "gdb-patches@sourceware.org" , Pedro Alves In-Reply-To: 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-07/txt/msg00450.txt.bz2 Hi, thank you for the update. just to confirm....I start adding some tests regarding floatin_patch into src/gdb/testsuite/gdb.reverse Regards, Oza. --- On Wed, 7/15/09, Hui Zhu wrote: > From: Hui Zhu > Subject: Re: i386.record.floating.point.patch : with more testing and ass= urity > To: "Michael Snyder" > Cc: "paawan oza" , "gdb-patches@sourceware.org" , "Pedro Alves" > Date: Wednesday, July 15, 2009, 1:05 PM > I try this test with fp insn > patch.=A0 Everything is OK.=A0 Thanks. >=20 > BTW, I copy them to "src/gdb/testsuite/gdb.reverse".=A0 > And use command > make check RUNTESTFLAGS=3D"i387-float-reverse.exp > --target_board=3Dprecord" > in testsuite directory. >=20 > Thanks, > Hui >=20 > On Tue, Jul 14, 2009 at 03:38, Michael Snyder > wrote: > > Hui Zhu wrote: > >> > >> Could you post it in patch format? =A0That will > make me can try it directly. > >> =A0:) > >> > >> Thanks, > >> Hui > > > > > > OK, but this is not intended as a submission. > > It's just an example or starting point. > > > > Michael > > > > > > diff -rNu gdb.tmp/i387-float-reverse.c > gdb.arch/i387-float-reverse.c > > --- gdb.tmp/i387-float-reverse.c =A0 =A0 =A0 =A01969-12-31 > 16:00:00.000000000 -0800 > > +++ gdb.arch/i387-float-reverse.c =A0 =A0 =A0 2009-07-11 > 17:16:56.000000000 -0700 > > @@ -0,0 +1,30 @@ > > +/* Reverse debugging of floating point registers. > > + > > + =A0 Copyright 2009, Free Software Foundation, Inc. > > + > > + =A0 This file is part of GDB. > > + > > + =A0 This program is free software; you can > redistribute it and/or modify > > + =A0 it under the terms of the GNU General Public > License as published by > > + =A0 the Free Software Foundation; either version 3 of > the License, or > > + =A0 (at your option) any later version. > > + > > + =A0 This program is distributed in the hope that it > will be useful, > > + =A0 but WITHOUT ANY WARRANTY; without even the > implied warranty of > > + =A0 MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. =A0See the > > + =A0 GNU General Public License for more details. > > + > > + =A0 You should have received a copy of the GNU > General Public License > > + =A0 along with this program. =A0If not, see . > > =A0*/ > > + > > +int main (void) > > +{ > > + =A0int i =3D 0; =A0 /* BEGIN I387-FLOAT-REVERSE */ > > + > > + =A0asm ("fldz"); =A0 =A0 =A0 =A0/* test st0 register */ > > + =A0asm ("fld1"); > > + =A0asm ("nop"); > > + > > + =A0return i; =A0 =A0/* END I387-FLOAT-REVERSE */ > > +} > > + > > diff -rNu gdb.tmp/i387-float-reverse.exp > gdb.arch/i387-float-reverse.exp > > --- gdb.tmp/i387-float-reverse.exp =A0 =A0 =A01969-12-31 > 16:00:00.000000000 -0800 > > +++ gdb.arch/i387-float-reverse.exp =A0 =A0 2009-07-11 > 17:30:03.000000000 -0700 > > @@ -0,0 +1,83 @@ > > +# Copyright 2009 Free Software Foundation, Inc. > > + > > +# This program is free software; you can redistribute > it and/or modify > > +# it under the terms of the GNU General Public > License as published by > > +# the Free Software Foundation; either version 3 of > the License, or > > +# (at your option) any later version. > > +# > > +# This program is distributed in the hope that it > will be useful, > > +# but WITHOUT ANY WARRANTY; without even the implied > warranty of > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. =A0See the > > +# GNU General Public License for more details. > > +# > > +# You should have received a copy of the GNU General > Public License > > +# along with this program. =A0If not, see . > > + > > +# This file is part of the gdb testsuite. > > + > > +if $tracelevel { > > + =A0 =A0strace $tracelevel > > +} > > + > > +set prms_id 0 > > +set bug_id 0 > > + > > +if ![istarget "i?86-*linux*"] then { > > + =A0 =A0verbose "Skipping i387 reverse float tests." > > + =A0 =A0return > > +} > > + > > +set testfile "i387-float-reverse" > > +set srcfile ${testfile}.c > > +set binfile ${objdir}/${subdir}/${testfile} > > + > > +# some targets have leading underscores on assembly > symbols. > > +# TODO: detect this automatically > > +set additional_flags "" > > +if [istarget "i?86-*-cygwin*"] then { > > + =A0set additional_flags > "additional_flags=3D-DSYMBOL_PREFIX=3D\"_\"" > > +} > > + > > +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" > "${binfile}" executable > > [list debug $additional_flags]] !=3D "" } { > > + =A0 =A0untested i387-float-reverse > > + =A0 =A0return -1 > > +} > > + > > +# Get things started. > > + > > +gdb_exit > > +gdb_start > > +gdb_reinitialize_dir $srcdir/$subdir > > +gdb_load ${binfile} > > +runto main > > + > > +# Record to end of main > > + > > +set location [gdb_get_line_number "END > I387-FLOAT-REVERSE"] > > +gdb_test "record" "" "Turn on process record" > > +gdb_test "until $location" ".*/$srcfile:$location.*" > \ > > + =A0 =A0"record to end of main" > > + > > +# Now rewind to beginning so we can begin testing. > > + > > +set location [gdb_get_line_number "BEGIN > I387-FLOAT-REVERSE"] > > +gdb_test "set exec-dir reverse" "" "set reverse > direction" > > +gdb_test "until $location" ".*/$srcfile:$location.*" > \ > > + =A0 =A0"rewind to beginning of main" > > +gdb_test "set exec-dir forward" "" "set forward > direction" > > + > > +# Test st0 register > > + > > +set location [gdb_get_line_number "test st0 > register"] > > +gdb_test "until $location" > ".*/$srcfile:$location.*asm.*fldz.*" \ > > + =A0 =A0"begin test st0" > > +gdb_test "stepi" "asm.*fld1.*" =A0 =A0 =A0 =A0 =A0 =A0"set > st0 =3D=3D 0" > > +gdb_test "info register st0" "st0 *0\t.*" "verify st0 > =3D=3D 0" > > +gdb_test "stepi" "asm.*nop.*" =A0 =A0 =A0 =A0 =A0 =A0 "set > st0 =3D=3D 1" > > +gdb_test "info register st0" "st0 *1\t.*" "verify st0 > =3D=3D 1" > > + > > +# Now step backward, and check that st0 value reverts > to zero. > > + > > +gdb_test "reverse-stepi" "asm.*fld1.*" =A0 =A0"undo set > st0 =3D=3D 1" > > +gdb_test "info register st0" "st0 *0\t.*" "verify st0 > =3D=3D 0 again" > > + > > > > >=20