From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>,
"'Joel Brobecker'" <brobecker@adacore.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [RFA] Handle BINOP_INTDIV in valarith.c
Date: Mon, 21 Jan 2008 15:04:00 -0000 [thread overview]
Message-ID: <004101c85c3e$ef8be670$cea3b350$@u-strasbg.fr> (raw)
In-Reply-To: <u8x2np090.fsf@gnu.org>
I would like to have some feedback from the other languages that
seem to also use BINOP_INTDIV.
Furthermore, my patch is 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'
Does this patch work for fortran, ada, modula-2?
I suspect that the type checking is not appropriate for
most of these languages:
Boolean types are not considered as ordinals
in pascal, and probably also not in the languages
cited above.
For pascal, 'print 13 div true'
as well as print 12 + true'
should not be allowed, but it is now...
Is this OK?
ChangeLog entry:
2008-01-21 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);
next prev parent reply other threads:[~2008-01-21 15:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-16 14:14 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 [this message]
2008-01-25 13:07 ` [RFA] Handle BINOP_INTDIV in eval.c Pierre Muller
2008-01-30 1:01 ` 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='004101c85c3e$ef8be670$cea3b350$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--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