From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28289 invoked by alias); 4 May 2010 06:52:35 -0000 Received: (qmail 28278 invoked by uid 22791); 4 May 2010 06:52:34 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 May 2010 06:52:30 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o446qHEa092614 ; Tue, 4 May 2010 08:52:17 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o446qHwi042211 ; Tue, 4 May 2010 08:52:17 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o446qGvf059010 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Tue, 4 May 2010 08:52:16 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Tom Tromey'" Cc: References: <17731.9300863475$1272644394@news.gmane.org> <000c01caea4b$4ef18ba0$ecd4a2e0$@muller@ics-cnrs.unistra.fr> In-Reply-To: Subject: RE: [RFA] examine for TYPE_CODE_REF (PR 11349) Date: Tue, 04 May 2010 06:52:00 -0000 Message-ID: <001801caeb56$599dd070$0cd97150$@muller@ics-cnrs.unistra.fr> 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: 2010-05/txt/msg00062.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Tom Tromey > Envoy=E9=A0: Monday, May 03, 2010 7:40 PM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFA] examine for TYPE_CODE_REF (PR 11349) >=20 > >>>>> "Pierre" =3D=3D Pierre Muller > writes: >=20 > Pierre> +send_gdb "x /hd rps\n" > Pierre> +gdb_expect { > Pierre> + -re ".* -1.*$gdb_prompt $" { > Pierre> + pass "examine value at rps" > Pierre> + } > Pierre> + -re ".*$gdb_prompt $" { fail "examine value at rps" } > Pierre> + timeout { fail "(timeout) examine value at rps" > } > Pierre> + } > Pierre> + >=20 > These days we're trying to use gdb_test rather than send_gdb. > The patch is ok with that change. It's just that all the other tests around this one where also written using gdb_expect, and I simply copy and adapted one... Thanks for the approval, patch committed http://sourceware.org/ml/gdb-cvs/2010-05/msg00026.html Pierre PS: I had one point for which I was unsure: I use '/h' modifier which means 16 bit size, are there any systems for which C type 'short' is not 16 bit in size? On such systems, the test might fail ... For the testsuite, this is how I modified it: Index: testsuite/gdb.cp/ref-types.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/ref-types.exp,v retrieving revision 1.12 diff -u -p -r1.12 ref-types.exp --- testsuite/gdb.cp/ref-types.exp 1 Jan 2010 07:32:01 -0000 1.12 +++ testsuite/gdb.cp/ref-types.exp 4 May 2010 06:47:56 -0000 @@ -200,6 +200,11 @@ gdb_expect { timeout { fail "(timeout) print value of *rps" } } =20 +# GDB had a bug about dereferencing a pointer type +# that would lead to wrong results +# if we try to examine memory at pointer value. + +gdb_test "x /hd rps" "$hex:\[ \t\]*-1" "examine value at rps" =20 send_gdb "ptype rps\n" gdb_expect {