Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Doug Evans'" <dje@google.com>
Cc: "'Joel Brobecker'" <brobecker@adacore.com>,
		"'GDB Patches'" <gdb-patches@sourceware.org>
Subject: RE: [BUG] BINOP_DIV and ptyp command
Date: Tue, 29 Jan 2008 16:34:00 -0000	[thread overview]
Message-ID: <001801c86293$7c116b10$74344130$@u-strasbg.fr> (raw)
In-Reply-To: <e394668d0801290751s7e68fddasa300e612ad6f421e@mail.gmail.com>

Doug, I tend to agree with you that
we should always call value_binop,
or never, not on all cases
except BINOP_DIV, BINOP_INTDIV, BINOP_REM and BINOP_MOD
this is not logical as you explained it.

 The current code makes
those operators listed above act 
differently from other operators for 'ptype' command
and lead to several cases where
(gdb) print EXPR
$? = EXPRESULT
(gdb) ptype $
returns another type than
(gdb) ptype EXPR

  The implicit conversion rules in
value_binop are rather complicated...

Try for instance

(gdb) ptyp 1.5 * 2.5l
type = long double
but 
(top-gdb) p 1.5 / 2.5l
$1 = 0.60000000000000000002168404344971009
(top-gdb) ptyp $
type = long double
(top-gdb) ptyp 1.5 / 2.5l
type = double

But anyhow,
(gdb) ptyp 1 * 2.5
type = double
but 
(top-gdb) p 1 / 2.5
$1 = 0.40000000000000000002
(top-gdb) ptyp $
type = double
(top-gdb) ptyp 1 / 2.5
type = int 
Is obviously a much bigger bug, no?

I don't care much about 'int' 'long int' or 'long long int'
but 'int' and 'double' are completely different story!

Pierre



  reply	other threads:[~2008-01-29 16:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <002301c85c12$a73a4640$f5aed2c0$@u-strasbg.fr>
2008-01-29  5:26 ` Doug Evans
2008-01-29  6:32   ` Doug Evans
2008-01-29 14:42     ` Daniel Jacobowitz
2008-01-29 16:16       ` Doug Evans
2008-01-29 16:24         ` Doug Evans
2008-01-29 16:37           ` Daniel Jacobowitz
2008-01-29  7:35   ` Joel Brobecker
2008-01-29  7:51     ` Pierre Muller
2008-01-29 13:46       ` Daniel Jacobowitz
2008-01-29 15:17         ` Pierre Muller
2008-01-29 16:25           ` 'Daniel Jacobowitz'
2008-01-29 16:04       ` Doug Evans
2008-01-29 16:34         ` Pierre Muller [this message]
2008-01-29 15:51     ` Doug Evans
2008-01-29 16:49       ` Daniel Jacobowitz

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='001801c86293$7c116b10$74344130$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=brobecker@adacore.com \
    --cc=dje@google.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