This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to long double
- From: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- To: "'Daniel Jacobowitz'" <drow at false dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 1 Feb 2008 16:55:15 +0100
- Subject: RE: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to long double
- References: <000c01c861c5$149352b0$3db9f810$@u-strasbg.fr> <20080131222641.GD6715@caradoc.them.org> <003801c864a4$1866bee0$49343ca0$@u-strasbg.fr> <20080201141546.GA28371@caradoc.them.org>
> -----Original Message-----
> From: 'Daniel Jacobowitz' [mailto:drow@false.org]
> Sent: Friday, February 01, 2008 3:16 PM
> To: Pierre Muller
> Cc: gdb-patches@sourceware.org
> Subject: Re: [Patch] p-exp.y: Typecast left operand of BINOP_DIV to
> long double
>
> On Fri, Feb 01, 2008 at 08:28:52AM +0100, Pierre Muller wrote:
> > > It looks OK to me. Does the type of the left operand completely
> > > determine the type of the operation, or do you need to worry about
> the
> > > type of the right-hand exp too before you cast?
> >
> > But how can I do this?
> > It is still not really clear to me how I can
> > insert a typecast to left operand, only after
> > right operand has been parsed.
> > It would indeed be better to only do the typecast if both are
> integral
> > types.
>
> You could cast the right operand instead; wouldn't that work?
Once the patch from Doug
http://sourceware.org/ml/gdb-patches/2008-01/msg00802.html
is committed, yes.
Until then the ptyp '34 / 3'
would still give the wrong type,
that is the reason why I chose to typecast
the left operand instead of the right one.
As that patch is likely not to be integrated
in 6.8, I thought that it would be better
to have also a correct output for ptype command.
Pierre Muller