Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [commit/ada+testsuite] print ada boolean expression results as true/false
Date: Fri, 28 Dec 2007 13:22:00 -0000	[thread overview]
Message-ID: <20071228131008.GE24450@adacore.com> (raw)
In-Reply-To: <20071228130714.GD24450@adacore.com>

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

> Sure, that's a good idea. Fixed with the attached patch:
> 
> 2007-12-28  Joel Brobecker  <brobecker@adacore.com>
> 
>         * ada-lang.c (ada_evaluate_subexp): Break two large expressions
>         using temporary variables.
> 
> Tested on x86-linux, no regression. Checked in.

Ahem.

-- 
Joel

[-- Attachment #2: temp.diff --]
[-- Type: text/plain, Size: 1246 bytes --]

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;

      reply	other threads:[~2007-12-28 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-28  6:36 Joel Brobecker
2007-12-28 10:33 ` Mark Kettenis
2007-12-28 13:10   ` Joel Brobecker
2007-12-28 13:22     ` Joel Brobecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071228131008.GE24450@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox