From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15338 invoked by alias); 28 Dec 2007 13:10:24 -0000 Received: (qmail 15328 invoked by uid 22791); 28 Dec 2007 13:10:23 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 28 Dec 2007 13:10:18 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B352A2A9674; Fri, 28 Dec 2007 08:10:16 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uruVCrmmfCq8; Fri, 28 Dec 2007 08:10:16 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1F6E82A9661; Fri, 28 Dec 2007 08:10:16 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id BB50BE7ACB; Fri, 28 Dec 2007 17:10:08 +0400 (RET) Date: Fri, 28 Dec 2007 13:22:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [commit/ada+testsuite] print ada boolean expression results as true/false Message-ID: <20071228131008.GE24450@adacore.com> References: <20071228061513.GA24450@adacore.com> <200712281032.lBSAWfAR000724@brahms.sibelius.xs4all.nl> <20071228130714.GD24450@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="pQhZXvAqiZgbeUkD" Content-Disposition: inline In-Reply-To: <20071228130714.GD24450@adacore.com> User-Agent: Mutt/1.4.2.2i 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: 2007-12/txt/msg00437.txt.bz2 --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 300 > Sure, that's a good idea. Fixed with the attached patch: > > 2007-12-28 Joel Brobecker > > * ada-lang.c (ada_evaluate_subexp): Break two large expressions > using temporary variables. > > Tested on x86-linux, no regression. Checked in. Ahem. -- Joel --pQhZXvAqiZgbeUkD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="temp.diff" Content-length: 1246 Index: ada-lang.c =================================================================== --- ada-lang.c (revision 14) +++ ada-lang.c (revision 15) @@ -8516,20 +8516,26 @@ ada_evaluate_subexp (struct type *expect case BINOP_LOGICAL_AND: case BINOP_LOGICAL_OR: case UNOP_LOGICAL_NOT: - *pos -= 1; - return value_cast (LA_BOOL_TYPE, - evaluate_subexp_standard (expect_type, exp, - pos, noside)); + { + struct value *val; + + *pos -= 1; + val = evaluate_subexp_standard (expect_type, exp, pos, noside); + return value_cast (LA_BOOL_TYPE, val); + } case BINOP_BITWISE_AND: case BINOP_BITWISE_IOR: case BINOP_BITWISE_XOR: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); - *pos = pc; - return value_cast (value_type (arg1), - evaluate_subexp_standard (expect_type, exp, - pos, noside)); - + { + struct value *val; + + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + *pos = pc; + val = evaluate_subexp_standard (expect_type, exp, pos, noside); + + return value_cast (value_type (arg1), val); + } case OP_VAR_VALUE: *pos -= 1; --pQhZXvAqiZgbeUkD--