From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2309 invoked by alias); 3 May 2012 10:00:01 -0000 Received: (qmail 2142 invoked by uid 22791); 3 May 2012 09:59:59 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 09:59:42 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 4EC22290007; Thu, 3 May 2012 11:59:46 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y1aXilnzlWqD; Thu, 3 May 2012 11:59:46 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 383C7290006; Thu, 3 May 2012 11:59:46 +0200 (CEST) Subject: Re: [RFA] Emit a warning for ineffective set VAR = EXP command Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Tristan Gingold In-Reply-To: Date: Thu, 03 May 2012 10:00:00 -0000 Cc: Tom Tromey , "gdb-patches@sourceware.org ml" Content-Transfer-Encoding: quoted-printable Message-Id: <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> To: Doug Evans 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/msg00061.txt.bz2 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. Grep for other uses to see how > it's used. Ah thanks. I didn't start from the best .exp file. Ok with this version ? testsuite/ 2012-05-02 Tristan Gingold * gdb.base/set-noassign.exp: New test. diff --git a/gdb/testsuite/gdb.base/set-noassign.exp b/gdb/testsuite/gdb.ba= se/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. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +if { [prepare_for_testing set-noassign.exp "set-noassign" start.c {debug n= owarnings}] } { + return -1 +} + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + +# Verify that set command without assignment emits a warning. +# +gdb_test "set language ada" ".*" "set language ada" + +gdb_test "set x=3D3" \ + "warning: Expression is not an assignment \\(and might have no effect\\)"= \ + "warning for set without assignment"