From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3630 invoked by alias); 29 Jan 2008 05:35:27 -0000 Received: (qmail 3622 invoked by uid 22791); 29 Jan 2008 05:35:26 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 Jan 2008 05:35:09 +0000 Received: from zps75.corp.google.com (zps75.corp.google.com [172.25.146.75]) by smtp-out.google.com with ESMTP id m0T5YnZ9004521 for ; Tue, 29 Jan 2008 05:34:49 GMT Received: from rv-out-0910.google.com (rvbg11.prod.google.com [10.140.83.11]) by zps75.corp.google.com with ESMTP id m0T5Ymrk001818 for ; Mon, 28 Jan 2008 21:34:48 -0800 Received: by rv-out-0910.google.com with SMTP id g11so1590365rvb.25 for ; Mon, 28 Jan 2008 21:34:48 -0800 (PST) Received: by 10.140.192.9 with SMTP id p9mr1734896rvf.103.1201584888279; Mon, 28 Jan 2008 21:34:48 -0800 (PST) Received: by 10.141.186.16 with HTTP; Mon, 28 Jan 2008 21:34:48 -0800 (PST) Message-ID: Date: Tue, 29 Jan 2008 06:32:00 -0000 From: "Doug Evans" To: "GDB Patches" Subject: Re: [BUG] BINOP_DIV and ptyp command Cc: "Pierre Muller" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <002301c85c12$a73a4640$f5aed2c0$@u-strasbg.fr> 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: 2008-01/txt/msg00667.txt.bz2 On Jan 28, 2008 8:52 PM, Doug Evans wrote: > [...] > So it seems like the following is the correct patch. Well, not quite. Ok to check the appended patch in? Changing the expected result to long makes / and % no longer special - x*y has an expected result of long. One can argue it should be int, but any fix for that is orthogonal to fixing / and % handling. I think. Derived from whatis-exp.exp: (gdb) whatis x type = int (gdb) whatis y type = int (gdb) whatis x*y type = long 2008-01-28 Doug Evans * eval.c (evaluate_subexp_standard): If DIV/REM/MOD and EVAL_AVOID_SIDE_EFFECTS, remove special case and process normally. * gdb.base/whatis-exp.exp: Update expected result of x/y and x%y. Index: eval.c =================================================================== RCS file: /cvs/src/src/gdb/eval.c,v retrieving revision 1.77 diff -u -p -r1.77 eval.c --- eval.c 18 Jan 2008 17:07:39 -0000 1.77 +++ eval.c 29 Jan 2008 05:27:55 -0000 @@ -1509,9 +1509,6 @@ evaluate_subexp_standard (struct type *e goto nosideret; if (binop_user_defined_p (op, arg1, arg2)) return value_x_binop (arg1, arg2, op, OP_NULL, noside); - else if (noside == EVAL_AVOID_SIDE_EFFECTS - && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD)) - return value_zero (value_type (arg1), not_lval); else return value_binop (arg1, arg2, op); Index: testsuite/gdb.base/whatis-exp.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/whatis-exp.exp,v retrieving revision 1.7 diff -u -p -r1.7 whatis-exp.exp --- testsuite/gdb.base/whatis-exp.exp 1 Jan 2008 22:53:19 -0000 1.7 +++ testsuite/gdb.base/whatis-exp.exp 29 Jan 2008 05:27:55 -0000 @@ -139,7 +139,7 @@ gdb_expect { send_gdb "whatis x/y\n" gdb_expect { - -re ".*type = int.*$gdb_prompt $" { + -re ".*type = long.*$gdb_prompt $" { pass "whatis value of x/y" } -re ".*$gdb_prompt $" { fail "whatis value of x/y" } @@ -148,7 +148,7 @@ gdb_expect { send_gdb "whatis x%y\n" gdb_expect { - -re ".*type = int.*$gdb_prompt $" { + -re ".*type = long.*$gdb_prompt $" { pass "whatis value of x%y" } -re ".*$gdb_prompt $" { fail "whatis value of x%y" }