Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Joel Brobecker'" <brobecker@adacore.com>
Cc: <gdb-patches@sourceware.org>
Subject: [RFA] Handle BINOP_INTDIV in eval.c
Date: Fri, 25 Jan 2008 13:07:00 -0000	[thread overview]
Message-ID: <004001c85f40$60c92600$225b7200$@u-strasbg.fr> (raw)
In-Reply-To: <u8x2np090.fsf@gnu.org>

 My first patch handling BINOP_INTDIV was incomplete,
I forgot the eval.c part that is required:

I send here a minimal patch to
allow to get a 'print 13 div 3' to return '4'

  Is this OK?
  
ChangeLog entry:

2008-01-25  Pierre Muller  <muller@ics.u-strasbg.fr>

	* eval.c (evaluate_subexp_standard): Support
	BINOP_INTDIV opcode.


Index: gdb/eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.77
diff -u -p -r1.77 eval.c
--- gdb/eval.c  18 Jan 2008 17:07:39 -0000      1.77
+++ gdb/eval.c  21 Jan 2008 14:55:45 -0000
@@ -1496,6 +1496,7 @@ evaluate_subexp_standard (struct type *e
     case BINOP_EXP:
     case BINOP_MUL:
     case BINOP_DIV:
+    case BINOP_INTDIV:
     case BINOP_REM:
     case BINOP_MOD:
     case BINOP_LSH:
@@ -1510,7 +1511,8 @@ evaluate_subexp_standard (struct type *e
       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))
+              && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD
+                  || op == BINOP_INTDIV))
        return value_zero (value_type (arg1), not_lval);
       else
        return value_binop (arg1, arg2, op);





  parent reply	other threads:[~2008-01-25 10:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 14:14 [RFA] Handle BINOP_INTDIV in valarith.c Pierre Muller
2008-01-16 19:11 ` Eli Zaretskii
2008-01-21 10:45   ` Pierre Muller
2008-01-23 18:25     ` Joel Brobecker
2008-01-23 22:36       ` Pierre Muller
2008-01-23 23:09         ` Joel Brobecker
2008-01-23 23:55           ` Pierre Muller
2008-01-24  1:30             ` Joel Brobecker
2008-01-23 19:07     ` Tom Tromey
2008-01-23 23:00       ` Pierre Muller
2008-01-24  0:27         ` Tom Tromey
2008-01-17 11:58 ` Joel Brobecker
2008-01-17 12:04   ` Joel Brobecker
2008-01-18 16:27     ` Eli Zaretskii
2008-01-21 15:04       ` Pierre Muller
2008-01-25 13:07       ` Pierre Muller [this message]
2008-01-30  1:01         ` [RFA] Handle BINOP_INTDIV in eval.c Daniel Jacobowitz
2008-01-30  7:35           ` Pierre Muller

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='004001c85f40$60c92600$225b7200$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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