From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27902 invoked by alias); 7 May 2012 10:30:47 -0000 Received: (qmail 27894 invoked by uid 22791); 7 May 2012 10:30:46 -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; Mon, 07 May 2012 10:30:22 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6B2A0290009; Mon, 7 May 2012 12:30:26 +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 EiHW3v19igo9; Mon, 7 May 2012 12:30:26 +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 58B9D290001; Mon, 7 May 2012 12:30:26 +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=us-ascii From: Tristan Gingold In-Reply-To: Date: Mon, 07 May 2012 10:30:00 -0000 Cc: "gdb-patches@sourceware.org ml" Content-Transfer-Encoding: quoted-printable Message-Id: References: <8781499A-A489-42D0-80B1-75136331DBDB@adacore.com> To: Maciej W. Rozycki 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/msg00172.txt.bz2 On May 4, 2012, at 9:01 PM, Maciej W. Rozycki wrote: > On Fri, 27 Apr 2012, Tristan Gingold wrote: >=20 >> the 'set VAR=3DEXP' command is a real trap for Ada (and maybe other=20 >> languages such as Pascal users), because the '=3D' is interpreted as=20 >> BINOP_EQUAL instead of BINOP_ASSIGN. You often do not realize that the= =20 >> current language is not C where you are using to command for registers=20 >> or convenience variables. >>=20 >> I simply propose to emit a warning if the expression is not an=20 >> assignment (or a comma expression). >>=20 >> No regressions on x86_64 GNU/Linux. >>=20 >> Ok for trunk ? >>=20 >> 2012-04-27 Tristan Gingold >>=20 >> * printcmd.c (set_command): Emit a warning if the expression is not >> an assignment. >=20 > It does regress gdb.base/freebpcmd.exp apparently: >=20 > Breakpoint 1, main (argc=3D1, argv=3D0xbffff904) at .../gdb/testsuite/gdb= .base/freebpcmd.c:27 > 27 printf (">>> %d\n", i); /* euphonium */ > "odd "$79 =3D 39 > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > warning: Expression is not an assignment (and might have no effect) > ERROR: internal buffer is full. > UNRESOLVED: gdb.base/freebpcmd.exp: run program with breakpoint commands >=20 > This warns about "set variable $j++" presumably -- should the warning be= =20 > disabled for pre/post increments/decrements? I am not opposed to disable warnings for pre/post inc/dec. But this usage is dubious (the help explicitly mentions VAR=3DEXP !) Opinion ? Tristan.