From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1915 invoked by alias); 4 May 2012 19:02:20 -0000 Received: (qmail 1905 invoked by uid 22791); 4 May 2012 19:02:19 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 May 2012 19:02:06 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SQNlU-0003e7-OE from Maciej_Rozycki@mentor.com ; Fri, 04 May 2012 12:02:04 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 4 May 2012 12:02:04 -0700 Received: from [172.30.1.40] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Fri, 4 May 2012 20:02:02 +0100 Date: Fri, 04 May 2012 19:02:00 -0000 From: "Maciej W. Rozycki" To: Tristan Gingold CC: "gdb-patches@sourceware.org ml" Subject: Re: [RFA] Emit a warning for ineffective set VAR = EXP command In-Reply-To: <8781499A-A489-42D0-80B1-75136331DBDB@adacore.com> Message-ID: References: <8781499A-A489-42D0-80B1-75136331DBDB@adacore.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" 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/msg00135.txt.bz2 On Fri, 27 Apr 2012, Tristan Gingold wrote: > the 'set VAR=EXP' command is a real trap for Ada (and maybe other > languages such as Pascal users), because the '=' is interpreted as > BINOP_EQUAL instead of BINOP_ASSIGN. You often do not realize that the > current language is not C where you are using to command for registers > or convenience variables. > > I simply propose to emit a warning if the expression is not an > assignment (or a comma expression). > > No regressions on x86_64 GNU/Linux. > > Ok for trunk ? > > 2012-04-27 Tristan Gingold > > * printcmd.c (set_command): Emit a warning if the expression is not > an assignment. It does regress gdb.base/freebpcmd.exp apparently: Breakpoint 1, main (argc=1, argv=0xbffff904) at .../gdb/testsuite/gdb.base/freebpcmd.c:27 27 printf (">>> %d\n", i); /* euphonium */ "odd "$79 = 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 This warns about "set variable $j++" presumably -- should the warning be disabled for pre/post increments/decrements? Maciej