From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA] Handle BINOP_INTDIV in valarith.c
Date: Wed, 16 Jan 2008 14:14:00 -0000 [thread overview]
Message-ID: <002d01c85849$ef420f80$cdc62e80$@u-strasbg.fr> (raw)
While trying to write a pascal expression parser test
I came upon the problem that
BINOP_INTDIV is not handled in value_binop function.
(gdb) set lang pascal
(gdb) print 25 div 2
GDB does not (yet) know how to evaluate that kind of expression
This patch fixes this.
OK to commit?
Pierre Muller
I also noticed that the unsigned case is not guarded against v2 being zero,
but I will send another patch for this once that one is in.
ChangeLog entry:
2008-01-16 Pierre Muller <muller@ics.u-strasbg.fr>
* valarith.c (value_binop): Handle BINOP_INTDIV
for unsigned and signed integers.
Index: gdb/valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.52
diff -u -p -r1.52 valarith.c
--- gdb/valarith.c 7 Jan 2008 22:33:57 -0000 1.52
+++ gdb/valarith.c 16 Jan 2008 14:09:44 -0000
@@ -1033,6 +1033,7 @@ value_binop (struct value *arg1, struct
break;
case BINOP_DIV:
+ case BINOP_INTDIV:
v = v1 / v2;
break;
@@ -1152,6 +1153,7 @@ value_binop (struct value *arg1, struct
break;
case BINOP_DIV:
+ case BINOP_INTDIV:
if (v2 != 0)
v = v1 / v2;
else
next reply other threads:[~2008-01-16 14:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-16 14:14 Pierre Muller [this message]
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 ` [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='002d01c85849$ef420f80$cdc62e80$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--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