From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30574 invoked by alias); 3 May 2012 13:12:52 -0000 Received: (qmail 30364 invoked by uid 22791); 3 May 2012 13:12:49 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,BOTNET,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 13:12:27 +0000 Received: by vcbfy7 with SMTP id fy7so1569914vcb.0 for ; Thu, 03 May 2012 06:12:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=oP6KtaxctgzfiX4zJ8RBFDeU30CwudwGT80Mr9IDPqc=; b=mZ9dRw+OO70y+Yn7LsCav6WIrxxYSh0U/JSyhvVuvnPtDSsUoFgq62AkNU2Kfc00Bm Rr0ht0IWkmnwMxeUUVJEaY6ziqJHgBilHSWzVkgc/q1NjdfPFlexlRVTRJoaXTIXIcIE DS7DaIxnQkQii/tT/j8zixMvOUP6yt1K51itT4NJwpTpAz9A3z1vl9emxwmRqbVFUi74 LsioFxgg1fXzn8iTfisPTyUzRpnzyJEwm+BRf4MeSGwgfB/xn7ZvFmW3LensY8s3RXB8 cXPt4l39uicZJekR1gPPBE28LgrexDR6nIAg2ocqb1EzNJXQrY4W4gYnfhEJawitU/f4 mkpg== Received: by 10.52.36.40 with SMTP id n8mr108765vdj.84.1336050746507; Thu, 03 May 2012 06:12:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.36.40 with SMTP id n8mr108757vdj.84.1336050746326; Thu, 03 May 2012 06:12:26 -0700 (PDT) Received: by 10.52.165.2 with HTTP; Thu, 3 May 2012 06:12:26 -0700 (PDT) In-Reply-To: <98CB5870-6AB6-40FA-B3A1-9AF8269B2909@adacore.com> References: <8781499A-A489-42D0-80B1-75136331DBDB@adacore.com> <87mx5x40uz.fsf@fleche.redhat.com> <05ADE46C-9093-4EE4-92A7-1232779DE5DC@adacore.com> <98CB5870-6AB6-40FA-B3A1-9AF8269B2909@adacore.com> Date: Thu, 03 May 2012 13:12:00 -0000 Message-ID: Subject: Re: [RFA] Emit a warning for ineffective set VAR = EXP command From: Doug Evans To: Tristan Gingold Cc: Tom Tromey , "gdb-patches@sourceware.org ml" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQnjvTD7LCKCybgcXXWIgPSdooXmoHpvq5M0k05FW5DRBtxA+Yu0/Dq87McZ27ZpiR+c/TFWF4VVBF/tPz25k+Vyz/b0thHfUXsP/L8OpD686o2PYZM4xvkvRb5c+bIFE05I8uprdKZds/g4ilzuyEfDI0zyhA== X-IsSubscribed: yes 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: 2012-05/txt/msg00063.txt.bz2 On Thu, May 3, 2012 at 2:59 AM, Tristan Gingold wrote: > > On May 2, 2012, at 6:40 PM, Doug Evans wrote: > >> I think the convention now is to use prepare_for_testing to simplify a >> lot of the setup in the .exp file. =A0Grep for other uses to see how >> it's used. > > Ah thanks. =A0I didn't start from the best .exp file. > > Ok with this version ? > > testsuite/ > 2012-05-02 =A0Tristan Gingold =A0 > > =A0 =A0 =A0 =A0* gdb.base/set-noassign.exp: New test. > > > diff --git a/gdb/testsuite/gdb.base/set-noassign.exp b/gdb/testsuite/gdb.= base/set-noassign.exp > new file mode 100644 > index 0000000..c9971f5 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/set-noassign.exp > @@ -0,0 +1,32 @@ > +# Copyright 2012 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 . > + > + > +if { [prepare_for_testing set-noassign.exp "set-noassign" start.c {debug= nowarnings}] } { > + =A0 =A0return -1 > +} > + > +if ![runto_main] then { > + =A0 =A0fail "Can't run to main" > + =A0 =A0return 0 > +} > + > +# Verify that set command without assignment emits a warning. > +# > +gdb_test "set language ada" ".*" "set language ada" > + > +gdb_test "set x=3D3" \ > + =A0 =A0 =A0 "warning: Expression is not an assignment \\(and might have= no effect\\)" \ > + =A0 =A0 =A0 "warning for set without assignment" > Ok with one more change. -gdb_test "set language ada" ".*" "set language ada" +gdb_test_no_output "set language ada" [I'm assuming the warning test has the desired affect. I don't know ada. := -)]